svn commit: trunk/uClibc/libc/sysdeps/linux/powerpc

jocke at uclibc.org jocke at uclibc.org
Mon Mar 19 11:02:17 PDT 2007


Author: jocke
Date: 2007-03-19 11:02:16 -0700 (Mon, 19 Mar 2007)
New Revision: 18166

Log:
Joseph S. Myers writes:
On PowerPC, r13 is used for a small data pointer and needs to be set up 
from _SDA_BASE_ (defined by the linker) at startup.

This is needed for the GCC testcase gcc.target/powerpc/980827-1.c to work.  
This patch fixes that testcase (verified for both static and dynamic 
linking).


Modified:
   trunk/uClibc/libc/sysdeps/linux/powerpc/crt1.S


Changeset:
Modified: trunk/uClibc/libc/sysdeps/linux/powerpc/crt1.S
===================================================================
--- trunk/uClibc/libc/sysdeps/linux/powerpc/crt1.S	2007-03-19 16:04:11 UTC (rev 18165)
+++ trunk/uClibc/libc/sysdeps/linux/powerpc/crt1.S	2007-03-19 18:02:16 UTC (rev 18166)
@@ -58,6 +58,13 @@
 	mflr	r31
 # endif
 #endif
+	/* Set up the small data pointer in r13.  */
+#ifdef __PIC__
+	lwz	r13,_SDA_BASE_ at got(r31)
+#else
+	lis	r13,_SDA_BASE_ at ha
+	addi	r13,r13,_SDA_BASE_ at l
+#endif
 	/* Set up an initial stack frame, and clear the LR.  */
 	li	r0,0
 	stwu	r1,-16(r1)



More information about the uClibc-cvs mailing list