From 38cd8e780fc6375117e8bc7db2eca17764779bba Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Thu, 18 Mar 2004 08:00:40 +0000 Subject: 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? --- ldso/ldso/powerpc/dl-startup.h | 12 ++++-------- 1 file 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)) -- cgit v1.2.3