summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/powerpc
diff options
context:
space:
mode:
authorDavid Schleef <ds@schleef.org>2001-05-26 01:39:15 +0000
committerDavid Schleef <ds@schleef.org>2001-05-26 01:39:15 +0000
commitd0c0ebb78efe2fba3132c78c70b26373b4660353 (patch)
tree91f310b5af225b09a30969fde2a88441b76fb774 /libc/sysdeps/linux/powerpc
parent78b639ee5f507bf43f7570d025b82bf4d28f602c (diff)
Nasty hack to get around inconsistency between dynamic linker
entry and kernel entry to crt0.o.
Diffstat (limited to 'libc/sysdeps/linux/powerpc')
-rw-r--r--libc/sysdeps/linux/powerpc/crt0.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/libc/sysdeps/linux/powerpc/crt0.c b/libc/sysdeps/linux/powerpc/crt0.c
index c16bde89f..b7e7f9b15 100644
--- a/libc/sysdeps/linux/powerpc/crt0.c
+++ b/libc/sysdeps/linux/powerpc/crt0.c
@@ -24,7 +24,12 @@
asm(
"\t.global _start\n"
"\t_start:\n"
+ //"\tmr 9,1\n"
+ //"\trlwinm 1,1,0,0,27\n"
+ "\tli 0,0\n"
"\tstwu 1,-32(1)\n"
+ "\tmtlr 0\n"
+ //"\tstw 0,0(1)\n"
"\tb _start2\n");
void __uClibc_main(int argc,void *argv,void *envp);
@@ -34,10 +39,16 @@ void _start2(void)
void **p;
int argc;
- p=__builtin_frame_address(2);
+ p=__builtin_frame_address(0)+0x30;
argc=*(int *)p;
+ /* gross hack for dynamic linker */
+ if(argc==0){
+ p=((void *)p)+0x10;
+ argc=*(int *)p;
+ }
+
__uClibc_main(argc,p+1,p+2+argc);
}