[uClibc-cvs] uClibc/libc/sysdeps/linux/sparc crt0.c,1.4,1.5

Erik Andersen andersen at uclibc.org
Fri Mar 19 20:38:12 UTC 2004


Update of /var/cvs/uClibc/libc/sysdeps/linux/sparc
In directory nail:/tmp/cvs-serv31084/libc/sysdeps/linux/sparc

Modified Files:
	crt0.c 
Log Message:
Patch from Stefan Holst to fix argv[0]


Index: crt0.c
===================================================================
RCS file: /var/cvs/uClibc/libc/sysdeps/linux/sparc/crt0.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- a/crt0.c	14 Apr 2002 03:42:45 -0000	1.4
+++ b/crt0.c	19 Mar 2004 20:38:10 -0000	1.5
@@ -28,16 +28,16 @@
 extern void __uClibc_main(int argc,void *argv,void *envp);
 
 
-void _start(unsigned int first_arg)
+void _start(void)
 {
 	unsigned int argc;
 	char **argv, **envp;
 	unsigned long *stack;
 
-	stack = (unsigned long*) &first_arg;
-	argc = *(stack - 1);
-	argv = (char **) stack;
-	envp = (char **)stack + argc + 1;
+	stack = ((unsigned long*)__builtin_frame_address(0))+16;
+	argc = *stack;
+	argv = (char **)stack + 1;
+	envp = (char **)stack + argc + 2;
 
 	__uClibc_main(argc, argv, envp);
 }




More information about the uClibc-cvs mailing list