summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ldso/ldso/powerpc/dl-sysdep.h12
-rw-r--r--ldso/ldso/powerpc/ld_sysdep.h12
2 files changed, 20 insertions, 4 deletions
diff --git a/ldso/ldso/powerpc/dl-sysdep.h b/ldso/ldso/powerpc/dl-sysdep.h
index fb22d1585..abd426830 100644
--- a/ldso/ldso/powerpc/dl-sysdep.h
+++ b/ldso/ldso/powerpc/dl-sysdep.h
@@ -99,13 +99,21 @@
* is done. This routine has to exit the current function, then
* 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.
+ */
#define START() \
__asm__ volatile ( \
"addi 1,%1,0\n\t" \
"mtlr %0\n\t" \
"blrl\n\t" \
- : : "r" (_dl_elf_main), "r" (args))
-
+ : : "r" (_dl_elf_main), "r" (args) \
+ : "r0")
/* Here we define the magic numbers that this dynamic loader should accept */
diff --git a/ldso/ldso/powerpc/ld_sysdep.h b/ldso/ldso/powerpc/ld_sysdep.h
index fb22d1585..abd426830 100644
--- a/ldso/ldso/powerpc/ld_sysdep.h
+++ b/ldso/ldso/powerpc/ld_sysdep.h
@@ -99,13 +99,21 @@
* is done. This routine has to exit the current function, then
* 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.
+ */
#define START() \
__asm__ volatile ( \
"addi 1,%1,0\n\t" \
"mtlr %0\n\t" \
"blrl\n\t" \
- : : "r" (_dl_elf_main), "r" (args))
-
+ : : "r" (_dl_elf_main), "r" (args) \
+ : "r0")
/* Here we define the magic numbers that this dynamic loader should accept */