summaryrefslogtreecommitdiff
path: root/libc
diff options
context:
space:
mode:
Diffstat (limited to 'libc')
-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);
}