summaryrefslogtreecommitdiff
path: root/bfd/elf64-s390.c
diff options
context:
space:
mode:
Diffstat (limited to 'bfd/elf64-s390.c')
-rw-r--r--bfd/elf64-s390.c181
1 files changed, 0 insertions, 181 deletions
diff --git a/bfd/elf64-s390.c b/bfd/elf64-s390.c
index c12688027bf..08cc19c5eec 100644
--- a/bfd/elf64-s390.c
+++ b/bfd/elf64-s390.c
@@ -1333,186 +1333,6 @@ elf_s390_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
-elf_s390_gc_sweep_hook (bfd *abfd,
- struct bfd_link_info *info,
- asection *sec,
- const Elf_Internal_Rela *relocs)
-{
- struct elf_s390_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;
-
- htab = elf_s390_hash_table (info);
- if (htab == NULL)
- return FALSE;
-
- elf_section_data (sec)->local_dynrel = 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 = ELF64_R_SYM (rel->r_info);
- if (r_symndx >= symtab_hdr->sh_info)
- {
- struct elf_s390_link_hash_entry *eh;
- struct elf_dyn_relocs **pp;
- struct 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 elf_s390_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;
- }
- }
- else
- {
- Elf_Internal_Sym *isym;
-
- /* A local symbol. */
- isym = bfd_sym_from_r_symndx (&htab->sym_cache,
- abfd, r_symndx);
- if (isym == NULL)
- return FALSE;
-
- if (ELF_ST_TYPE (isym->st_info) == STT_GNU_IFUNC)
- {
- struct plt_entry *plt = elf_s390_local_plt (abfd);
- if (plt[r_symndx].plt.refcount > 0)
- plt[r_symndx].plt.refcount--;
- }
- }
-
- r_type = ELF64_R_TYPE (rel->r_info);
- r_type = elf_s390_tls_transition (info, r_type, h != NULL);
- switch (r_type)
- {
- case R_390_TLS_LDM64:
- if (htab->tls_ldm_got.refcount > 0)
- htab->tls_ldm_got.refcount -= 1;
- break;
- case R_390_GOTOFF16:
- case R_390_GOTOFF32:
- case R_390_GOTOFF64:
- if (h != NULL && s390_is_ifunc_symbol_p (h) && h->def_regular)
- {
- h->plt.refcount--;
- break;
- }
-
- case R_390_GOTPC:
- case R_390_GOTPCDBL:
- break;
-
- case R_390_TLS_GD64:
- case R_390_TLS_IE64:
- case R_390_TLS_GOTIE12:
- case R_390_TLS_GOTIE20:
- case R_390_TLS_GOTIE64:
- case R_390_TLS_IEENT:
- case R_390_GOT12:
- case R_390_GOT16:
- case R_390_GOT20:
- case R_390_GOT32:
- case R_390_GOT64:
- case R_390_GOTENT:
- if (h != NULL)
- {
- if (h->got.refcount > 0)
- h->got.refcount -= 1;
- }
- else if (local_got_refcounts != NULL)
- {
- if (local_got_refcounts[r_symndx] > 0)
- local_got_refcounts[r_symndx] -= 1;
- }
- break;
-
- case R_390_8:
- case R_390_12:
- case R_390_16:
- case R_390_20:
- case R_390_32:
- case R_390_64:
- case R_390_PC16:
- case R_390_PC12DBL:
- case R_390_PC16DBL:
- case R_390_PC24DBL:
- case R_390_PC32:
- case R_390_PC32DBL:
- case R_390_PC64:
- if (bfd_link_pic (info))
- break;
- /* Fall through */
-
- case R_390_PLT12DBL:
- case R_390_PLT16DBL:
- case R_390_PLT24DBL:
- case R_390_PLT32:
- case R_390_PLT32DBL:
- case R_390_PLT64:
- case R_390_PLTOFF16:
- case R_390_PLTOFF32:
- case R_390_PLTOFF64:
- if (h != NULL)
- {
- if (h->plt.refcount > 0)
- h->plt.refcount -= 1;
- }
- break;
-
- case R_390_GOTPLT12:
- case R_390_GOTPLT16:
- case R_390_GOTPLT20:
- case R_390_GOTPLT32:
- case R_390_GOTPLT64:
- case R_390_GOTPLTENT:
- if (h != NULL)
- {
- if (h->plt.refcount > 0)
- {
- ((struct elf_s390_link_hash_entry *) h)->gotplt_refcount--;
- h->plt.refcount -= 1;
- }
- }
- else if (local_got_refcounts != NULL)
- {
- if (local_got_refcounts[r_symndx] > 0)
- local_got_refcounts[r_symndx] -= 1;
- }
- break;
-
- default:
- break;
- }
- }
-
- return TRUE;
-}
-
/* Make sure we emit a GOT entry if the symbol was supposed to have a PLT
entry but we found we will not create any. Called when we find we will
not have any PLT for this symbol, by for example
@@ -4127,7 +3947,6 @@ const struct elf_size_info s390_elf64_size_info =
#define elf_backend_finish_dynamic_sections elf_s390_finish_dynamic_sections
#define elf_backend_finish_dynamic_symbol elf_s390_finish_dynamic_symbol
#define elf_backend_gc_mark_hook elf_s390_gc_mark_hook
-#define elf_backend_gc_sweep_hook elf_s390_gc_sweep_hook
#define elf_backend_reloc_type_class elf_s390_reloc_type_class
#define elf_backend_relocate_section elf_s390_relocate_section
#define elf_backend_size_dynamic_sections elf_s390_size_dynamic_sections