summaryrefslogtreecommitdiff
path: root/ldso/ldso/powerpc/dl-startup.h
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2004-01-20 17:44:17 +0000
committerEric Andersen <andersen@codepoet.org>2004-01-20 17:44:17 +0000
commit4401cfb819df129c749a9408762a8152e3faaa7d (patch)
treef5ed0c9d69f233f01e190ba7dbf4332d3328c55f /ldso/ldso/powerpc/dl-startup.h
parenta1994c00a6accfb3dd4531840c91fd589436a953 (diff)
Paul Mundt writes:
The current behavior of the powerpc boot1_arch.h seems somewhat broken. Currently room is made on the stack pointer for the link register, but the link register is never actually pushed onto it. glibc bears the following comments: /* Call _dl_start with one parameter pointing at argc */ mr r3,r1 /* (we have to frob the stack pointer a bit to allow room for _dl_start to save the link register). */ followed by the -16 add to r1. Despite the fact that r1 is modified, the link register is never actually pushed onto r1, thus the adjustment is completely superfluous. There's two possible fixes for this, either saving the link register in the way that glibc does, or getting rid of the r1 adjustment. As I'm not sure if saving the link register will actually break the _dl_boot2 callin, both options will probably want to be played with. The following bit of inline assembly in the attached patch builds cleanly for me with gcc 3.3 on darwin, but I'm not able to test it any further beyond that.
Diffstat (limited to 'ldso/ldso/powerpc/dl-startup.h')
-rw-r--r--ldso/ldso/powerpc/dl-startup.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/ldso/ldso/powerpc/dl-startup.h b/ldso/ldso/powerpc/dl-startup.h
index 615db6926..2f54ed9d9 100644
--- a/ldso/ldso/powerpc/dl-startup.h
+++ b/ldso/ldso/powerpc/dl-startup.h
@@ -9,8 +9,10 @@ asm("" \
" .text\n" \
" .globl _dl_boot\n" \
"_dl_boot:\n" \
-" mr 3,1\n" \
+" mr 3,1\n" \
+" li 4,0\n" \
" addi 1,1,-16\n" \
+" stw 4,0(1)\n" \
" bl _dl_boot2\n" \
".previous\n" \
);