diff options
author | Richard Henderson <rth@redhat.com> | 2014-05-21 11:36:51 -0400 |
---|---|---|
committer | Will Newton <will.newton@linaro.org> | 2014-07-03 14:44:48 +0100 |
commit | 98d05b184fa3ddfad718544c4d8f5c12740018a8 (patch) | |
tree | b9ad2cc8bfbfd894beff294996c3096fb513a31e | |
parent | 30dfe53de773f49e432060e59d551b18d1b064f5 (diff) |
aarch64: Merge __local_multiple_threads offset with memory reference
This also highlights that we'd been loading 64-bits instead of
the proper 32-bits. Caught by the linker as a relocation error,
since the variable happened to be unaligned for 64-bits.
-rw-r--r-- | libc/ports/ChangeLog.aarch64.linaro | 4 | ||||
-rw-r--r-- | libc/ports/sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h | 9 |
2 files changed, 8 insertions, 5 deletions
diff --git a/libc/ports/ChangeLog.aarch64.linaro b/libc/ports/ChangeLog.aarch64.linaro index 18e815e65..a14c65fb5 100644 --- a/libc/ports/ChangeLog.aarch64.linaro +++ b/libc/ports/ChangeLog.aarch64.linaro @@ -1,5 +1,9 @@ 2014-05-21 Richard Henderson <rth@redhat.com> + * sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h + (SINGLE_THREAD_P): Use the correct width load. Fold + into the ldr offset. + * sysdeps/unix/sysv/linux/aarch64/sysdep.h [RTLD_PRIVATE_ERRNO] (SYSCALL_ERROR_HANDLER): Fold add insn into str offset. diff --git a/libc/ports/sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h b/libc/ports/sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h index 0e9bef3af..24fae7be1 100644 --- a/libc/ports/sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h +++ b/libc/ports/sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h @@ -163,9 +163,8 @@ extern int __local_multiple_threads attribute_hidden; # else # define SINGLE_THREAD_P \ adrp x16, __local_multiple_threads; \ - add x16, x16, #:lo12:__local_multiple_threads; \ - ldr x16, [x16]; \ - cmp x16, 0; + ldr w16, [x16, :lo12:__local_multiple_threads]; \ + cmp w16, 0; # endif # else /* There is no __local_multiple_threads for librt, so use the TCB. */ @@ -181,12 +180,12 @@ extern int __local_multiple_threads attribute_hidden; cfi_rel_offset (x30, 8); \ bl __read_tp; \ sub x0, x0, PTHREAD_SIZEOF; \ - ldr x16, [x0, PTHREAD_MULTIPLE_THREADS_OFFSET]; \ + ldr w16, [x0, PTHREAD_MULTIPLE_THREADS_OFFSET]; \ ldp x0, x30, [sp], 16; \ cfi_restore (x0); \ cfi_restore (x30); \ cfi_adjust_cfa_offset (-16); \ - cmp x16, 0 + cmp w16, 0 # define SINGLE_THREAD_P_PIC(x) SINGLE_THREAD_P # endif # endif |