diff options
Diffstat (limited to 'bfd/elf64-ppc.c')
-rw-r--r-- | bfd/elf64-ppc.c | 176 |
1 files changed, 0 insertions, 176 deletions
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c index 3f6bff9..10f895d 100644 --- a/bfd/elf64-ppc.c +++ b/bfd/elf64-ppc.c @@ -104,7 +104,6 @@ static bfd_vma opd_entry_value #define elf_backend_gc_keep ppc64_elf_gc_keep #define elf_backend_gc_mark_dynamic_ref ppc64_elf_gc_mark_dynamic_ref #define elf_backend_gc_mark_hook ppc64_elf_gc_mark_hook -#define elf_backend_gc_sweep_hook ppc64_elf_gc_sweep_hook #define elf_backend_adjust_dynamic_symbol ppc64_elf_adjust_dynamic_symbol #define elf_backend_hide_symbol ppc64_elf_hide_symbol #define elf_backend_maybe_function_sym ppc64_elf_maybe_function_sym @@ -6626,181 +6625,6 @@ ppc64_elf_gc_mark_hook (asection *sec, return rsec; } -/* Update the .got, .plt. and dynamic reloc reference counts for the - section being removed. */ - -static bfd_boolean -ppc64_elf_gc_sweep_hook (bfd *abfd, struct bfd_link_info *info, - asection *sec, const Elf_Internal_Rela *relocs) -{ - struct ppc_link_hash_table *htab; - Elf_Internal_Shdr *symtab_hdr; - struct elf_link_hash_entry **sym_hashes; - struct got_entry **local_got_ents; - const Elf_Internal_Rela *rel, *relend; - - if (bfd_link_relocatable (info)) - return TRUE; - - if ((sec->flags & SEC_ALLOC) == 0) - return TRUE; - - elf_section_data (sec)->local_dynrel = NULL; - - htab = ppc_hash_table (info); - if (htab == NULL) - return FALSE; - - symtab_hdr = &elf_symtab_hdr (abfd); - sym_hashes = elf_sym_hashes (abfd); - local_got_ents = elf_local_got_ents (abfd); - - relend = relocs + sec->reloc_count; - for (rel = relocs; rel < relend; rel++) - { - unsigned long r_symndx; - enum elf_ppc64_reloc_type r_type; - struct elf_link_hash_entry *h = NULL; - struct plt_entry **plt_list = NULL; - unsigned char tls_type = 0; - - r_symndx = ELF64_R_SYM (rel->r_info); - r_type = ELF64_R_TYPE (rel->r_info); - if (r_symndx >= symtab_hdr->sh_info) - { - struct ppc_link_hash_entry *eh; - struct elf_dyn_relocs **pp; - struct elf_dyn_relocs *p; - - h = sym_hashes[r_symndx - symtab_hdr->sh_info]; - h = elf_follow_link (h); - eh = (struct ppc_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; - } - } - - switch (r_type) - { - case R_PPC64_GOT_TLSLD16: - case R_PPC64_GOT_TLSLD16_LO: - case R_PPC64_GOT_TLSLD16_HI: - case R_PPC64_GOT_TLSLD16_HA: - tls_type = TLS_TLS | TLS_LD; - goto dogot; - - case R_PPC64_GOT_TLSGD16: - case R_PPC64_GOT_TLSGD16_LO: - case R_PPC64_GOT_TLSGD16_HI: - case R_PPC64_GOT_TLSGD16_HA: - tls_type = TLS_TLS | TLS_GD; - goto dogot; - - case R_PPC64_GOT_TPREL16_DS: - case R_PPC64_GOT_TPREL16_LO_DS: - case R_PPC64_GOT_TPREL16_HI: - case R_PPC64_GOT_TPREL16_HA: - tls_type = TLS_TLS | TLS_TPREL; - goto dogot; - - case R_PPC64_GOT_DTPREL16_DS: - case R_PPC64_GOT_DTPREL16_LO_DS: - case R_PPC64_GOT_DTPREL16_HI: - case R_PPC64_GOT_DTPREL16_HA: - tls_type = TLS_TLS | TLS_DTPREL; - goto dogot; - - case R_PPC64_GOT16: - case R_PPC64_GOT16_DS: - case R_PPC64_GOT16_HA: - case R_PPC64_GOT16_HI: - case R_PPC64_GOT16_LO: - case R_PPC64_GOT16_LO_DS: - dogot: - { - struct got_entry *ent; - - if (h != NULL) - ent = h->got.glist; - else - ent = local_got_ents[r_symndx]; - - for (; ent != NULL; ent = ent->next) - if (ent->addend == rel->r_addend - && ent->owner == abfd - && ent->tls_type == tls_type) - break; - if (ent == NULL) - abort (); - if (ent->got.refcount > 0) - ent->got.refcount -= 1; - } - if (h != NULL && !bfd_link_pic (info) && abiversion (abfd) != 1) - plt_list = &h->plt.plist; - break; - - case R_PPC64_PLT16_HA: - case R_PPC64_PLT16_HI: - case R_PPC64_PLT16_LO: - case R_PPC64_PLT32: - case R_PPC64_PLT64: - case R_PPC64_REL14: - case R_PPC64_REL14_BRNTAKEN: - case R_PPC64_REL14_BRTAKEN: - case R_PPC64_REL24: - if (h != NULL) - plt_list = &h->plt.plist; - else if (local_got_ents != NULL) - { - struct plt_entry **local_plt = (struct plt_entry **) - (local_got_ents + symtab_hdr->sh_info); - unsigned char *local_got_tls_masks = (unsigned char *) - (local_plt + symtab_hdr->sh_info); - if ((local_got_tls_masks[r_symndx] & PLT_IFUNC) != 0) - plt_list = local_plt + r_symndx; - } - break; - - case R_PPC64_ADDR64: - case R_PPC64_ADDR16: - case R_PPC64_ADDR16_DS: - case R_PPC64_ADDR16_HA: - case R_PPC64_ADDR16_HI: - case R_PPC64_ADDR16_HIGH: - case R_PPC64_ADDR16_HIGHA: - case R_PPC64_ADDR16_HIGHER: - case R_PPC64_ADDR16_HIGHERA: - case R_PPC64_ADDR16_HIGHEST: - case R_PPC64_ADDR16_HIGHESTA: - case R_PPC64_ADDR16_LO: - case R_PPC64_ADDR16_LO_DS: - if (h != NULL && !bfd_link_pic (info) && abiversion (abfd) != 1 - && rel->r_addend == 0) - plt_list = &h->plt.plist; - break; - - default: - break; - } - if (plt_list != NULL) - { - struct plt_entry *ent; - - for (ent = *plt_list; ent != NULL; ent = ent->next) - if (ent->addend == rel->r_addend) - break; - if (ent != NULL && ent->plt.refcount > 0) - ent->plt.refcount -= 1; - } - } - return TRUE; -} - /* The maximum size of .sfpr. */ #define SFPR_MAX (218*4) |