summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2004-03-19 20:38:10 +0000
committerEric Andersen <andersen@codepoet.org>2004-03-19 20:38:10 +0000
commit33d1ef86d171d0fbf058d664a3cb53842b08f2ae (patch)
tree4ea5ea9adf2e47733d5b0d61bd0e2e52e8d1cf07
parent00fec46c1794e4134c41a5b42ea438b2911c32ac (diff)
Patch from Stefan Holst to fix argv[0]
-rw-r--r--libc/sysdeps/linux/sparc/crt0.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/libc/sysdeps/linux/sparc/crt0.c b/libc/sysdeps/linux/sparc/crt0.c
index 8272f3dde..81caf1eed 100644
--- a/libc/sysdeps/linux/sparc/crt0.c
+++ b/libc/sysdeps/linux/sparc/crt0.c
@@ -28,16 +28,16 @@ void (*mainp)(int argc,void *argv,void *envp) = main;
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);
}