diff options
author | Yury Norov <ynorov@caviumnetworks.com> | 2016-12-03 18:50:43 +0530 |
---|---|---|
committer | Yury Norov <ynorov@caviumnetworks.com> | 2016-12-14 12:00:59 +0530 |
commit | c1fc2d7ee590f3bc87ee79c36e7216b0b6bb054b (patch) | |
tree | 5a4a940369040820724ee0ceecd8236eb6adf441 /bfd/ChangeLog | |
parent | 7acd51d6971f12b832cd7281f669a7ae7feddf45 (diff) | |
download | fsf-binutils-gdb-c1fc2d7ee590f3bc87ee79c36e7216b0b6bb054b.zip fsf-binutils-gdb-c1fc2d7ee590f3bc87ee79c36e7216b0b6bb054b.tar.gz fsf-binutils-gdb-c1fc2d7ee590f3bc87ee79c36e7216b0b6bb054b.tar.bz2 |
ld: aarch64: fix TLS relaxation where TCB_SIZE is used
TCB_SIZE is 2*sizeof(void *), which is 0x10 for lp64, and 0x8 for
ilp32. During relaxation, ld goes to do a replace:
bl __tls_get_addr => add R0, R0, TCB_SIZE
But actual implementation is:
bfd_putl32 (0x91004000, contents + rel->r_offset + 4);
Which is equivalent of add x0, x0, 0x10. This is wrong for ilp32.
The possible fix for it is:
bfd_putl32 (0x91000000 | (TCB_SIZE<<10), contents + rel->r_offset + 4);
But ilp32 also needs w-registers, so it's simpler to put proper
instruction in #if/#else condition.
There are 2 such relaxations in elfNN_aarch64_tls_relax(), and so 2 new
tests added for ilp32 mode to test it.
Yury
* bfd/elfnn-aarch64.c: fix TLS relaxations for ilp32 where
TCB_SIZE is used.
* ld/testsuite/ld-aarch64/aarch64-elf.exp: Add tests for the case.
* ld/testsuite/ld-aarch64/tls-relax-ld-le-small-ilp32.d: New file.
* ld/testsuite/ld-aarch64/tls-relax-ld-le-tiny-ilp32.d: New file.
Signed-off-by: Yury Norov <ynorov@caviumnetworks.com>
Diffstat (limited to 'bfd/ChangeLog')
-rw-r--r-- | bfd/ChangeLog | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 26d4084..21cbcac 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2016-12-14 Yury Norov <ynorov@caviumnetworks.com> + + * bfd/elfnn-aarch64.c: fix TLS relaxations for ilp32 where + TCB_SIZE is used. + 2016-12-13 Alan Modra <amodra@gmail.com> * elf64-hppa.c (elf64_hppa_modify_segment_map): Don't add PHDR |