diff options
Diffstat (limited to 'bfd/elfnn-aarch64.c')
-rw-r--r-- | bfd/elfnn-aarch64.c | 177 |
1 files changed, 0 insertions, 177 deletions
diff --git a/bfd/elfnn-aarch64.c b/bfd/elfnn-aarch64.c index 3083f3b..23c881c 100644 --- a/bfd/elfnn-aarch64.c +++ b/bfd/elfnn-aarch64.c @@ -6693,180 +6693,6 @@ elfNN_aarch64_print_private_bfd_data (bfd *abfd, void *ptr) return TRUE; } -/* Update the got entry reference counts for the section being removed. */ - -static bfd_boolean -elfNN_aarch64_gc_sweep_hook (bfd *abfd, - struct bfd_link_info *info, - asection *sec, - const Elf_Internal_Rela * relocs) -{ - struct elf_aarch64_link_hash_table *htab; - Elf_Internal_Shdr *symtab_hdr; - struct elf_link_hash_entry **sym_hashes; - struct elf_aarch64_local_symbol *locals; - const Elf_Internal_Rela *rel, *relend; - - if (bfd_link_relocatable (info)) - return TRUE; - - htab = elf_aarch64_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); - - locals = elf_aarch64_locals (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 = ELFNN_R_SYM (rel->r_info); - - if (r_symndx >= symtab_hdr->sh_info) - { - - 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; - } - else - { - Elf_Internal_Sym *isym; - - /* A local symbol. */ - isym = bfd_sym_from_r_symndx (&htab->sym_cache, - abfd, r_symndx); - - /* Check relocation against local STT_GNU_IFUNC symbol. */ - if (isym != NULL - && ELF_ST_TYPE (isym->st_info) == STT_GNU_IFUNC) - { - h = elfNN_aarch64_get_local_sym_hash (htab, abfd, rel, FALSE); - if (h == NULL) - abort (); - } - } - - if (h) - { - struct elf_aarch64_link_hash_entry *eh; - struct elf_dyn_relocs **pp; - struct elf_dyn_relocs *p; - - eh = (struct elf_aarch64_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 = ELFNN_R_TYPE (rel->r_info); - switch (aarch64_tls_transition (abfd,info, r_type, h ,r_symndx)) - { - case BFD_RELOC_AARCH64_ADR_GOT_PAGE: - case BFD_RELOC_AARCH64_GOT_LD_PREL19: - case BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14: - case BFD_RELOC_AARCH64_LD32_GOT_LO12_NC: - case BFD_RELOC_AARCH64_LD64_GOTOFF_LO15: - case BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15: - case BFD_RELOC_AARCH64_LD64_GOT_LO12_NC: - case BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC: - case BFD_RELOC_AARCH64_MOVW_GOTOFF_G1: - case BFD_RELOC_AARCH64_TLSDESC_ADD_LO12: - case BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE21: - case BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21: - case BFD_RELOC_AARCH64_TLSDESC_LD32_LO12_NC: - case BFD_RELOC_AARCH64_TLSDESC_LD64_LO12: - case BFD_RELOC_AARCH64_TLSDESC_LD_PREL19: - case BFD_RELOC_AARCH64_TLSDESC_OFF_G0_NC: - case BFD_RELOC_AARCH64_TLSDESC_OFF_G1: - case BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC: - case BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21: - case BFD_RELOC_AARCH64_TLSGD_ADR_PREL21: - case BFD_RELOC_AARCH64_TLSGD_MOVW_G0_NC: - case BFD_RELOC_AARCH64_TLSGD_MOVW_G1: - case BFD_RELOC_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21: - case BFD_RELOC_AARCH64_TLSIE_LD32_GOTTPREL_LO12_NC: - case BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC: - case BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19: - case BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC: - case BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G1: - case BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC: - case BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21: - case BFD_RELOC_AARCH64_TLSLD_ADR_PREL21: - if (h != NULL) - { - if (h->got.refcount > 0) - h->got.refcount -= 1; - - if (h->type == STT_GNU_IFUNC) - { - if (h->plt.refcount > 0) - h->plt.refcount -= 1; - } - } - else if (locals != NULL) - { - if (locals[r_symndx].got_refcount > 0) - locals[r_symndx].got_refcount -= 1; - } - break; - - case BFD_RELOC_AARCH64_CALL26: - case BFD_RELOC_AARCH64_JUMP26: - /* If this is a local symbol then we resolve it - directly without creating a PLT entry. */ - if (h == NULL) - continue; - - if (h->plt.refcount > 0) - h->plt.refcount -= 1; - break; - - case BFD_RELOC_AARCH64_ADD_LO12: - case BFD_RELOC_AARCH64_ADR_HI21_NC_PCREL: - case BFD_RELOC_AARCH64_ADR_HI21_PCREL: - case BFD_RELOC_AARCH64_ADR_LO21_PCREL: - case BFD_RELOC_AARCH64_LDST128_LO12: - case BFD_RELOC_AARCH64_LDST16_LO12: - case BFD_RELOC_AARCH64_LDST32_LO12: - case BFD_RELOC_AARCH64_LDST64_LO12: - case BFD_RELOC_AARCH64_LDST8_LO12: - case BFD_RELOC_AARCH64_LD_LO19_PCREL: - case BFD_RELOC_AARCH64_MOVW_G0_NC: - case BFD_RELOC_AARCH64_MOVW_G1_NC: - case BFD_RELOC_AARCH64_MOVW_G2_NC: - case BFD_RELOC_AARCH64_MOVW_G3: - case BFD_RELOC_AARCH64_NN: - if (h != NULL && !bfd_link_pic (info)) - { - if (h->plt.refcount > 0) - h->plt.refcount -= 1; - } - break; - - default: - break; - } - } - - return TRUE; -} - /* Return true if we need copy relocation against EH. */ static bfd_boolean @@ -9498,9 +9324,6 @@ const struct elf_size_info elfNN_aarch64_size_info = #define elf_backend_finish_dynamic_symbol \ elfNN_aarch64_finish_dynamic_symbol -#define elf_backend_gc_sweep_hook \ - elfNN_aarch64_gc_sweep_hook - #define elf_backend_object_p \ elfNN_aarch64_object_p |