#define TILEPRO_IMM_HOWTO(name, size, bitsize) \
HOWTO (name, 0, size, bitsize, FALSE, 0, \
#define TILEPRO_IMM_HOWTO(name, size, bitsize) \
HOWTO (name, 0, size, bitsize, FALSE, 0, \
- complain_overflow_signed, bfd_elf_generic_reloc, \
- #name, FALSE, 0, -1, FALSE)
+ complain_overflow_signed, bfd_elf_generic_reloc, \
+ #name, FALSE, 0, -1, FALSE)
#define TILEPRO_UIMM_HOWTO(name, size, bitsize) \
HOWTO (name, 0, size, bitsize, FALSE, 0, \
#define TILEPRO_UIMM_HOWTO(name, size, bitsize) \
HOWTO (name, 0, size, bitsize, FALSE, 0, \
- complain_overflow_unsigned, bfd_elf_generic_reloc, \
- #name, FALSE, 0, -1, FALSE)
+ complain_overflow_unsigned, bfd_elf_generic_reloc, \
+ #name, FALSE, 0, -1, FALSE)
TILEPRO_IMM_HOWTO(R_TILEPRO_IMM8_X0, 0, 8),
TILEPRO_IMM_HOWTO(R_TILEPRO_IMM8_Y0, 0, 8),
TILEPRO_IMM_HOWTO(R_TILEPRO_IMM8_X0, 0, 8),
TILEPRO_IMM_HOWTO(R_TILEPRO_IMM8_Y0, 0, 8),
#define TILEPRO_IMM16_HOWTO(name, rshift) \
HOWTO (name, rshift, 1, 16, FALSE, 0, \
#define TILEPRO_IMM16_HOWTO(name, rshift) \
HOWTO (name, rshift, 1, 16, FALSE, 0, \
- complain_overflow_dont, bfd_elf_generic_reloc, \
- #name, FALSE, 0, 0xffff, FALSE)
+ complain_overflow_dont, bfd_elf_generic_reloc, \
+ #name, FALSE, 0, 0xffff, FALSE)
TILEPRO_IMM16_HOWTO (R_TILEPRO_IMM16_X0_LO, 0),
TILEPRO_IMM16_HOWTO (R_TILEPRO_IMM16_X1_LO, 0),
TILEPRO_IMM16_HOWTO (R_TILEPRO_IMM16_X0_LO, 0),
TILEPRO_IMM16_HOWTO (R_TILEPRO_IMM16_X1_LO, 0),
#define TILEPRO_IMM16_HOWTO_PCREL(name, rshift) \
HOWTO (name, rshift, 1, 16, TRUE, 0, \
#define TILEPRO_IMM16_HOWTO_PCREL(name, rshift) \
HOWTO (name, rshift, 1, 16, TRUE, 0, \
- complain_overflow_dont, bfd_elf_generic_reloc, \
- #name, FALSE, 0, 0xffff, TRUE)
+ complain_overflow_dont, bfd_elf_generic_reloc, \
+ #name, FALSE, 0, 0xffff, TRUE)
TILEPRO_IMM16_HOWTO_PCREL (R_TILEPRO_IMM16_X0_LO_PCREL, 0),
TILEPRO_IMM16_HOWTO_PCREL (R_TILEPRO_IMM16_X1_LO_PCREL, 0),
TILEPRO_IMM16_HOWTO_PCREL (R_TILEPRO_IMM16_X0_LO_PCREL, 0),
TILEPRO_IMM16_HOWTO_PCREL (R_TILEPRO_IMM16_X1_LO_PCREL, 0),
TILEPRO_IMM_HOWTO(R_TILEPRO_IMM8_X0_TLS_GD_ADD, 0, 8),
TILEPRO_IMM_HOWTO(R_TILEPRO_IMM8_X1_TLS_GD_ADD, 0, 8),
TILEPRO_IMM_HOWTO(R_TILEPRO_IMM8_X0_TLS_GD_ADD, 0, 8),
TILEPRO_IMM_HOWTO(R_TILEPRO_IMM8_X1_TLS_GD_ADD, 0, 8),
/* These are common with the Solaris TLS implementation. */
HOWTO(R_TILEPRO_TLS_DTPMOD32, 0, 0, 0, FALSE, 0, complain_overflow_dont,
/* These are common with the Solaris TLS implementation. */
HOWTO(R_TILEPRO_TLS_DTPMOD32, 0, 0, 0, FALSE, 0, complain_overflow_dont,
HOWTO(R_TILEPRO_TLS_DTPOFF32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield,
HOWTO(R_TILEPRO_TLS_DTPOFF32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield,
- bfd_elf_generic_reloc, "R_TILEPRO_TLS_DTPOFF32",
- FALSE, 0, 0xFFFFFFFF, TRUE),
+ bfd_elf_generic_reloc, "R_TILEPRO_TLS_DTPOFF32",
+ FALSE, 0, 0xFFFFFFFF, TRUE),
HOWTO(R_TILEPRO_TLS_TPOFF32, 0, 0, 0, FALSE, 0, complain_overflow_dont,
HOWTO(R_TILEPRO_TLS_TPOFF32, 0, 0, 0, FALSE, 0, complain_overflow_dont,
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 0, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- NULL, /* special_function */
- "R_TILEPRO_GNU_VTINHERIT", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0, /* dst_mask */
- FALSE), /* pcrel_offset */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ NULL, /* special_function */
+ "R_TILEPRO_GNU_VTINHERIT", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ FALSE), /* pcrel_offset */
- HOWTO (R_TILEPRO_GNU_VTENTRY, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 0, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- _bfd_elf_rel_vtable_reloc_fn, /* special_function */
- "R_TILEPRO_GNU_VTENTRY", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOWTO (R_TILEPRO_GNU_VTENTRY, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ _bfd_elf_rel_vtable_reloc_fn, /* special_function */
+ "R_TILEPRO_GNU_VTENTRY", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ FALSE), /* pcrel_offset */
- TH_REMAP (BFD_RELOC_NONE, R_TILEPRO_NONE)
- TH_REMAP (BFD_RELOC_32, R_TILEPRO_32)
- TH_REMAP (BFD_RELOC_16, R_TILEPRO_16)
- TH_REMAP (BFD_RELOC_8, R_TILEPRO_8)
- TH_REMAP (BFD_RELOC_32_PCREL, R_TILEPRO_32_PCREL)
- TH_REMAP (BFD_RELOC_16_PCREL, R_TILEPRO_16_PCREL)
- TH_REMAP (BFD_RELOC_8_PCREL, R_TILEPRO_8_PCREL)
- TH_REMAP (BFD_RELOC_LO16, R_TILEPRO_LO16)
- TH_REMAP (BFD_RELOC_HI16, R_TILEPRO_HI16)
- TH_REMAP (BFD_RELOC_HI16_S, R_TILEPRO_HA16)
+ TH_REMAP (BFD_RELOC_NONE, R_TILEPRO_NONE)
+ TH_REMAP (BFD_RELOC_32, R_TILEPRO_32)
+ TH_REMAP (BFD_RELOC_16, R_TILEPRO_16)
+ TH_REMAP (BFD_RELOC_8, R_TILEPRO_8)
+ TH_REMAP (BFD_RELOC_32_PCREL, R_TILEPRO_32_PCREL)
+ TH_REMAP (BFD_RELOC_16_PCREL, R_TILEPRO_16_PCREL)
+ TH_REMAP (BFD_RELOC_8_PCREL, R_TILEPRO_8_PCREL)
+ TH_REMAP (BFD_RELOC_LO16, R_TILEPRO_LO16)
+ TH_REMAP (BFD_RELOC_HI16, R_TILEPRO_HI16)
+ TH_REMAP (BFD_RELOC_HI16_S, R_TILEPRO_HA16)
- TH_REMAP (BFD_RELOC_TILEPRO_COPY, R_TILEPRO_COPY)
- TH_REMAP (BFD_RELOC_TILEPRO_GLOB_DAT, R_TILEPRO_GLOB_DAT)
- TH_REMAP (BFD_RELOC_TILEPRO_JMP_SLOT, R_TILEPRO_JMP_SLOT)
- TH_REMAP (BFD_RELOC_TILEPRO_RELATIVE, R_TILEPRO_RELATIVE)
- TH_REMAP (BFD_RELOC_TILEPRO_BROFF_X1, R_TILEPRO_BROFF_X1)
+ TH_REMAP (BFD_RELOC_TILEPRO_COPY, R_TILEPRO_COPY)
+ TH_REMAP (BFD_RELOC_TILEPRO_GLOB_DAT, R_TILEPRO_GLOB_DAT)
+ TH_REMAP (BFD_RELOC_TILEPRO_JMP_SLOT, R_TILEPRO_JMP_SLOT)
+ TH_REMAP (BFD_RELOC_TILEPRO_RELATIVE, R_TILEPRO_RELATIVE)
+ TH_REMAP (BFD_RELOC_TILEPRO_BROFF_X1, R_TILEPRO_BROFF_X1)
- TH_REMAP (BFD_RELOC_TILEPRO_IMM8_X0, R_TILEPRO_IMM8_X0)
- TH_REMAP (BFD_RELOC_TILEPRO_IMM8_Y0, R_TILEPRO_IMM8_Y0)
- TH_REMAP (BFD_RELOC_TILEPRO_IMM8_X1, R_TILEPRO_IMM8_X1)
- TH_REMAP (BFD_RELOC_TILEPRO_IMM8_Y1, R_TILEPRO_IMM8_Y1)
+ TH_REMAP (BFD_RELOC_TILEPRO_IMM8_X0, R_TILEPRO_IMM8_X0)
+ TH_REMAP (BFD_RELOC_TILEPRO_IMM8_Y0, R_TILEPRO_IMM8_Y0)
+ TH_REMAP (BFD_RELOC_TILEPRO_IMM8_X1, R_TILEPRO_IMM8_X1)
+ TH_REMAP (BFD_RELOC_TILEPRO_IMM8_Y1, R_TILEPRO_IMM8_Y1)
TH_REMAP (BFD_RELOC_TILEPRO_DEST_IMM8_X1, R_TILEPRO_DEST_IMM8_X1)
TH_REMAP (BFD_RELOC_TILEPRO_MT_IMM15_X1, R_TILEPRO_MT_IMM15_X1)
TH_REMAP (BFD_RELOC_TILEPRO_MF_IMM15_X1, R_TILEPRO_MF_IMM15_X1)
TH_REMAP (BFD_RELOC_TILEPRO_DEST_IMM8_X1, R_TILEPRO_DEST_IMM8_X1)
TH_REMAP (BFD_RELOC_TILEPRO_MT_IMM15_X1, R_TILEPRO_MT_IMM15_X1)
TH_REMAP (BFD_RELOC_TILEPRO_MF_IMM15_X1, R_TILEPRO_MF_IMM15_X1)
TH_REMAP (BFD_RELOC_TILEPRO_IMM16_X0_LO, R_TILEPRO_IMM16_X0_LO)
TH_REMAP (BFD_RELOC_TILEPRO_IMM16_X1_LO, R_TILEPRO_IMM16_X1_LO)
TH_REMAP (BFD_RELOC_TILEPRO_IMM16_X0_HI, R_TILEPRO_IMM16_X0_HI)
TH_REMAP (BFD_RELOC_TILEPRO_IMM16_X0_LO, R_TILEPRO_IMM16_X0_LO)
TH_REMAP (BFD_RELOC_TILEPRO_IMM16_X1_LO, R_TILEPRO_IMM16_X1_LO)
TH_REMAP (BFD_RELOC_TILEPRO_IMM16_X0_HI, R_TILEPRO_IMM16_X0_HI)
TH_REMAP (BFD_RELOC_TILEPRO_IMM16_X0_LO_PCREL, R_TILEPRO_IMM16_X0_LO_PCREL)
TH_REMAP (BFD_RELOC_TILEPRO_IMM16_X1_LO_PCREL, R_TILEPRO_IMM16_X1_LO_PCREL)
TH_REMAP (BFD_RELOC_TILEPRO_IMM16_X0_HI_PCREL, R_TILEPRO_IMM16_X0_HI_PCREL)
TH_REMAP (BFD_RELOC_TILEPRO_IMM16_X0_LO_PCREL, R_TILEPRO_IMM16_X0_LO_PCREL)
TH_REMAP (BFD_RELOC_TILEPRO_IMM16_X1_LO_PCREL, R_TILEPRO_IMM16_X1_LO_PCREL)
TH_REMAP (BFD_RELOC_TILEPRO_IMM16_X0_HI_PCREL, R_TILEPRO_IMM16_X0_HI_PCREL)
- TH_REMAP (BFD_RELOC_TILEPRO_MMEND_X1, R_TILEPRO_MMEND_X1)
- TH_REMAP (BFD_RELOC_TILEPRO_SHAMT_X0, R_TILEPRO_SHAMT_X0)
- TH_REMAP (BFD_RELOC_TILEPRO_SHAMT_X1, R_TILEPRO_SHAMT_X1)
- TH_REMAP (BFD_RELOC_TILEPRO_SHAMT_Y0, R_TILEPRO_SHAMT_Y0)
- TH_REMAP (BFD_RELOC_TILEPRO_SHAMT_Y1, R_TILEPRO_SHAMT_Y1)
+ TH_REMAP (BFD_RELOC_TILEPRO_MMEND_X1, R_TILEPRO_MMEND_X1)
+ TH_REMAP (BFD_RELOC_TILEPRO_SHAMT_X0, R_TILEPRO_SHAMT_X0)
+ TH_REMAP (BFD_RELOC_TILEPRO_SHAMT_X1, R_TILEPRO_SHAMT_X1)
+ TH_REMAP (BFD_RELOC_TILEPRO_SHAMT_Y0, R_TILEPRO_SHAMT_Y0)
+ TH_REMAP (BFD_RELOC_TILEPRO_SHAMT_Y1, R_TILEPRO_SHAMT_Y1)
TH_REMAP (BFD_RELOC_TILEPRO_IMM8_X0_TLS_GD_ADD, R_TILEPRO_IMM8_X0_TLS_GD_ADD)
TH_REMAP (BFD_RELOC_TILEPRO_IMM8_X1_TLS_GD_ADD, R_TILEPRO_IMM8_X1_TLS_GD_ADD)
TH_REMAP (BFD_RELOC_TILEPRO_IMM8_Y0_TLS_GD_ADD, R_TILEPRO_IMM8_Y0_TLS_GD_ADD)
TH_REMAP (BFD_RELOC_TILEPRO_IMM8_Y1_TLS_GD_ADD, R_TILEPRO_IMM8_Y1_TLS_GD_ADD)
TH_REMAP (BFD_RELOC_TILEPRO_IMM8_X0_TLS_GD_ADD, R_TILEPRO_IMM8_X0_TLS_GD_ADD)
TH_REMAP (BFD_RELOC_TILEPRO_IMM8_X1_TLS_GD_ADD, R_TILEPRO_IMM8_X1_TLS_GD_ADD)
TH_REMAP (BFD_RELOC_TILEPRO_IMM8_Y0_TLS_GD_ADD, R_TILEPRO_IMM8_Y0_TLS_GD_ADD)
TH_REMAP (BFD_RELOC_TILEPRO_IMM8_Y1_TLS_GD_ADD, R_TILEPRO_IMM8_Y1_TLS_GD_ADD)
TH_REMAP (BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD_LO, R_TILEPRO_IMM16_X0_TLS_GD_LO)
TH_REMAP (BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD_LO, R_TILEPRO_IMM16_X1_TLS_GD_LO)
TH_REMAP (BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD_HI, R_TILEPRO_IMM16_X0_TLS_GD_HI)
TH_REMAP (BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD_LO, R_TILEPRO_IMM16_X0_TLS_GD_LO)
TH_REMAP (BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD_LO, R_TILEPRO_IMM16_X1_TLS_GD_LO)
TH_REMAP (BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD_HI, R_TILEPRO_IMM16_X0_TLS_GD_HI)
TH_REMAP (BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE_LO, R_TILEPRO_IMM16_X0_TLS_IE_LO)
TH_REMAP (BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE_LO, R_TILEPRO_IMM16_X1_TLS_IE_LO)
TH_REMAP (BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE_HI, R_TILEPRO_IMM16_X0_TLS_IE_HI)
TH_REMAP (BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE_LO, R_TILEPRO_IMM16_X0_TLS_IE_LO)
TH_REMAP (BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE_LO, R_TILEPRO_IMM16_X1_TLS_IE_LO)
TH_REMAP (BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE_HI, R_TILEPRO_IMM16_X0_TLS_IE_HI)
TH_REMAP (BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE_LO, R_TILEPRO_IMM16_X0_TLS_LE_LO)
TH_REMAP (BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE_LO, R_TILEPRO_IMM16_X1_TLS_LE_LO)
TH_REMAP (BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE_HI, R_TILEPRO_IMM16_X0_TLS_LE_HI)
TH_REMAP (BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE_LO, R_TILEPRO_IMM16_X0_TLS_LE_LO)
TH_REMAP (BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE_LO, R_TILEPRO_IMM16_X1_TLS_LE_LO)
TH_REMAP (BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE_HI, R_TILEPRO_IMM16_X0_TLS_LE_HI)
-/* The TILEPro linker needs to keep track of the number of relocs that it
- decides to copy as dynamic relocs in check_relocs for each symbol.
- This is so that it can later discard them if they are found to be
- unnecessary. We store the information in a field extending the
- regular ELF linker hash table. */
-
-struct tilepro_elf_dyn_relocs
-{
- struct tilepro_elf_dyn_relocs *next;
-
- /* The input section of the reloc. */
- asection *sec;
-
- /* Total number of relocs copied for the input section. */
- bfd_size_type count;
-
- /* Number of pc-relative relocs copied for the input section. */
- bfd_size_type pc_count;
-};
-
{
unsigned int r_type = ELF32_R_TYPE (dst->r_info);
if (r_type <= (unsigned int) R_TILEPRO_IMM16_X1_TLS_LE_HA)
cache_ptr->howto = &tilepro_elf_howto_table [r_type];
else if (r_type - R_TILEPRO_GNU_VTINHERIT
{
unsigned int r_type = ELF32_R_TYPE (dst->r_info);
if (r_type <= (unsigned int) R_TILEPRO_IMM16_X1_TLS_LE_HA)
cache_ptr->howto = &tilepro_elf_howto_table [r_type];
else if (r_type - R_TILEPRO_GNU_VTINHERIT
- case R_TILEPRO_IMM16_X0_TLS_LE:
- case R_TILEPRO_IMM16_X1_TLS_LE:
- case R_TILEPRO_IMM16_X0_TLS_LE_LO:
- case R_TILEPRO_IMM16_X1_TLS_LE_LO:
- case R_TILEPRO_IMM16_X0_TLS_LE_HI:
- case R_TILEPRO_IMM16_X1_TLS_LE_HI:
- case R_TILEPRO_IMM16_X0_TLS_LE_HA:
- case R_TILEPRO_IMM16_X1_TLS_LE_HA:
+ case R_TILEPRO_IMM16_X0_TLS_LE:
+ case R_TILEPRO_IMM16_X1_TLS_LE:
+ case R_TILEPRO_IMM16_X0_TLS_LE_LO:
+ case R_TILEPRO_IMM16_X1_TLS_LE_LO:
+ case R_TILEPRO_IMM16_X0_TLS_LE_HI:
+ case R_TILEPRO_IMM16_X1_TLS_LE_HI:
+ case R_TILEPRO_IMM16_X0_TLS_LE_HA:
+ case R_TILEPRO_IMM16_X1_TLS_LE_HA:
- case R_TILEPRO_IMM16_X0_TLS_GD:
- case R_TILEPRO_IMM16_X1_TLS_GD:
- case R_TILEPRO_IMM16_X0_TLS_GD_LO:
- case R_TILEPRO_IMM16_X1_TLS_GD_LO:
- case R_TILEPRO_IMM16_X0_TLS_GD_HI:
- case R_TILEPRO_IMM16_X1_TLS_GD_HI:
- case R_TILEPRO_IMM16_X0_TLS_GD_HA:
- case R_TILEPRO_IMM16_X1_TLS_GD_HA:
+ case R_TILEPRO_IMM16_X0_TLS_GD:
+ case R_TILEPRO_IMM16_X1_TLS_GD:
+ case R_TILEPRO_IMM16_X0_TLS_GD_LO:
+ case R_TILEPRO_IMM16_X1_TLS_GD_LO:
+ case R_TILEPRO_IMM16_X0_TLS_GD_HI:
+ case R_TILEPRO_IMM16_X1_TLS_GD_HI:
+ case R_TILEPRO_IMM16_X0_TLS_GD_HA:
+ case R_TILEPRO_IMM16_X1_TLS_GD_HA:
- goto have_got_reference;
-
- case R_TILEPRO_IMM16_X0_TLS_IE:
- case R_TILEPRO_IMM16_X1_TLS_IE:
- case R_TILEPRO_IMM16_X0_TLS_IE_LO:
- case R_TILEPRO_IMM16_X1_TLS_IE_LO:
- case R_TILEPRO_IMM16_X0_TLS_IE_HI:
- case R_TILEPRO_IMM16_X1_TLS_IE_HI:
- case R_TILEPRO_IMM16_X0_TLS_IE_HA:
- case R_TILEPRO_IMM16_X1_TLS_IE_HA:
- tls_type = GOT_TLS_IE;
- if (!bfd_link_executable (info))
- info->flags |= DF_STATIC_TLS;
- goto have_got_reference;
-
- case R_TILEPRO_IMM16_X0_GOT:
- case R_TILEPRO_IMM16_X1_GOT:
- case R_TILEPRO_IMM16_X0_GOT_LO:
- case R_TILEPRO_IMM16_X1_GOT_LO:
- case R_TILEPRO_IMM16_X0_GOT_HI:
- case R_TILEPRO_IMM16_X1_GOT_HI:
- case R_TILEPRO_IMM16_X0_GOT_HA:
- case R_TILEPRO_IMM16_X1_GOT_HA:
- tls_type = GOT_NORMAL;
- /* Fall Through */
-
- have_got_reference:
+ goto have_got_reference;
+
+ case R_TILEPRO_IMM16_X0_TLS_IE:
+ case R_TILEPRO_IMM16_X1_TLS_IE:
+ case R_TILEPRO_IMM16_X0_TLS_IE_LO:
+ case R_TILEPRO_IMM16_X1_TLS_IE_LO:
+ case R_TILEPRO_IMM16_X0_TLS_IE_HI:
+ case R_TILEPRO_IMM16_X1_TLS_IE_HI:
+ case R_TILEPRO_IMM16_X0_TLS_IE_HA:
+ case R_TILEPRO_IMM16_X1_TLS_IE_HA:
+ tls_type = GOT_TLS_IE;
+ if (!bfd_link_executable (info))
+ info->flags |= DF_STATIC_TLS;
+ goto have_got_reference;
+
+ case R_TILEPRO_IMM16_X0_GOT:
+ case R_TILEPRO_IMM16_X1_GOT:
+ case R_TILEPRO_IMM16_X0_GOT_LO:
+ case R_TILEPRO_IMM16_X1_GOT_LO:
+ case R_TILEPRO_IMM16_X0_GOT_HI:
+ case R_TILEPRO_IMM16_X1_GOT_HI:
+ case R_TILEPRO_IMM16_X0_GOT_HA:
+ case R_TILEPRO_IMM16_X1_GOT_HA:
+ tls_type = GOT_NORMAL;
+ /* Fall Through */
+
+ have_got_reference:
- case R_TILEPRO_32_PCREL:
- case R_TILEPRO_16_PCREL:
- case R_TILEPRO_8_PCREL:
- case R_TILEPRO_IMM16_X0_PCREL:
- case R_TILEPRO_IMM16_X1_PCREL:
- case R_TILEPRO_IMM16_X0_LO_PCREL:
- case R_TILEPRO_IMM16_X1_LO_PCREL:
- case R_TILEPRO_IMM16_X0_HI_PCREL:
- case R_TILEPRO_IMM16_X1_HI_PCREL:
- case R_TILEPRO_IMM16_X0_HA_PCREL:
- case R_TILEPRO_IMM16_X1_HA_PCREL:
+ case R_TILEPRO_32_PCREL:
+ case R_TILEPRO_16_PCREL:
+ case R_TILEPRO_8_PCREL:
+ case R_TILEPRO_IMM16_X0_PCREL:
+ case R_TILEPRO_IMM16_X1_PCREL:
+ case R_TILEPRO_IMM16_X0_LO_PCREL:
+ case R_TILEPRO_IMM16_X1_LO_PCREL:
+ case R_TILEPRO_IMM16_X0_HI_PCREL:
+ case R_TILEPRO_IMM16_X1_HI_PCREL:
+ case R_TILEPRO_IMM16_X0_HA_PCREL:
+ case R_TILEPRO_IMM16_X1_HA_PCREL:
- case R_TILEPRO_32:
- case R_TILEPRO_16:
- case R_TILEPRO_8:
- case R_TILEPRO_LO16:
- case R_TILEPRO_HI16:
- case R_TILEPRO_HA16:
- case R_TILEPRO_COPY:
- case R_TILEPRO_GLOB_DAT:
- case R_TILEPRO_JMP_SLOT:
- case R_TILEPRO_RELATIVE:
- case R_TILEPRO_BROFF_X1:
- case R_TILEPRO_JOFFLONG_X1:
- case R_TILEPRO_IMM8_X0:
- case R_TILEPRO_IMM8_Y0:
- case R_TILEPRO_IMM8_X1:
- case R_TILEPRO_IMM8_Y1:
- case R_TILEPRO_DEST_IMM8_X1:
- case R_TILEPRO_MT_IMM15_X1:
- case R_TILEPRO_MF_IMM15_X1:
- case R_TILEPRO_IMM16_X0:
- case R_TILEPRO_IMM16_X1:
- case R_TILEPRO_IMM16_X0_LO:
- case R_TILEPRO_IMM16_X1_LO:
- case R_TILEPRO_IMM16_X0_HI:
- case R_TILEPRO_IMM16_X1_HI:
- case R_TILEPRO_IMM16_X0_HA:
- case R_TILEPRO_IMM16_X1_HA:
- case R_TILEPRO_MMSTART_X0:
- case R_TILEPRO_MMEND_X0:
- case R_TILEPRO_MMSTART_X1:
- case R_TILEPRO_MMEND_X1:
- case R_TILEPRO_SHAMT_X0:
- case R_TILEPRO_SHAMT_X1:
- case R_TILEPRO_SHAMT_Y0:
- case R_TILEPRO_SHAMT_Y1:
+ case R_TILEPRO_32:
+ case R_TILEPRO_16:
+ case R_TILEPRO_8:
+ case R_TILEPRO_LO16:
+ case R_TILEPRO_HI16:
+ case R_TILEPRO_HA16:
+ case R_TILEPRO_COPY:
+ case R_TILEPRO_GLOB_DAT:
+ case R_TILEPRO_JMP_SLOT:
+ case R_TILEPRO_RELATIVE:
+ case R_TILEPRO_BROFF_X1:
+ case R_TILEPRO_JOFFLONG_X1:
+ case R_TILEPRO_IMM8_X0:
+ case R_TILEPRO_IMM8_Y0:
+ case R_TILEPRO_IMM8_X1:
+ case R_TILEPRO_IMM8_Y1:
+ case R_TILEPRO_DEST_IMM8_X1:
+ case R_TILEPRO_MT_IMM15_X1:
+ case R_TILEPRO_MF_IMM15_X1:
+ case R_TILEPRO_IMM16_X0:
+ case R_TILEPRO_IMM16_X1:
+ case R_TILEPRO_IMM16_X0_LO:
+ case R_TILEPRO_IMM16_X1_LO:
+ case R_TILEPRO_IMM16_X0_HI:
+ case R_TILEPRO_IMM16_X1_HI:
+ case R_TILEPRO_IMM16_X0_HA:
+ case R_TILEPRO_IMM16_X1_HA:
+ case R_TILEPRO_MMSTART_X0:
+ case R_TILEPRO_MMEND_X0:
+ case R_TILEPRO_MMSTART_X1:
+ case R_TILEPRO_MMEND_X1:
+ case R_TILEPRO_SHAMT_X0:
+ case R_TILEPRO_SHAMT_X1:
+ case R_TILEPRO_SHAMT_Y0:
+ case R_TILEPRO_SHAMT_Y1:
- struct bfd_link_info *info,
- Elf_Internal_Rela *rel,
- struct elf_link_hash_entry *h,
- Elf_Internal_Sym *sym)
+ struct bfd_link_info *info,
+ Elf_Internal_Rela *rel,
+ struct elf_link_hash_entry *h,
+ Elf_Internal_Sym *sym)
- reloc in an input file, but the symbol was never referred
- to by a dynamic object, or if all references were garbage
- collected. In such a case, we don't actually need to build
- a procedure linkage table, and we can just do a
- R_TILEPRO_JOFFLONG_X1 relocation instead. */
+ reloc in an input file, but the symbol was never referred
+ to by a dynamic object, or if all references were garbage
+ collected. In such a case, we don't actually need to build
+ a procedure linkage table, and we can just do a
+ R_TILEPRO_JOFFLONG_X1 relocation instead. */
- bfd *input_bfd, asection *input_section,
- bfd_byte *contents, Elf_Internal_Rela *relocs,
- Elf_Internal_Sym *local_syms,
- asection **local_sections)
+ bfd *input_bfd, asection *input_section,
+ bfd_byte *contents, Elf_Internal_Rela *relocs,
+ Elf_Internal_Sym *local_syms,
+ asection **local_sections)
name = (bfd_elf_string_from_elf_section
(input_bfd, symtab_hdr->sh_link, sym->st_name));
if (name == NULL || *name == '\0')
name = (bfd_elf_string_from_elf_section
(input_bfd, symtab_hdr->sh_link, sym->st_name));
if (name == NULL || *name == '\0')
- case R_TILEPRO_IMM16_X0_GOT:
- case R_TILEPRO_IMM16_X1_GOT:
- case R_TILEPRO_IMM16_X0_GOT_LO:
- case R_TILEPRO_IMM16_X1_GOT_LO:
- case R_TILEPRO_IMM16_X0_GOT_HI:
- case R_TILEPRO_IMM16_X1_GOT_HI:
- case R_TILEPRO_IMM16_X0_GOT_HA:
- case R_TILEPRO_IMM16_X1_GOT_HA:
+ case R_TILEPRO_IMM16_X0_GOT:
+ case R_TILEPRO_IMM16_X1_GOT:
+ case R_TILEPRO_IMM16_X0_GOT_LO:
+ case R_TILEPRO_IMM16_X1_GOT_LO:
+ case R_TILEPRO_IMM16_X0_GOT_HI:
+ case R_TILEPRO_IMM16_X1_GOT_HI:
+ case R_TILEPRO_IMM16_X0_GOT_HA:
+ case R_TILEPRO_IMM16_X1_GOT_HA:
- case R_TILEPRO_32_PCREL:
- case R_TILEPRO_16_PCREL:
- case R_TILEPRO_8_PCREL:
- case R_TILEPRO_IMM16_X0_PCREL:
- case R_TILEPRO_IMM16_X1_PCREL:
- case R_TILEPRO_IMM16_X0_LO_PCREL:
- case R_TILEPRO_IMM16_X1_LO_PCREL:
- case R_TILEPRO_IMM16_X0_HI_PCREL:
- case R_TILEPRO_IMM16_X1_HI_PCREL:
- case R_TILEPRO_IMM16_X0_HA_PCREL:
- case R_TILEPRO_IMM16_X1_HA_PCREL:
+ case R_TILEPRO_32_PCREL:
+ case R_TILEPRO_16_PCREL:
+ case R_TILEPRO_8_PCREL:
+ case R_TILEPRO_IMM16_X0_PCREL:
+ case R_TILEPRO_IMM16_X1_PCREL:
+ case R_TILEPRO_IMM16_X0_LO_PCREL:
+ case R_TILEPRO_IMM16_X1_LO_PCREL:
+ case R_TILEPRO_IMM16_X0_HI_PCREL:
+ case R_TILEPRO_IMM16_X1_HI_PCREL:
+ case R_TILEPRO_IMM16_X0_HA_PCREL:
+ case R_TILEPRO_IMM16_X1_HA_PCREL:
- case R_TILEPRO_32:
- case R_TILEPRO_16:
- case R_TILEPRO_8:
- case R_TILEPRO_LO16:
- case R_TILEPRO_HI16:
- case R_TILEPRO_HA16:
- case R_TILEPRO_COPY:
- case R_TILEPRO_GLOB_DAT:
- case R_TILEPRO_JMP_SLOT:
- case R_TILEPRO_RELATIVE:
- case R_TILEPRO_BROFF_X1:
- case R_TILEPRO_JOFFLONG_X1:
- case R_TILEPRO_IMM8_X0:
- case R_TILEPRO_IMM8_Y0:
- case R_TILEPRO_IMM8_X1:
- case R_TILEPRO_IMM8_Y1:
- case R_TILEPRO_DEST_IMM8_X1:
- case R_TILEPRO_MT_IMM15_X1:
- case R_TILEPRO_MF_IMM15_X1:
- case R_TILEPRO_IMM16_X0:
- case R_TILEPRO_IMM16_X1:
- case R_TILEPRO_IMM16_X0_LO:
- case R_TILEPRO_IMM16_X1_LO:
- case R_TILEPRO_IMM16_X0_HI:
- case R_TILEPRO_IMM16_X1_HI:
- case R_TILEPRO_IMM16_X0_HA:
- case R_TILEPRO_IMM16_X1_HA:
- case R_TILEPRO_MMSTART_X0:
- case R_TILEPRO_MMEND_X0:
- case R_TILEPRO_MMSTART_X1:
- case R_TILEPRO_MMEND_X1:
- case R_TILEPRO_SHAMT_X0:
- case R_TILEPRO_SHAMT_X1:
- case R_TILEPRO_SHAMT_Y0:
- case R_TILEPRO_SHAMT_Y1:
+ case R_TILEPRO_32:
+ case R_TILEPRO_16:
+ case R_TILEPRO_8:
+ case R_TILEPRO_LO16:
+ case R_TILEPRO_HI16:
+ case R_TILEPRO_HA16:
+ case R_TILEPRO_COPY:
+ case R_TILEPRO_GLOB_DAT:
+ case R_TILEPRO_JMP_SLOT:
+ case R_TILEPRO_RELATIVE:
+ case R_TILEPRO_BROFF_X1:
+ case R_TILEPRO_JOFFLONG_X1:
+ case R_TILEPRO_IMM8_X0:
+ case R_TILEPRO_IMM8_Y0:
+ case R_TILEPRO_IMM8_X1:
+ case R_TILEPRO_IMM8_Y1:
+ case R_TILEPRO_DEST_IMM8_X1:
+ case R_TILEPRO_MT_IMM15_X1:
+ case R_TILEPRO_MF_IMM15_X1:
+ case R_TILEPRO_IMM16_X0:
+ case R_TILEPRO_IMM16_X1:
+ case R_TILEPRO_IMM16_X0_LO:
+ case R_TILEPRO_IMM16_X1_LO:
+ case R_TILEPRO_IMM16_X0_HI:
+ case R_TILEPRO_IMM16_X1_HI:
+ case R_TILEPRO_IMM16_X0_HA:
+ case R_TILEPRO_IMM16_X1_HA:
+ case R_TILEPRO_MMSTART_X0:
+ case R_TILEPRO_MMEND_X0:
+ case R_TILEPRO_MMSTART_X1:
+ case R_TILEPRO_MMEND_X1:
+ case R_TILEPRO_SHAMT_X0:
+ case R_TILEPRO_SHAMT_X1:
+ case R_TILEPRO_SHAMT_Y0:
+ case R_TILEPRO_SHAMT_Y1:
/* If the symbol is not dynamic, we should not keep
a dynamic relocation. But an .rela.* slot has been
allocated for it, output R_TILEPRO_NONE.
/* If the symbol is not dynamic, we should not keep
a dynamic relocation. But an .rela.* slot has been
allocated for it, output R_TILEPRO_NONE.
- case R_TILEPRO_IMM16_X0_TLS_LE:
- case R_TILEPRO_IMM16_X1_TLS_LE:
- case R_TILEPRO_IMM16_X0_TLS_LE_LO:
- case R_TILEPRO_IMM16_X1_TLS_LE_LO:
- case R_TILEPRO_IMM16_X0_TLS_LE_HI:
- case R_TILEPRO_IMM16_X1_TLS_LE_HI:
- case R_TILEPRO_IMM16_X0_TLS_LE_HA:
- case R_TILEPRO_IMM16_X1_TLS_LE_HA:
+ case R_TILEPRO_IMM16_X0_TLS_LE:
+ case R_TILEPRO_IMM16_X1_TLS_LE:
+ case R_TILEPRO_IMM16_X0_TLS_LE_LO:
+ case R_TILEPRO_IMM16_X1_TLS_LE_LO:
+ case R_TILEPRO_IMM16_X0_TLS_LE_HI:
+ case R_TILEPRO_IMM16_X1_TLS_LE_HI:
+ case R_TILEPRO_IMM16_X0_TLS_LE_HA:
+ case R_TILEPRO_IMM16_X1_TLS_LE_HA:
- case R_TILEPRO_IMM16_X0_TLS_GD:
- case R_TILEPRO_IMM16_X1_TLS_GD:
- case R_TILEPRO_IMM16_X0_TLS_GD_LO:
- case R_TILEPRO_IMM16_X1_TLS_GD_LO:
- case R_TILEPRO_IMM16_X0_TLS_GD_HI:
- case R_TILEPRO_IMM16_X1_TLS_GD_HI:
- case R_TILEPRO_IMM16_X0_TLS_GD_HA:
- case R_TILEPRO_IMM16_X1_TLS_GD_HA:
- case R_TILEPRO_IMM16_X0_TLS_IE:
- case R_TILEPRO_IMM16_X1_TLS_IE:
- case R_TILEPRO_IMM16_X0_TLS_IE_LO:
- case R_TILEPRO_IMM16_X1_TLS_IE_LO:
- case R_TILEPRO_IMM16_X0_TLS_IE_HI:
- case R_TILEPRO_IMM16_X1_TLS_IE_HI:
- case R_TILEPRO_IMM16_X0_TLS_IE_HA:
- case R_TILEPRO_IMM16_X1_TLS_IE_HA:
+ case R_TILEPRO_IMM16_X0_TLS_GD:
+ case R_TILEPRO_IMM16_X1_TLS_GD:
+ case R_TILEPRO_IMM16_X0_TLS_GD_LO:
+ case R_TILEPRO_IMM16_X1_TLS_GD_LO:
+ case R_TILEPRO_IMM16_X0_TLS_GD_HI:
+ case R_TILEPRO_IMM16_X1_TLS_GD_HI:
+ case R_TILEPRO_IMM16_X0_TLS_GD_HA:
+ case R_TILEPRO_IMM16_X1_TLS_GD_HA:
+ case R_TILEPRO_IMM16_X0_TLS_IE:
+ case R_TILEPRO_IMM16_X1_TLS_IE:
+ case R_TILEPRO_IMM16_X0_TLS_IE_LO:
+ case R_TILEPRO_IMM16_X1_TLS_IE_LO:
+ case R_TILEPRO_IMM16_X0_TLS_IE_HI:
+ case R_TILEPRO_IMM16_X1_TLS_IE_HI:
+ case R_TILEPRO_IMM16_X0_TLS_IE_HA:
+ case R_TILEPRO_IMM16_X1_TLS_IE_HA:
- switch (r_type)
- {
- case R_TILEPRO_IMM16_X0_TLS_IE:
- case R_TILEPRO_IMM16_X1_TLS_IE:
- case R_TILEPRO_IMM16_X0_TLS_IE_LO:
- case R_TILEPRO_IMM16_X1_TLS_IE_LO:
- case R_TILEPRO_IMM16_X0_TLS_IE_HI:
- case R_TILEPRO_IMM16_X1_TLS_IE_HI:
- case R_TILEPRO_IMM16_X0_TLS_IE_HA:
- case R_TILEPRO_IMM16_X1_TLS_IE_HA:
+ switch (r_type)
+ {
+ case R_TILEPRO_IMM16_X0_TLS_IE:
+ case R_TILEPRO_IMM16_X1_TLS_IE:
+ case R_TILEPRO_IMM16_X0_TLS_IE_LO:
+ case R_TILEPRO_IMM16_X1_TLS_IE_LO:
+ case R_TILEPRO_IMM16_X0_TLS_IE_HI:
+ case R_TILEPRO_IMM16_X1_TLS_IE_HI:
+ case R_TILEPRO_IMM16_X0_TLS_IE_HA:
+ case R_TILEPRO_IMM16_X1_TLS_IE_HA:
- outrel.r_addend = 0;
- outrel.r_info = ELF32_R_INFO (indx, R_TILEPRO_TLS_DTPMOD32);
- bfd_put_32 (output_bfd, 0, htab->elf.sgot->contents + off);
- tilepro_elf_append_rela_32 (output_bfd, htab->elf.srelgot,
+ outrel.r_addend = 0;
+ outrel.r_info = ELF32_R_INFO (indx, R_TILEPRO_TLS_DTPMOD32);
+ bfd_put_32 (output_bfd, 0, htab->elf.sgot->contents + off);
+ tilepro_elf_append_rela_32 (output_bfd, htab->elf.srelgot,
- general dynamic reference, then we must be in a
- static link or an executable link with the
- symbol binding locally. Mark it as belonging
- to module 1, the executable. */
+ general dynamic reference, then we must be in a
+ static link or an executable link with the
+ symbol binding locally. Mark it as belonging
+ to module 1, the executable. */
bfd_put_32 (output_bfd, 1,
htab->elf.sgot->contents + off );
bfd_put_32 (output_bfd, relocation - dtpoff_base (info),
htab->elf.sgot->contents + off +
TILEPRO_BYTES_PER_WORD);
}
bfd_put_32 (output_bfd, 1,
htab->elf.sgot->contents + off );
bfd_put_32 (output_bfd, relocation - dtpoff_base (info),
htab->elf.sgot->contents + off +
TILEPRO_BYTES_PER_WORD);
}
- r = _bfd_final_link_relocate (howto, input_bfd, input_section,
- contents, rel->r_offset,
- relocation, rel->r_addend);
+ r = _bfd_final_link_relocate (howto, input_bfd, input_section,
+ contents, rel->r_offset,
+ relocation, rel->r_addend);
- if (howto->pc_relative)
- {
- relocation -=
- input_section->output_section->vma + input_section->output_offset;
- if (howto->pcrel_offset)
- relocation -= rel->r_offset;
- }
-
- bfd_byte *data;
-
- /* Add the relocation addend if any to the final target value */
- relocation += rel->r_addend;
-
- /* Do basic range checking */
- r = bfd_check_overflow (howto->complain_on_overflow,
- howto->bitsize,
- howto->rightshift,
- 32,
- relocation);
-
- /*
- * Write the relocated value out into the raw section data.
- * Don't put a relocation out in the .rela section.
- */
- tilepro_bundle_bits mask = create_func(-1);
- tilepro_bundle_bits value = create_func(relocation >> howto->rightshift);
-
- /* Only touch bytes while the mask is not 0, so we
- don't write to out of bounds memory if this is actually
- a 16-bit switch instruction. */
- for (data = contents + rel->r_offset; mask != 0; data++)
- {
- bfd_byte byte_mask = (bfd_byte)mask;
- *data = (*data & ~byte_mask) | ((bfd_byte)value & byte_mask);
- mask >>= 8;
- value >>= 8;
- }
+ if (howto->pc_relative)
+ {
+ relocation -=
+ input_section->output_section->vma + input_section->output_offset;
+ if (howto->pcrel_offset)
+ relocation -= rel->r_offset;
+ }
+
+ bfd_byte *data;
+
+ /* Add the relocation addend if any to the final target value */
+ relocation += rel->r_addend;
+
+ /* Do basic range checking */
+ r = bfd_check_overflow (howto->complain_on_overflow,
+ howto->bitsize,
+ howto->rightshift,
+ 32,
+ relocation);
+
+ /*
+ * Write the relocated value out into the raw section data.
+ * Don't put a relocation out in the .rela section.
+ */
+ tilepro_bundle_bits mask = create_func(-1);
+ tilepro_bundle_bits value = create_func(relocation >> howto->rightshift);
+
+ /* Only touch bytes while the mask is not 0, so we
+ don't write to out of bounds memory if this is actually
+ a 16-bit switch instruction. */
+ for (data = contents + rel->r_offset; mask != 0; data++)
+ {
+ bfd_byte byte_mask = (bfd_byte)mask;
+ *data = (*data & ~byte_mask) | ((bfd_byte)value & byte_mask);
+ mask >>= 8;
+ value >>= 8;
+ }
-#define elf_info_to_howto_rel NULL
-#define elf_info_to_howto tilepro_info_to_howto_rela
-#define elf_backend_grok_prstatus tilepro_elf_grok_prstatus
-#define elf_backend_grok_psinfo tilepro_elf_grok_psinfo
+#define elf_info_to_howto_rel NULL
+#define elf_info_to_howto tilepro_info_to_howto_rela
+#define elf_backend_grok_prstatus tilepro_elf_grok_prstatus
+#define elf_backend_grok_psinfo tilepro_elf_grok_psinfo