summaryrefslogtreecommitdiff
path: root/ldso
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2004-03-18 08:00:40 +0000
committerEric Andersen <andersen@codepoet.org>2004-03-18 08:00:40 +0000
commit38cd8e780fc6375117e8bc7db2eca17764779bba (patch)
tree073dc72b76f28d38edf4846aded0328aebfce1e2 /ldso
parenta740502a3d857a70f64fe31fda87b775d4cf1126 (diff)
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?
Diffstat (limited to 'ldso')
-rw-r--r--ldso/ldso/powerpc/dl-startup.h12
1 files changed, 4 insertions, 8 deletions
diff --git a/ldso/ldso/powerpc/dl-startup.h b/ldso/ldso/powerpc/dl-startup.h
index a167ae866..b33d6c5a7 100644
--- a/ldso/ldso/powerpc/dl-startup.h
+++ b/ldso/ldso/powerpc/dl-startup.h
@@ -54,20 +54,16 @@ asm("" \
* call the _dl_elf_main function.
*/
-/* hgb@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))