aboutsummaryrefslogtreecommitdiff
path: root/libexec/rtld-elf/arm
diff options
context:
space:
mode:
authorAndrew Turner <andrew@FreeBSD.org>2014-07-06 10:24:06 +0000
committerAndrew Turner <andrew@FreeBSD.org>2014-07-06 10:24:06 +0000
commit0685d955d6c6218db44bb9a67f945decf3470ea4 (patch)
treeea205b606581cf436aad479e6595e4f90e92cc52 /libexec/rtld-elf/arm
parent99ae56ac82594702427a1f1f36c834e2c97b9a73 (diff)
Notes
Diffstat (limited to 'libexec/rtld-elf/arm')
-rw-r--r--libexec/rtld-elf/arm/rtld_start.S7
1 files changed, 5 insertions, 2 deletions
diff --git a/libexec/rtld-elf/arm/rtld_start.S b/libexec/rtld-elf/arm/rtld_start.S
index 7a4fae4f0172..c48280815c33 100644
--- a/libexec/rtld-elf/arm/rtld_start.S
+++ b/libexec/rtld-elf/arm/rtld_start.S
@@ -77,7 +77,7 @@ __FBSDID("$FreeBSD$");
* lr = &GOT[2]
*/
_rtld_bind_start:
- stmdb sp!,{r0-r4,sl,fp}
+ stmdb sp!,{r0-r5,sl,fp}
sub r1, ip, lr /* r1 = 4 * (n + 1) */
sub r1, r1, #4 /* r1 = 4 * n */
@@ -86,11 +86,14 @@ _rtld_bind_start:
ldr r0, [lr, #-4] /* get obj ptr from GOT[1] */
mov r4, ip /* save GOT location */
+ mov r5, sp /* Save the stack pointer */
+ bic sp, sp, #7 /* Align the stack pointer */
bl _rtld_bind /* Call the binder */
+ mov sp, r5 /* Restore the old stack pointer */
str r0, [r4] /* save address in GOT */
mov ip, r0 /* save new address */
- ldmia sp!,{r0-r4,sl,fp,lr} /* restore the stack */
+ ldmia sp!,{r0-r5,sl,fp,lr} /* restore the stack */
mov pc, ip /* jump to the new address */