diff options
author | Renlin Li <renlin.li@arm.com> | 2015-10-02 16:59:46 +0100 |
---|---|---|
committer | Renlin Li <renlin.li@arm.com> | 2015-10-02 17:56:08 +0100 |
commit | 3b957e5b074407e18782a9592754c732671df8ed (patch) | |
tree | 4b5eea00b0e67b41989d29f6f1f41545b171a272 /bfd | |
parent | 7ba7cfe43195305f5efa887ebbffb53a724aaac6 (diff) | |
download | gdb-3b957e5b074407e18782a9592754c732671df8ed.zip gdb-3b957e5b074407e18782a9592754c732671df8ed.tar.gz gdb-3b957e5b074407e18782a9592754c732671df8ed.tar.bz2 |
[Binutils][AARCH64]Add TLS IE large memory support.
bfd/
2015-10-02 Renlin Li <renlin.li@arm.com>
* reloc.c: Make AARCH64_TLSIE_MOVW_GOTTPREL_G1 and
AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC defined in alphabetical order.
* libbfd.h: Regenerate.
* bfd-in2.h: Likewise.
* elfnn-aarch64.c (elfNN_aarch64_howto_table): Make
TLSIE_MOVW_GOTTPREL_G1 check overflow.
(aarch64_reloc_got_type): Add support for TLSIE_MOVW_GOTTPREL_G1
and TLSIE_MOVW_GOTTPREL_G0_NC.
(elfNN_aarch64_final_link_relocate): Likewise.
(elfNN_aarch64_relocate_section): Likewise.
(elfNN_aarch64_gc_sweep_hook): Likewise.
(elfNN_aarch64_check_relocs): Likewise.
* elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
(_bfd_aarch64_elf_resolve_relocation): Likewise.
gas/
2015-10-02 Renlin Li <renlin.li@arm.com>
* config/tc-aarch64.c (reloc_table): Add two entries for
gottprel_g0_nc and gottprel_g1.
(process_movw_reloc_info): Add support.
(md_apply_fix): Likewise.
(aarch64_force_relocation): Likewise.
gas/testsuite/
2015-10-02 Renlin Li <renlin.li@arm.com>
* gas/aarch64/reloc-gottprel_g0_nc.d: New.
* gas/aarch64/reloc-gottprel_g0_nc.s: New.
* gas/aarch64/reloc-gottprel_g1.d: New.
* gas/aarch64/reloc-gottprel_g1.s: New.
ld/testsuite/
2015-10-02 Renlin Li <renlin.li@arm.com>
* ld-aarch64/tls-large-ie.d: New.
* ld-aarch64/tls-large-ie.s: New.
* ld-aarch64/aarch64-elf.exp: Run new test.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 17 | ||||
-rw-r--r-- | bfd/bfd-in2.h | 12 | ||||
-rw-r--r-- | bfd/elfnn-aarch64.c | 66 | ||||
-rw-r--r-- | bfd/elfxx-aarch64.c | 4 | ||||
-rw-r--r-- | bfd/libbfd.h | 4 | ||||
-rw-r--r-- | bfd/reloc.c | 12 |
6 files changed, 73 insertions, 42 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index a028589..7a9ba59 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,5 +1,22 @@ 2015-10-02 Renlin Li <renlin.li@arm.com> + * reloc.c: Make AARCH64_TLSIE_MOVW_GOTTPREL_G1 and + AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC defined in alphabetical order. + * libbfd.h: Regenerate. + * bfd-in2.h: Likewise. + * elfnn-aarch64.c (elfNN_aarch64_howto_table): Make + TLSIE_MOVW_GOTTPREL_G1 check overflow. + (aarch64_reloc_got_type): Add support for TLSIE_MOVW_GOTTPREL_G1 + and TLSIE_MOVW_GOTTPREL_G0_NC. + (elfNN_aarch64_final_link_relocate): Likewise. + (elfNN_aarch64_relocate_section): Likewise. + (elfNN_aarch64_gc_sweep_hook): Likewise. + (elfNN_aarch64_check_relocs): Likewise. + * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise. + (_bfd_aarch64_elf_resolve_relocation): Likewise. + +2015-10-02 Renlin Li <renlin.li@arm.com> + * elfnn-aarch64.c (aarch64_reloc_got_type): Add BFD_RELOC_AARCH64_TLSGD_MOVW_G0_NC support. (elfNN_aarch64_final_link_relocate): Likewise. diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h index 036bbbb..f4f98af 100644 --- a/bfd/bfd-in2.h +++ b/bfd/bfd-in2.h @@ -5793,12 +5793,6 @@ BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21. */ BFD_RELOC_AARCH64_TLSGD_MOVW_G1, /* AArch64 TLS INITIAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G1, - -/* AArch64 TLS INITIAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC, - -/* AArch64 TLS INITIAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21, /* AArch64 TLS INITIAL EXEC relocation. */ @@ -5810,6 +5804,12 @@ BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21. */ /* AArch64 TLS INITIAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19, +/* AArch64 TLS INITIAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC, + +/* AArch64 TLS INITIAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G1, + /* bit[23:12] of byte offset to module TLS base address. */ BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_HI12, diff --git a/bfd/elfnn-aarch64.c b/bfd/elfnn-aarch64.c index 7c9310f..2bbdf65 100644 --- a/bfd/elfnn-aarch64.c +++ b/bfd/elfnn-aarch64.c @@ -1038,34 +1038,6 @@ static reloc_howto_type elfNN_aarch64_howto_table[] = 0xffff, /* dst_mask */ FALSE), /* pcrel_offset */ - HOWTO64 (AARCH64_R (TLSIE_MOVW_GOTTPREL_G1), /* type */ - 16, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - AARCH64_R_STR (TLSIE_MOVW_GOTTPREL_G1), /* name */ - FALSE, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ - FALSE), /* pcrel_offset */ - - HOWTO64 (AARCH64_R (TLSIE_MOVW_GOTTPREL_G0_NC), /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - AARCH64_R_STR (TLSIE_MOVW_GOTTPREL_G0_NC), /* name */ - FALSE, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ - FALSE), /* pcrel_offset */ - HOWTO (AARCH64_R (TLSIE_ADR_GOTTPREL_PAGE21), /* type */ 12, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ @@ -1122,6 +1094,34 @@ static reloc_howto_type elfNN_aarch64_howto_table[] = 0x1ffffc, /* dst_mask */ FALSE), /* pcrel_offset */ + HOWTO64 (AARCH64_R (TLSIE_MOVW_GOTTPREL_G0_NC), /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + AARCH64_R_STR (TLSIE_MOVW_GOTTPREL_G0_NC), /* name */ + FALSE, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO64 (AARCH64_R (TLSIE_MOVW_GOTTPREL_G1), /* type */ + 16, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_unsigned, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + AARCH64_R_STR (TLSIE_MOVW_GOTTPREL_G1), /* name */ + FALSE, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + /* ADD: bit[23:12] of byte offset to module TLS base address. */ HOWTO (AARCH64_R (TLSLD_ADD_DTPREL_HI12), /* type */ 12, /* rightshift */ @@ -4506,6 +4506,8 @@ aarch64_reloc_got_type (bfd_reloc_code_real_type r_type) case BFD_RELOC_AARCH64_TLSIE_LD32_GOTTPREL_LO12_NC: case BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC: case BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19: + case BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC: + case BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G1: return GOT_TLS_IE; default: @@ -5476,6 +5478,8 @@ elfNN_aarch64_final_link_relocate (reloc_howto_type *howto, case BFD_RELOC_AARCH64_TLSGD_MOVW_G0_NC: case BFD_RELOC_AARCH64_TLSGD_MOVW_G1: + case BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC: + case BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G1: if (globals->root.sgot == NULL) return bfd_reloc_notsupported; @@ -6120,6 +6124,8 @@ elfNN_aarch64_relocate_section (bfd *output_bfd, case BFD_RELOC_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21: case BFD_RELOC_AARCH64_TLSIE_LDNN_GOTTPREL_LO12_NC: case BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19: + case BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC: + case BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G1: if (! symbol_got_offset_mark_p (input_bfd, h, r_symndx)) { bfd_boolean need_relocs = FALSE; @@ -6566,6 +6572,8 @@ elfNN_aarch64_gc_sweep_hook (bfd *abfd, case BFD_RELOC_AARCH64_TLSIE_LD32_GOTTPREL_LO12_NC: case BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC: case BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19: + case BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC: + case BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G1: case BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC: case BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21: case BFD_RELOC_AARCH64_TLSLD_ADR_PREL21: @@ -7041,6 +7049,8 @@ elfNN_aarch64_check_relocs (bfd *abfd, struct bfd_link_info *info, case BFD_RELOC_AARCH64_TLSIE_LD32_GOTTPREL_LO12_NC: case BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC: case BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19: + case BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC: + case BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G1: case BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC: case BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21: case BFD_RELOC_AARCH64_TLSLD_ADR_PREL21: diff --git a/bfd/elfxx-aarch64.c b/bfd/elfxx-aarch64.c index b57471e..47e1977 100644 --- a/bfd/elfxx-aarch64.c +++ b/bfd/elfxx-aarch64.c @@ -335,6 +335,8 @@ _bfd_aarch64_elf_put_addend (bfd *abfd, case BFD_RELOC_AARCH64_MOVW_GOTOFF_G1: case BFD_RELOC_AARCH64_TLSGD_MOVW_G0_NC: case BFD_RELOC_AARCH64_TLSGD_MOVW_G1: + case BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC: + case BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G1: 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: @@ -492,6 +494,7 @@ _bfd_aarch64_elf_resolve_relocation (bfd_reloc_code_real_type r_type, value = value + addend; break; + case BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G1: case BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1: case BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1_NC: value = (value + addend) & (bfd_vma) 0xffff0000; @@ -502,6 +505,7 @@ _bfd_aarch64_elf_resolve_relocation (bfd_reloc_code_real_type r_type, value = (value + addend) & ~(bfd_vma) 0xfff; break; + case BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC: case BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0: case BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC: value = (value + addend) & (bfd_vma) 0xffff; diff --git a/bfd/libbfd.h b/bfd/libbfd.h index 3d3d586..03bb057 100644 --- a/bfd/libbfd.h +++ b/bfd/libbfd.h @@ -2757,12 +2757,12 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@", "BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC", "BFD_RELOC_AARCH64_TLSGD_MOVW_G0_NC", "BFD_RELOC_AARCH64_TLSGD_MOVW_G1", - "BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G1", - "BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC", "BFD_RELOC_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21", "BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC", "BFD_RELOC_AARCH64_TLSIE_LD32_GOTTPREL_LO12_NC", "BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19", + "BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC", + "BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G1", "BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_HI12", "BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12", "BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12_NC", diff --git a/bfd/reloc.c b/bfd/reloc.c index a0801916..18ca7bb 100644 --- a/bfd/reloc.c +++ b/bfd/reloc.c @@ -6838,27 +6838,27 @@ ENUM ENUMDOC AArch64 TLS General Dynamic relocation. ENUM - BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G1 + BFD_RELOC_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21 ENUMDOC AArch64 TLS INITIAL EXEC relocation. ENUM - BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC + BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC ENUMDOC AArch64 TLS INITIAL EXEC relocation. ENUM - BFD_RELOC_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21 + BFD_RELOC_AARCH64_TLSIE_LD32_GOTTPREL_LO12_NC ENUMDOC AArch64 TLS INITIAL EXEC relocation. ENUM - BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC + BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19 ENUMDOC AArch64 TLS INITIAL EXEC relocation. ENUM - BFD_RELOC_AARCH64_TLSIE_LD32_GOTTPREL_LO12_NC + BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC ENUMDOC AArch64 TLS INITIAL EXEC relocation. ENUM - BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19 + BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G1 ENUMDOC AArch64 TLS INITIAL EXEC relocation. ENUM |