aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-tilepro.c
diff options
context:
space:
mode:
Diffstat (limited to 'bfd/elf32-tilepro.c')
-rw-r--r--bfd/elf32-tilepro.c165
1 files changed, 0 insertions, 165 deletions
diff --git a/bfd/elf32-tilepro.c b/bfd/elf32-tilepro.c
index ad22335..7ab60bb 100644
--- a/bfd/elf32-tilepro.c
+++ b/bfd/elf32-tilepro.c
@@ -1885,170 +1885,6 @@ tilepro_elf_gc_mark_hook (asection *sec,
return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym);
}
-/* Update the got entry reference counts for the section being removed. */
-static bfd_boolean
-tilepro_elf_gc_sweep_hook (bfd *abfd, struct bfd_link_info *info,
- asection *sec, const Elf_Internal_Rela *relocs)
-{
- struct tilepro_elf_link_hash_table *htab;
- Elf_Internal_Shdr *symtab_hdr;
- struct elf_link_hash_entry **sym_hashes;
- bfd_signed_vma *local_got_refcounts;
- const Elf_Internal_Rela *rel, *relend;
-
- if (bfd_link_relocatable (info))
- return TRUE;
-
- BFD_ASSERT (is_tilepro_elf (abfd) || sec->reloc_count == 0);
-
- elf_section_data (sec)->local_dynrel = NULL;
-
- htab = tilepro_elf_hash_table (info);
- BFD_ASSERT (htab != NULL);
- symtab_hdr = &elf_symtab_hdr (abfd);
- sym_hashes = elf_sym_hashes (abfd);
- local_got_refcounts = elf_local_got_refcounts (abfd);
-
- relend = relocs + sec->reloc_count;
- for (rel = relocs; rel < relend; rel++)
- {
- unsigned long r_symndx;
- unsigned int r_type;
- struct elf_link_hash_entry *h = NULL;
-
- r_symndx = ELF32_R_SYM (rel->r_info);
- if (r_symndx >= symtab_hdr->sh_info)
- {
- struct tilepro_elf_link_hash_entry *eh;
- struct tilepro_elf_dyn_relocs **pp;
- struct tilepro_elf_dyn_relocs *p;
-
- h = sym_hashes[r_symndx - symtab_hdr->sh_info];
- while (h->root.type == bfd_link_hash_indirect
- || h->root.type == bfd_link_hash_warning)
- h = (struct elf_link_hash_entry *) h->root.u.i.link;
- eh = (struct tilepro_elf_link_hash_entry *) h;
- for (pp = &eh->dyn_relocs; (p = *pp) != NULL; pp = &p->next)
- if (p->sec == sec)
- {
- /* Everything must go for SEC. */
- *pp = p->next;
- break;
- }
- }
-
- r_type = ELF32_R_TYPE (rel->r_info);
- r_type = tilepro_elf_tls_transition (info, r_type, h != NULL);
- switch (r_type)
- {
- 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_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:
- if (h != NULL)
- {
- if (h->got.refcount > 0)
- h->got.refcount--;
- }
- else
- {
- if (local_got_refcounts &&
- local_got_refcounts[r_symndx] > 0)
- local_got_refcounts[r_symndx]--;
- }
- break;
-
- 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:
- if (h != NULL
- && strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0)
- break;
- /* Fall through. */
-
- 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 (bfd_link_pic (info))
- break;
- /* Fall through. */
-
- case R_TILEPRO_JOFFLONG_X1_PLT:
- if (h != NULL)
- {
- if (h->plt.refcount > 0)
- h->plt.refcount--;
- }
- break;
-
- default:
- break;
- }
- }
-
- return TRUE;
-}
-
/* Adjust a symbol defined by a dynamic object and referenced by a
regular object. The current definition is in some section of the
dynamic object, but we're not including those sections. We have to
@@ -4042,7 +3878,6 @@ tilepro_additional_program_headers (bfd *abfd,
#define elf_backend_finish_dynamic_symbol tilepro_elf_finish_dynamic_symbol
#define elf_backend_finish_dynamic_sections tilepro_elf_finish_dynamic_sections
#define elf_backend_gc_mark_hook tilepro_elf_gc_mark_hook
-#define elf_backend_gc_sweep_hook tilepro_elf_gc_sweep_hook
#define elf_backend_plt_sym_val tilepro_elf_plt_sym_val
#define elf_info_to_howto_rel NULL
#define elf_info_to_howto tilepro_info_to_howto_rela