svn commit: trunk/uClibc: ldso/ldso/powerpc libc/sysdeps/linux/pow etc...
jocke at uclibc.org
jocke at uclibc.org
Thu Dec 15 07:50:27 UTC 2005
Author: jocke
Date: 2005-12-14 23:50:05 -0800 (Wed, 14 Dec 2005)
New Revision: 12893
Log:
Fix static apps on linux 2.6. Linux clobbers r7 in 2.6, so
use r3 instead to pass _dl_fini.
Modified:
trunk/uClibc/ldso/ldso/powerpc/dl-startup.h
trunk/uClibc/libc/sysdeps/linux/powerpc/crt1.S
Changeset:
Modified: trunk/uClibc/ldso/ldso/powerpc/dl-startup.h
===================================================================
--- trunk/uClibc/ldso/ldso/powerpc/dl-startup.h 2005-12-15 07:42:13 UTC (rev 12892)
+++ trunk/uClibc/ldso/ldso/powerpc/dl-startup.h 2005-12-15 07:50:05 UTC (rev 12893)
@@ -42,8 +42,10 @@
" 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 at 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 at 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"
Modified: trunk/uClibc/libc/sysdeps/linux/powerpc/crt1.S
===================================================================
--- trunk/uClibc/libc/sysdeps/linux/powerpc/crt1.S 2005-12-15 07:42:13 UTC (rev 12892)
+++ trunk/uClibc/libc/sysdeps/linux/powerpc/crt1.S 2005-12-15 07:50:05 UTC (rev 12893)
@@ -60,7 +60,8 @@
lwz r4,0(r9)
/* find argv one word offset from the stack pointer */
addi r5,r9,4
- mr r8,r7 /* Pass _dl_fini from ldso or NULL if statically linked */
+ mr r8,r3 /* Pass _dl_fini from ldso or NULL if statically linked
+ Note: using r3 instead of r7, since linux 2.6 clobbers r7 */
/* Ok, now run uClibc's main() -- shouldn't return */
#ifdef __PIC__
lwz r6,_init at got(r31)
More information about the uClibc-cvs
mailing list