diff options
author | Richard Henderson <rth@twiddle.net> | 2013-02-13 21:21:39 -0800 |
---|---|---|
committer | Richard Henderson <rth@twiddle.net> | 2013-03-06 07:44:24 -0800 |
commit | cd24e113c38e81c15a72536a99062373d5701389 (patch) | |
tree | 9bf6a337d9d803b5e9e80fea4c6e676140d9b770 /ports/sysdeps/unix/arm/sysdep.S | |
parent | 8e39047d31421857f7c8a95816e8eb785199ccb3 (diff) | |
download | glibc-cd24e113c38e81c15a72536a99062373d5701389.tar.gz glibc-cd24e113c38e81c15a72536a99062373d5701389.tar.xz glibc-cd24e113c38e81c15a72536a99062373d5701389.zip |
arm: Introduce and use LDST_PCREL
Macro-ising the few instances where we need to distinguish between arm and thumb pc-relative memory operations.
Diffstat (limited to 'ports/sysdeps/unix/arm/sysdep.S')
-rw-r--r-- | ports/sysdeps/unix/arm/sysdep.S | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/ports/sysdeps/unix/arm/sysdep.S b/ports/sysdeps/unix/arm/sysdep.S index 40e4d80eca..d44ee4869a 100644 --- a/ports/sysdeps/unix/arm/sysdep.S +++ b/ports/sysdeps/unix/arm/sysdep.S @@ -45,20 +45,22 @@ __syscall_error: mov lr, pc sub pc, r0, #31 - ldr r2, 1f -2: ldr r2, [pc, r2] - str r1, [r0, r2] - mvn r0, #0 - RETINSTR (, ip) + ldr r2, 1f +#ifdef __thumb__ +2: add r2, r2, pc + ldr r2, [r2] +#else +2: ldr r2, [pc, r2] +#endif + str r1, [r0, r2] + mvn r0, #0 + DO_RET(ip) 1: .word errno(gottpoff) + (. - 2b - PC_OFS) #elif RTLD_PRIVATE_ERRNO - ldr r1, 1f -0: str r0, [pc, r1] - mvn r0, $0 + LDST_PCREL(str, r0, r1, C_SYMBOL_NAME(rtld_errno)) + mvn r0, #0 DO_RET(r14) - -1: .word C_SYMBOL_NAME(rtld_errno) - 0b - PC_OFS #else #error "Unsupported non-TLS case" #endif |