summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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))