summaryrefslogtreecommitdiffstats
path: root/libexec
diff options
context:
space:
mode:
authorandrew <andrew@FreeBSD.org>2015-07-02 14:00:07 +0000
committerandrew <andrew@FreeBSD.org>2015-07-02 14:00:07 +0000
commitd94acf5f31d660e36d6255504ac11ccc5354f838 (patch)
tree03108120ee9df6f7b979deab5633c3efe345c2f8 /libexec
parenteab58cf8948c9cd5a8a76a6800b4a609e06d3659 (diff)
downloadFreeBSD-src-d94acf5f31d660e36d6255504ac11ccc5354f838.zip
FreeBSD-src-d94acf5f31d660e36d6255504ac11ccc5354f838.tar.gz
Save & restore the floating-pont argument registers before calling
_rtld_bind. The compiler may generate code using these registers and not save them. Unfortunately, as we make use of libc, we are unable to disallow rtld from using floating-point register without also doing the same for the parts of libc we use, or by limiting what _rtld_bind is able to call. Obtained from: ABT Systems Ltd Sponsored by: The FReeBSD Foundation
Diffstat (limited to 'libexec')
-rw-r--r--libexec/rtld-elf/aarch64/rtld_start.S12
1 files changed, 11 insertions, 1 deletions
diff --git a/libexec/rtld-elf/aarch64/rtld_start.S b/libexec/rtld-elf/aarch64/rtld_start.S
index a5e0df5..2270efc 100644
--- a/libexec/rtld-elf/aarch64/rtld_start.S
+++ b/libexec/rtld-elf/aarch64/rtld_start.S
@@ -70,6 +70,12 @@ ENTRY(_rtld_bind_start)
stp x6, x7, [sp, #-16]!
stp x8, xzr, [sp, #-16]!
+ /* Save any floating-point arguments */
+ stp q0, q1, [sp, #-32]!
+ stp q2, q3, [sp, #-32]!
+ stp q4, q5, [sp, #-32]!
+ stp q6, q7, [sp, #-32]!
+
/* Calculate reloff */
ldr x2, [x17, #0] /* Get the address of the entry */
sub x1, x2, x16 /* Find its offset */
@@ -85,12 +91,16 @@ ENTRY(_rtld_bind_start)
bl _rtld_bind
/* Restore the registers saved by the plt code */
- ldp xzr, x30, [sp, #(5 * 16)]
+ ldp xzr, x30, [sp, #(5 * 16 + 4 * 32)]
/* Backup the address to branch to */
mov x16, x0
/* restore the arguments */
+ ldp q6, q7, [sp], #32
+ ldp q4, q5, [sp], #32
+ ldp q2, q3, [sp], #32
+ ldp q0, q1, [sp], #32
ldp x8, xzr, [sp], #16
ldp x6, x7, [sp], #16
ldp x4, x5, [sp], #16
OpenPOWER on IntegriCloud