From 813349ca63e3987cb6a2567cbfbd8572ae78554f Mon Sep 17 00:00:00 2001 From: Joakim Tjernlund Date: Thu, 15 Dec 2005 07:50:05 +0000 Subject: Fix static apps on linux 2.6. Linux clobbers r7 in 2.6, so use r3 instead to pass _dl_fini. --- ldso/ldso/powerpc/dl-startup.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'ldso/ldso/powerpc/dl-startup.h') diff --git a/ldso/ldso/powerpc/dl-startup.h b/ldso/ldso/powerpc/dl-startup.h index 6fdf74301..e6fd814e5 100644 --- a/ldso/ldso/powerpc/dl-startup.h +++ b/ldso/ldso/powerpc/dl-startup.h @@ -42,8 +42,10 @@ asm( " bne 2b\n" " addi 6,6,4\n" #endif - /* Pass a termination function pointer (in this case _dl_fini) in r7. */ - " lwz 7,_dl_fini@got(31)\n" + /* Pass a termination function pointer (in this case _dl_fini) in r3. */ + /* Paulus promized he would keep r3 zero in the exec ABI. */ + " lwz 3,_dl_fini@got(31)\n" + " mr 7,3\n" /* Pass _dl_fini in r7 to maintain compat */ " bctr\n" /* Jump to entry point */ " .size _start,.-_start\n" " .previous\n" -- cgit v1.2.3