diff options
author | Renlin Li <renlin.li@arm.com> | 2018-03-28 18:03:55 +0100 |
---|---|---|
committer | Renlin Li <renlin.li@arm.com> | 2018-03-28 18:03:55 +0100 |
commit | 84f1b9fb081372a726fd70dfd8258a707833caef (patch) | |
tree | f3fb203c6864d27bac6ed1bbddea99467b5d09b7 /bfd | |
parent | e82e6b2b19eb796fed161b1658de6d5f763c18de (diff) | |
download | gdb-84f1b9fb081372a726fd70dfd8258a707833caef.zip gdb-84f1b9fb081372a726fd70dfd8258a707833caef.tar.gz gdb-84f1b9fb081372a726fd70dfd8258a707833caef.tar.bz2 |
[1/2][GAS][AARCH64]Add BFD_RELOC_AARCH64_TLSLE_LDST8/16/32/64_TPREL_LO12 support in GAS.
This patch adds the following relocation support into binutils gas.
BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12,
BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12_NC,
BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12,
BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12_NC,
BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12,
BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12_NC,
BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12,
BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12_NC.
Those relocations includes both ip64 and ilp32 variant.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 25 | ||||
-rw-r--r-- | bfd/bfd-in2.h | 36 | ||||
-rw-r--r-- | bfd/elfnn-aarch64.c | 120 | ||||
-rw-r--r-- | bfd/libbfd.h | 10 | ||||
-rw-r--r-- | bfd/reloc.c | 46 |
5 files changed, 237 insertions, 0 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index dd6ccab..32881d8 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,28 @@ +2018-03-28 Renlin Li <renlin.li@arm.com> + + PR ld/22970 + * reloc.c: Add BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12 + BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12_NC, + BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12, + BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12_NC, + BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12, + BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12_NC, + BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12, + BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12_NC, + BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12, + BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12_NC. + * elfnn-aarch64.c (elfNN_aarch64_howto_table): Add table entry for + TLSLE_LDST16_TPREL_LO12, + TLSLE_LDST16_TPREL_LO12_NC, + TLSLE_LDST32_TPREL_LO12, + TLSLE_LDST32_TPREL_LO12_NC, + TLSLE_LDST64_TPREL_LO12, + TLSLE_LDST64_TPREL_LO12_NC, + TLSLE_LDST8_TPREL_LO12, + TLSLE_LDST8_TPREL_LO12_NC. + * bfd-in2.h: Regenerated. + * libbfd.h: Regenerated. + 2018-03-28 Eric Botcazou <ebotcazou@adacore.com> PR ld/22972 diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h index 9742c1a..de5f68d 100644 --- a/bfd/bfd-in2.h +++ b/bfd/bfd-in2.h @@ -6229,6 +6229,34 @@ instructions. */ /* AArch64 TLS LOCAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12_NC, +/* bit[11:1] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12_NC, + +/* bit[11:2] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12_NC, + +/* bit[11:3] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12_NC, + +/* bit[11:0] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12_NC, + /* AArch64 TLS DESC relocation. */ BFD_RELOC_AARCH64_TLSDESC_LD_PREL19, @@ -6312,6 +6340,14 @@ any object files. */ /* Similar as BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12, but no overflow check. */ BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12_NC, +/* AArch64 pseudo relocation code for TLS local exec mode. It's to be +used internally by the AArch64 assembler and not (currently) written to +any object files. */ + BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12_NC, + /* AArch64 pseudo relocation code to be used internally by the AArch64 assembler and not (currently) written to any object files. */ BFD_RELOC_AARCH64_LD_GOT_LO12_NC, diff --git a/bfd/elfnn-aarch64.c b/bfd/elfnn-aarch64.c index c1986b7..d6a215e 100644 --- a/bfd/elfnn-aarch64.c +++ b/bfd/elfnn-aarch64.c @@ -1635,6 +1635,126 @@ static reloc_howto_type elfNN_aarch64_howto_table[] = 0xfff, /* dst_mask */ FALSE), /* pcrel_offset */ + /* LD/ST16: bit[11:1] of byte offset to module TLS base address. */ + HOWTO (AARCH64_R (TLSLE_LDST16_TPREL_LO12), /* type */ + 1, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 11, /* bitsize */ + FALSE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_unsigned, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + AARCH64_R_STR (TLSLE_LDST16_TPREL_LO12), /* name */ + FALSE, /* partial_inplace */ + 0x1ffc00, /* src_mask */ + 0x1ffc00, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Same as BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12, but no overflow check. */ + HOWTO (AARCH64_R (TLSLE_LDST16_TPREL_LO12_NC), /* type */ + 1, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 11, /* bitsize */ + FALSE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + AARCH64_R_STR (TLSLE_LDST16_TPREL_LO12_NC), /* name */ + FALSE, /* partial_inplace */ + 0x1ffc00, /* src_mask */ + 0x1ffc00, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* LD/ST32: bit[11:2] of byte offset to module TLS base address. */ + HOWTO (AARCH64_R (TLSLE_LDST32_TPREL_LO12), /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 10, /* bitsize */ + FALSE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_unsigned, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + AARCH64_R_STR (TLSLE_LDST32_TPREL_LO12), /* name */ + FALSE, /* partial_inplace */ + 0xffc00, /* src_mask */ + 0xffc00, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Same as BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12, but no overflow check. */ + HOWTO (AARCH64_R (TLSLE_LDST32_TPREL_LO12_NC), /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 10, /* bitsize */ + FALSE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + AARCH64_R_STR (TLSLE_LDST32_TPREL_LO12_NC), /* name */ + FALSE, /* partial_inplace */ + 0xffc00, /* src_mask */ + 0xffc00, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* LD/ST64: bit[11:3] of byte offset to module TLS base address. */ + HOWTO (AARCH64_R (TLSLE_LDST64_TPREL_LO12), /* type */ + 3, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 9, /* bitsize */ + FALSE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_unsigned, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + AARCH64_R_STR (TLSLE_LDST64_TPREL_LO12), /* name */ + FALSE, /* partial_inplace */ + 0x7fc00, /* src_mask */ + 0x7fc00, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Same as BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12, but no overflow check. */ + HOWTO (AARCH64_R (TLSLE_LDST64_TPREL_LO12_NC), /* type */ + 3, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 9, /* bitsize */ + FALSE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + AARCH64_R_STR (TLSLE_LDST64_TPREL_LO12_NC), /* name */ + FALSE, /* partial_inplace */ + 0x7fc00, /* src_mask */ + 0x7fc00, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* LD/ST8: bit[11:0] of byte offset to module TLS base address. */ + HOWTO (AARCH64_R (TLSLE_LDST8_TPREL_LO12), /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 12, /* bitsize */ + FALSE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_unsigned, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + AARCH64_R_STR (TLSLE_LDST8_TPREL_LO12), /* name */ + FALSE, /* partial_inplace */ + 0x3ffc00, /* src_mask */ + 0x3ffc00, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Same as BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12, but no overflow check. */ + HOWTO (AARCH64_R (TLSLE_LDST8_TPREL_LO12_NC), /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 12, /* bitsize */ + FALSE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + AARCH64_R_STR (TLSLE_LDST8_TPREL_LO12_NC), /* name */ + FALSE, /* partial_inplace */ + 0x3ffc00, /* src_mask */ + 0x3ffc00, /* dst_mask */ + FALSE), /* pcrel_offset */ + HOWTO (AARCH64_R (TLSDESC_LD_PREL19), /* type */ 2, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ diff --git a/bfd/libbfd.h b/bfd/libbfd.h index 0fba5be..4af1019 100644 --- a/bfd/libbfd.h +++ b/bfd/libbfd.h @@ -2944,6 +2944,14 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@", "BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_HI12", "BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12", "BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12_NC", + "BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12", + "BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12_NC", + "BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12", + "BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12_NC", + "BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12", + "BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12_NC", + "BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12", + "BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12_NC", "BFD_RELOC_AARCH64_TLSDESC_LD_PREL19", "BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21", "BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE21", @@ -2969,6 +2977,8 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@", "BFD_RELOC_AARCH64_LDST_LO12", "BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12", "BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12_NC", + "BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12", + "BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12_NC", "BFD_RELOC_AARCH64_LD_GOT_LO12_NC", "BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_LO12_NC", "BFD_RELOC_AARCH64_TLSDESC_LD_LO12_NC", diff --git a/bfd/reloc.c b/bfd/reloc.c index 42e35b9..ca1d81c 100644 --- a/bfd/reloc.c +++ b/bfd/reloc.c @@ -7396,6 +7396,42 @@ ENUM ENUMDOC AArch64 TLS LOCAL EXEC relocation. ENUM + BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12 +ENUMDOC + bit[11:1] of byte offset to module TLS base address, encoded in ldst + instructions. +ENUM + BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12_NC +ENUMDOC + Similar as BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12, but no overflow check. +ENUM + BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12 +ENUMDOC + bit[11:2] of byte offset to module TLS base address, encoded in ldst + instructions. +ENUM + BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12_NC +ENUMDOC + Similar as BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12, but no overflow check. +ENUM + BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12 +ENUMDOC + bit[11:3] of byte offset to module TLS base address, encoded in ldst + instructions. +ENUM + BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12_NC +ENUMDOC + Similar as BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12, but no overflow check. +ENUM + BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12 +ENUMDOC + bit[11:0] of byte offset to module TLS base address, encoded in ldst + instructions. +ENUM + BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12_NC +ENUMDOC + Similar as BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12, but no overflow check. +ENUM BFD_RELOC_AARCH64_TLSDESC_LD_PREL19 ENUMDOC AArch64 TLS DESC relocation. @@ -7504,6 +7540,16 @@ ENUM ENUMDOC Similar as BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12, but no overflow check. ENUM + BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12 +ENUMDOC + AArch64 pseudo relocation code for TLS local exec mode. It's to be + used internally by the AArch64 assembler and not (currently) written to + any object files. +ENUM + BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12_NC +ENUMDOC + Similar as BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12, but no overflow check. +ENUM BFD_RELOC_AARCH64_LD_GOT_LO12_NC ENUMDOC AArch64 pseudo relocation code to be used internally by the AArch64 |