diff options
author | Jiong Wang <jiong.wang@arm.com> | 2015-08-19 11:26:56 +0100 |
---|---|---|
committer | Jiong Wang <jiong.wang@arm.com> | 2015-08-19 16:57:38 +0100 |
commit | 07c9aa07cdcf00eff8e186f3ca1779e5e3ffdb75 (patch) | |
tree | 7db77658cc9a0d1869f7eecb356f5dfe49874383 /bfd | |
parent | 4c5625238cccb048261d7ce0eb748ee5e0d67cf0 (diff) | |
download | gdb-07c9aa07cdcf00eff8e186f3ca1779e5e3ffdb75.zip gdb-07c9aa07cdcf00eff8e186f3ca1779e5e3ffdb75.tar.gz gdb-07c9aa07cdcf00eff8e186f3ca1779e5e3ffdb75.tar.bz2 |
[AArch64][6/6] LD support TLSLD load/store relocation types
2015-08-19 Jiong Wang <jiong.wang@arm.com>
bfd/
* elfnn-aarch64.c (IS_AARCH64_TLS_RELOC): Recognize new relocation
types, including BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12,
BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC,
BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12,
BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC,
BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12,
BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC,
BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12,
BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC.
(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-531.s: New testcase.
* ld-aarch64/emit-relocs-531-overflow.s: Likewise.
* ld-aarch64/emit-relocs-532.s: Likewise.
* ld-aarch64/emit-relocs-533.s: Likewise.
* ld-aarch64/emit-relocs-533-overflow.s: Likewise.
* ld-aarch64/emit-relocs-534.s: Likewise.
* ld-aarch64/emit-relocs-535.s: Likewise.
* ld-aarch64/emit-relocs-535-overflow.s: Likewise.
* ld-aarch64/emit-relocs-536.s: Likewise.
* ld-aarch64/emit-relocs-537.s: Likewise.
* ld-aarch64/emit-relocs-537-overflow.s: Likewise.
* ld-aarch64/emit-relocs-538.s: Likewise.
* ld-aarch64/emit-relocs-531.d: New expectation file.
* ld-aarch64/emit-relocs-531-overflow.d: Likewise.
* ld-aarch64/emit-relocs-532.d: Likewise.
* ld-aarch64/emit-relocs-533.d: Likewise.
* ld-aarch64/emit-relocs-533-overflow.d: Likewise.
* ld-aarch64/emit-relocs-534.d: Likewise.
* ld-aarch64/emit-relocs-535.d: Likewise.
* ld-aarch64/emit-relocs-535-overflow.d: Likewise.
* ld-aarch64/emit-relocs-536.d: Likewise.
* ld-aarch64/emit-relocs-537.d: Likewise.
* ld-aarch64/emit-relocs-537-overflow.d: Likewise.
* ld-aarch64/emit-relocs-538.d: Likewise.
* ld-aarch64/aarch64-elf.exp: Run new testcases.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 15 | ||||
-rw-r--r-- | bfd/elfnn-aarch64.c | 16 | ||||
-rw-r--r-- | bfd/elfxx-aarch64.c | 16 |
3 files changed, 47 insertions, 0 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 4edf56d..dcd0e88 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,5 +1,20 @@ 2015-08-19 Jiong Wang <jiong.wang@arm.com> + * elfnn-aarch64.c (IS_AARCH64_TLS_RELOC): Recognize new relocation + types, including BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12, + BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC, + BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12, + BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC, + BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12, + BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC, + BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12, + BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC. + (elfNN_aarch64_final_link_relocate): Likewise. + * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise. + (_bfd_aarch64_elf_resolve_relocation): Likewise. + +2015-08-19 Jiong Wang <jiong.wang@arm.com> + * reloc.c (BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12, BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC, BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12, diff --git a/bfd/elfnn-aarch64.c b/bfd/elfnn-aarch64.c index 083bb0f..9935308 100644 --- a/bfd/elfnn-aarch64.c +++ b/bfd/elfnn-aarch64.c @@ -180,6 +180,14 @@ || (R_TYPE) == BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC \ || (R_TYPE) == BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21 \ || (R_TYPE) == BFD_RELOC_AARCH64_TLSLD_ADR_PREL21 \ + || (R_TYPE) == BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12 \ + || (R_TYPE) == BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC \ + || (R_TYPE) == BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12 \ + || (R_TYPE) == BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC \ + || (R_TYPE) == BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12 \ + || (R_TYPE) == BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC \ + || (R_TYPE) == BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12 \ + || (R_TYPE) == BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC \ || (R_TYPE) == BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0 \ || (R_TYPE) == BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0_NC \ || (R_TYPE) == BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1 \ @@ -5312,6 +5320,14 @@ elfNN_aarch64_final_link_relocate (reloc_howto_type *howto, 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_LDST16_DTPREL_LO12: + case BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC: + case BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12: + case BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC: + case BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12: + case BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC: + case BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12: + case BFD_RELOC_AARCH64_TLSLD_LDST8_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: diff --git a/bfd/elfxx-aarch64.c b/bfd/elfxx-aarch64.c index 82c6ec9..34bd1a6 100644 --- a/bfd/elfxx-aarch64.c +++ b/bfd/elfxx-aarch64.c @@ -276,6 +276,14 @@ _bfd_aarch64_elf_put_addend (bfd *abfd, case BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC: case BFD_RELOC_AARCH64_TLSIE_LD32_GOTTPREL_LO12_NC: case BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC: + case BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12: + case BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC: + case BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12: + case BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC: + case BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12: + case BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC: + case BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12: + case BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC: if (old_addend & ((1 << howto->rightshift) - 1)) return bfd_reloc_overflow; /* Used for ldr*|str* rt, [rn, #uimm12] to provide the low order @@ -409,6 +417,14 @@ _bfd_aarch64_elf_resolve_relocation (bfd_reloc_code_real_type r_type, 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_LDST16_DTPREL_LO12: + case BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC: + case BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12: + case BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC: + case BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12: + case BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC: + case BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12: + case BFD_RELOC_AARCH64_TLSLD_LDST8_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: |