[uClibc-cvs] uClibc/ldso/ldso/powerpc dl-startup.h,1.9,1.10

Erik Andersen andersen at uclibc.org
Thu Mar 18 08:00:42 UTC 2004


Update of /var/cvs/uClibc/ldso/ldso/powerpc
In directory nail:/home/andersen/CVS/uClibc/ldso/ldso/powerpc

Modified Files:
	dl-startup.h 
Log Message:
Joakim Tjernlund writes:

Hi

I just noticed that gcc has an "b"(Address base register) operand that
will match all "r" registers but r0. It is a better fix then adding
r0 to the clobber list.

What do you think?



Index: dl-startup.h
===================================================================
RCS file: /var/cvs/uClibc/ldso/ldso/powerpc/dl-startup.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- a/dl-startup.h	17 Feb 2004 10:55:56 -0000	1.9
+++ b/dl-startup.h	18 Mar 2004 08:00:40 -0000	1.10
@@ -54,20 +54,16 @@
  * call the _dl_elf_main function.
  */
 
-/* hgb at ifi.uio.no:
- * Adding a clobber list consisting of r0 for %1.  addi on PowerPC
- * takes a register as the second argument, but if the register is
- * r0, the value 0 is used instead.  If r0 is used here, the stack
- * pointer (r1) will be zeroed, and the dynamically linked
- * application will seg.fault immediatly when receiving control.
+/*
+ * Use "b"(Address base register) operand for %1 since "b" excludes
+ * r0 which is important for the addi instruction in this case. 
  */
 #define START()		\
 	__asm__ volatile ( \
 		    "addi 1,%1,0\n\t" \
 		    "mtlr %0\n\t" \
 		    "blrl\n\t"	\
-		    : : "r" (_dl_elf_main), "r" (args) \
-		    : "r0")
+		    : : "r" (_dl_elf_main), "b" (args))
 
 
 




More information about the uClibc-cvs mailing list