diff options
author | Jiong Wang <jiong.wang@arm.com> | 2015-08-19 11:18:25 +0100 |
---|---|---|
committer | Jiong Wang <jiong.wang@arm.com> | 2015-08-19 16:40:18 +0100 |
commit | 6ffe9a1ba36f3a896ae323e35a207b6451e8f7f9 (patch) | |
tree | 352d08b939394f5b6749416c6e1800966d999be6 /bfd/elfxx-aarch64.c | |
parent | 49df5539f9070c01128135a7d63f44b2efc4de6a (diff) | |
download | gdb-6ffe9a1ba36f3a896ae323e35a207b6451e8f7f9.zip gdb-6ffe9a1ba36f3a896ae323e35a207b6451e8f7f9.tar.gz gdb-6ffe9a1ba36f3a896ae323e35a207b6451e8f7f9.tar.bz2 |
[AArch64][4/6] LD support TLSLD move/add relocation types
2015-08-19 Jiong Wang <jiong.wang@arm.com>
bfd/
PR ld/18276
* elfnn-aarch64.c (IS_AARCH64_TLS_RELOC): Recognize new relocation
types, including BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_HI12,
BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0,
BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0_NC,
BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1,
BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1_NC,
BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G2.
(elfNN_aarch64_final_link_relocate): Likewise.
* elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
(_bfd_aarch64_elf_resolve_relocation): Likewise.
ld/testsuite/
* ld-aarch64/emit-relocs-87.s: New testcase.
* ld-aarch64/emit-relocs-88.s: Likewise.
* ld-aarch64/emit-relocs-88-overflow.s: Likewise.
* ld-aarch64/emit-relocs-89.s: Likewise.
* ld-aarch64/emit-relocs-90.s: Likewise.
* ld-aarch64/emit-relocs-90-overflow.s: Likewise.
* ld-aarch64/emit-relocs-523.s: Likewise.
* ld-aarch64/emit-relocs-524.s: Likewise.
* ld-aarch64/emit-relocs-525.s: Likewise.
* ld-aarch64/emit-relocs-527.s: Likewise.
* ld-aarch64/emit-relocs-526.s: Likewise.
* ld-aarch64/emit-relocs-528.s: Likewise.
* ld-aarch64/emit-relocs-528-overflow.s: Likewise.
* ld-aarch64/emit-relocs-87.d: New expectation file.
* ld-aarch64/emit-relocs-88.d: Likewise.
* ld-aarch64/emit-relocs-88-overflow.d: Likewise.
* ld-aarch64/emit-relocs-89.d: Likewise.
* ld-aarch64/emit-relocs-90.d: Likewise.
* ld-aarch64/emit-relocs-90-overflow.d: Likewise.
* ld-aarch64/emit-relocs-91.d: Likewise.
* ld-aarch64/emit-relocs-523.d: Likewise.
* ld-aarch64/emit-relocs-524.d: Likewise.
* ld-aarch64/emit-relocs-525.d: Likewise.
* ld-aarch64/emit-relocs-526.d: Likewise.
* ld-aarch64/emit-relocs-527.d: Likewise.
* ld-aarch64/emit-relocs-528.d: Likewise.
* ld-aarch64/emit-relocs-528-overflow.d: Likewise.
* ld-aarch64/aarch64-elf.exp: Run new testcases.
Diffstat (limited to 'bfd/elfxx-aarch64.c')
-rw-r--r-- | bfd/elfxx-aarch64.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/bfd/elfxx-aarch64.c b/bfd/elfxx-aarch64.c index dbb134a..82c6ec9 100644 --- a/bfd/elfxx-aarch64.c +++ b/bfd/elfxx-aarch64.c @@ -249,6 +249,7 @@ _bfd_aarch64_elf_put_addend (bfd *abfd, case BFD_RELOC_AARCH64_ADD_LO12: case BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC: case BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC: + case BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_HI12: case BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12: case BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12_NC: case BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC: @@ -291,6 +292,9 @@ _bfd_aarch64_elf_put_addend (bfd *abfd, case BFD_RELOC_AARCH64_MOVW_G0_S: case BFD_RELOC_AARCH64_MOVW_G1_S: case BFD_RELOC_AARCH64_MOVW_G2_S: + case BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0: + case BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1: + case BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G2: case BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0: case BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1: case BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G2: @@ -318,6 +322,8 @@ _bfd_aarch64_elf_put_addend (bfd *abfd, case BFD_RELOC_AARCH64_MOVW_G2: case BFD_RELOC_AARCH64_MOVW_G2_NC: case BFD_RELOC_AARCH64_MOVW_G3: + case BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0_NC: + case BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1_NC: case BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC: case BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1_NC: contents = reencode_movw_imm (contents, addend); @@ -400,8 +406,14 @@ _bfd_aarch64_elf_resolve_relocation (bfd_reloc_code_real_type r_type, case BFD_RELOC_AARCH64_MOVW_G2_NC: case BFD_RELOC_AARCH64_MOVW_G2_S: case BFD_RELOC_AARCH64_MOVW_G3: + case BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_HI12: case BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12: case BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12_NC: + case BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0: + case BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0_NC: + case BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1: + case BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1_NC: + case BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G2: value = value + addend; break; |