This is the mail archive of the
libc-ports@sources.redhat.com
mailing list for the libc-ports project.
[PATCH] arm: Save and restore VFP arguments registers in PLT trampolines
- From: Meador Inge <meadori at codesourcery dot com>
- To: <libc-ports at sourceware dot org>
- Date: Wed, 11 Apr 2012 19:27:00 -0500
- Subject: [PATCH] arm: Save and restore VFP arguments registers in PLT trampolines
This patch fixes an issue in '_dl_runtime_resolve' and '_dl_runtime_profile'
where the VFP argument registers are not properly saved and restored around
'_dl_fixup'.
OK?
Signed-off-by: Meador Inge <meadori@codesourcery.com>
2012-04-11 Meador Inge <meadori@codesourcery.com>
* sysdeps/arm/dl-trampoline.S (_dl_runtime_resolve): Save and
restore VFP argument registers.
(_dl_runtime_profile): Likewise.
---
sysdeps/arm/dl-trampoline.S | 32 ++++++++++++++++++++++++++++++++
1 files changed, 32 insertions(+), 0 deletions(-)
diff --git a/sysdeps/arm/dl-trampoline.S b/sysdeps/arm/dl-trampoline.S
index 370bda3..0f6a0e6 100644
--- a/sysdeps/arm/dl-trampoline.S
+++ b/sysdeps/arm/dl-trampoline.S
@@ -47,6 +47,18 @@ _dl_runtime_resolve:
cfi_rel_offset (r1, 4)
cfi_rel_offset (r2, 8)
cfi_rel_offset (r3, 12)
+#if defined(__ARM_NEON__)
+ vpush {d0-d7}
+ cfi_adjust_cfa_offset (64)
+ cfi_rel_offset (256, 0)
+ cfi_rel_offset (257, 8)
+ cfi_rel_offset (258, 16)
+ cfi_rel_offset (259, 24)
+ cfi_rel_offset (260, 32)
+ cfi_rel_offset (261, 40)
+ cfi_rel_offset (262, 48)
+ cfi_rel_offset (263, 56)
+#endif
@ get pointer to linker struct
ldr r0, [lr, #-4]
@@ -65,6 +77,10 @@ _dl_runtime_resolve:
@ get arguments and return address back. We restore r4
@ only to realign the stack.
+#if defined(__ARM_NEON__)
+ vpop {d0-d7}
+ cfi_adjust_cfa_offset (-64)
+#endif
ldmia sp!, {r0-r4,lr}
cfi_adjust_cfa_offset (-24)
@@ -105,6 +121,18 @@ _dl_runtime_profile:
cfi_rel_offset (r1, 4)
cfi_rel_offset (r2, 8)
cfi_rel_offset (r3, 12)
+#if defined(__ARM_NEON__)
+ add r0, sp, #24
+ vstmia r0, {d0-d7}
+ cfi_rel_offset (256, 24)
+ cfi_rel_offset (257, 32)
+ cfi_rel_offset (258, 40)
+ cfi_rel_offset (259, 48)
+ cfi_rel_offset (260, 56)
+ cfi_rel_offset (261, 64)
+ cfi_rel_offset (262, 72)
+ cfi_rel_offset (263, 80)
+#endif
sub sp, sp, #16
cfi_adjust_cfa_offset (16)
@@ -150,6 +178,10 @@ _dl_runtime_profile:
@ get arguments and return address back
add sp, sp, #16
cfi_adjust_cfa_offset (-16)
+#if defined(__ARM_NEON__)
+ add r0, sp, #24
+ vldmia r0, {d0-d7}
+#endif
ldmia sp, {r0-r3,sp,lr}
cfi_adjust_cfa_offset (-200)
--
1.7.7.6