diff options
author | Yufeng Zhang <yufeng.zhang@arm.com> | 2012-10-16 16:36:50 +0000 |
---|---|---|
committer | Yufeng Zhang <yufeng.zhang@arm.com> | 2012-10-16 16:36:50 +0000 |
commit | bb3f9ed8ba3cfb9a271b84cc8f1d79878fb15e78 (patch) | |
tree | ede0cfb122e89842a33560fc1e0c15b5c34703c8 /ld | |
parent | 448835468fbad10d63450d25b9c7cf929fcde842 (diff) | |
download | gdb-bb3f9ed8ba3cfb9a271b84cc8f1d79878fb15e78.zip gdb-bb3f9ed8ba3cfb9a271b84cc8f1d79878fb15e78.tar.gz gdb-bb3f9ed8ba3cfb9a271b84cc8f1d79878fb15e78.tar.bz2 |
Fixed AArch64 TLS relocation resolution.
bfd/
* elf64-aarch64.c (elf64_aarch64_tls_howto_table): Fix shift value for
R_AARCH64_TLSIE_LD_GOTTPREL_PREL19, R_AARCH64_TLSLE_MOVW_TPREL_G2,
R_AARCH64_TLSLE_MOVW_TPREL_G1, R_AARCH64_TLSLE_MOVW_TPREL_G1_NC,
R_AARCH64_TLSLE_ADD_TPREL_HI12.
(elf64_aarch64_tlsdesc_howto_table): Fix shift value for
R_AARCH64_TLSDESC_LD64_PREL19 and R_AARCH64_TLSDESC_OFF_G1.
(elf64_aarch64_final_link_relocate): Add signed_addend when resolving
AARCH64_TLSLE_*_TPREL_* relocations.
ld/testsuite/
* ld-aarch64/tlsle-symbol-offset.s: New file.
* ld-aarch64/tlsle-symbol-offset.d: New file.
* ld-aarch64/aarch64-elf.exp: Add tlsle-symbol-offset test.
Diffstat (limited to 'ld')
-rw-r--r-- | ld/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | ld/testsuite/ld-aarch64/aarch64-elf.exp | 1 | ||||
-rw-r--r-- | ld/testsuite/ld-aarch64/tlsle-symbol-offset.d | 11 | ||||
-rw-r--r-- | ld/testsuite/ld-aarch64/tlsle-symbol-offset.s | 17 |
4 files changed, 35 insertions, 0 deletions
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index 8e82961..a27d274 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2012-10-16 Sofiane Naci <sofiane.naci@arm.com> + + * ld-aarch64/tlsle-symbol-offset.s: New file. + * ld-aarch64/tlsle-symbol-offset.d: New file. + * ld-aarch64/aarch64-elf.exp: Add tlsle-symbol-offset test. + 2012-10-08 Joe Seymour <jseymour@codesourcery.com> * ld-scripts/sane1.d: Sort output from nm. Allow for other symbols in diff --git a/ld/testsuite/ld-aarch64/aarch64-elf.exp b/ld/testsuite/ld-aarch64/aarch64-elf.exp index 7e5d73e..e85d1db 100644 --- a/ld/testsuite/ld-aarch64/aarch64-elf.exp +++ b/ld/testsuite/ld-aarch64/aarch64-elf.exp @@ -108,3 +108,4 @@ run_dump_test "tls-relax-gdesc-ie-2" run_dump_test "tls-relax-gdesc-le-2" run_dump_test "tls-relax-ie-le-2" run_dump_test "tls-relax-ie-le-3" +run_dump_test "tlsle-symbol-offset" diff --git a/ld/testsuite/ld-aarch64/tlsle-symbol-offset.d b/ld/testsuite/ld-aarch64/tlsle-symbol-offset.d new file mode 100644 index 0000000..cf61691 --- /dev/null +++ b/ld/testsuite/ld-aarch64/tlsle-symbol-offset.d @@ -0,0 +1,11 @@ +#source: tlsle-symbol-offset.s +#ld: -shared -T relocs.ld -e0 +#objdump: -dr +#... +Disassembly of section .text: + +0000000000010000 <.text>: + +10000: d53bd040 mrs x0, tpidr_el0 + +10004: 91400400 add x0, x0, #0x1, lsl #12 + +10008: 91010000 add x0, x0, #0x40 + +1000c: d65f03c0 ret diff --git a/ld/testsuite/ld-aarch64/tlsle-symbol-offset.s b/ld/testsuite/ld-aarch64/tlsle-symbol-offset.s new file mode 100644 index 0000000..41088ef --- /dev/null +++ b/ld/testsuite/ld-aarch64/tlsle-symbol-offset.s @@ -0,0 +1,17 @@ + .global p + .global a + .section .tbss,"awT",%nobits +p: + .zero 4096 +a: + .zero 52 + + .text + +# Compute the address of an integer within structure a, padded +# by an array of size 48 + + mrs x0, tpidr_el0 + add x0, x0, #:tprel_hi12:a+48 + add x0, x0, #:tprel_lo12_nc:a+48 + ret |