diff options
author | Jiong Wang <jiong.wang@arm.com> | 2015-08-11 17:44:30 +0100 |
---|---|---|
committer | Jiong Wang <jiong.wang@arm.com> | 2015-08-11 21:26:41 +0100 |
commit | 40fbed84815b00960f7fac8d2e7857942df4308c (patch) | |
tree | 8b34a3e6e9238e69dc36aedddffa81df498c8e43 /bfd | |
parent | 70151fb54ab6e3d5dc7f99fe3fbfa7ad2f1ab2af (diff) | |
download | gdb-40fbed84815b00960f7fac8d2e7857942df4308c.zip gdb-40fbed84815b00960f7fac8d2e7857942df4308c.tar.gz gdb-40fbed84815b00960f7fac8d2e7857942df4308c.tar.bz2 |
[AArch64][8/8] LD support BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12
2015-08-11 Jiong Wang <jiong.wang@arm.com>
bfd/
* elfnn-aarch64.c (IS_AARCH64_TLS_RELOC): Recognize
BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12.
(aarch64_reloc_got_type): Likewise.
(elfNN_aarch64_final_link_relocate): Likewise.
(elfNN_aarch64_relocate_section): Likewise.
* elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
(_bfd_aarch64_elf_resolve_relocation): Likewise.
ld/testsuite/
* ld-aarch64/emit-relocs-529.s: New testcase.
* ld-aarch64/emit-relocs-529-overflow.s: Likewise.
* ld-aarch64/emit-relocs-86.s: Likewise.
* ld-aarch64/emit-relocs-86-overflow.s: Likewise.
* ld-aarch64/emit-relocs-529.d: New expectation file.
* ld-aarch64/emit-relocs-529-overflow.d: Likewise.
* ld-aarch64/emit-relocs-86.d: Likewise.
* ld-aarch64/emit-relocs-86-overflow.d: Likewise.
* ld-aarch64/aarch64-elf.exp: Run new testcases.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 10 | ||||
-rw-r--r-- | bfd/elfnn-aarch64.c | 8 | ||||
-rw-r--r-- | bfd/elfxx-aarch64.c | 2 |
3 files changed, 20 insertions, 0 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 61554a7..97fffdd 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,5 +1,15 @@ 2015-08-11 Jiong Wang <jiong.wang@arm.com> + * elfnn-aarch64.c (IS_AARCH64_TLS_RELOC): Recognize + BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12. + (aarch64_reloc_got_type): Likewise. + (elfNN_aarch64_final_link_relocate): Likewise. + (elfNN_aarch64_relocate_section): Likewise. + * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise. + (_bfd_aarch64_elf_resolve_relocation): Likewise. + +2015-08-11 Jiong Wang <jiong.wang@arm.com> + * reloc.c (BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12): New entry. * bfd-in2.h: Regenerate. * libbfd.h: Regenerate. diff --git a/bfd/elfnn-aarch64.c b/bfd/elfnn-aarch64.c index 80beda7..c8ad421 100644 --- a/bfd/elfnn-aarch64.c +++ b/bfd/elfnn-aarch64.c @@ -174,6 +174,7 @@ || (R_TYPE) == BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19 \ || (R_TYPE) == BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC \ || (R_TYPE) == BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G1 \ + || (R_TYPE) == BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12 \ || (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 \ @@ -4174,6 +4175,7 @@ aarch64_reloc_got_type (bfd_reloc_code_real_type r_type) case BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19: return GOT_TLS_IE; + case BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12: case BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_HI12: case BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12: case BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12_NC: @@ -5078,6 +5080,12 @@ elfNN_aarch64_final_link_relocate (reloc_howto_type *howto, *unresolved_reloc_p = FALSE; break; + case BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12: + value = _bfd_aarch64_elf_resolve_relocation (bfd_r_type, place, value, + signed_addend - dtpoff_base (info), + weak_undef_p); + break; + case BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_HI12: case BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12: case BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12_NC: diff --git a/bfd/elfxx-aarch64.c b/bfd/elfxx-aarch64.c index 75f518d..a861773 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_LO12: case BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC: case BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_HI12: case BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12: @@ -398,6 +399,7 @@ _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_LO12: value = value + addend; break; |