diff options
author | H. Peter Anvin <hpa@zytor.com> | 2003-12-01 18:58:46 +0000 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2003-12-01 18:58:46 +0000 |
commit | 2fc1d1fb6217b8485d0dac47abe78c3822e8e3f5 (patch) | |
tree | 3b54aa4df42cb2152ce5872f5b144854f0d52c7a | |
parent | 801adce33d992bb7aab2c4372d0c1df4bbae2358 (diff) | |
download | klibc-2fc1d1fb6217b8485d0dac47abe78c3822e8e3f5.tar.gz |
From Olaf Hering:klibc-0.90
I should have looked earlier at this spec. This patch is required to
not overwrite the argv[0].
The stack is linked and a new function will write its address into the
previous frame. If _start doesnt adjust the stack, __libc_init will
write its address to elfdata+4 which is argv[0].
This patch allocates just one frame to avoid this corruption.
-rw-r--r-- | klibc/arch/ppc/crt0.S | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/klibc/arch/ppc/crt0.S b/klibc/arch/ppc/crt0.S index 861c8e7c78b63..8577682742025 100644 --- a/klibc/arch/ppc/crt0.S +++ b/klibc/arch/ppc/crt0.S @@ -7,7 +7,8 @@ .type _start,@function .globl _start _start: - mr 3,1 + stwu 1,-16(1) + addi 3,1,16 li 4,0 bl __libc_init |