-/* Update the got entry reference counts for the section being removed. */
-
-static bfd_boolean
-elf_vax_gc_sweep_hook (bfd *abfd, struct bfd_link_info *info, asection *sec,
- const Elf_Internal_Rela *relocs)
-{
- Elf_Internal_Shdr *symtab_hdr;
- struct elf_link_hash_entry **sym_hashes;
- const Elf_Internal_Rela *rel, *relend;
- bfd *dynobj;
-
- if (bfd_link_relocatable (info))
- return TRUE;
-
- dynobj = elf_hash_table (info)->dynobj;
- if (dynobj == NULL)
- return TRUE;
-
- symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
- sym_hashes = elf_sym_hashes (abfd);
-
- relend = relocs + sec->reloc_count;
- for (rel = relocs; rel < relend; rel++)
- {
- unsigned long r_symndx;
- struct elf_link_hash_entry *h = NULL;
-
- r_symndx = ELF32_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;
- }
-
- switch (ELF32_R_TYPE (rel->r_info))
- {
- case R_VAX_GOT32:
- if (h != NULL && h->got.refcount > 0)
- --h->got.refcount;
- break;
-
- case R_VAX_PLT32:
- case R_VAX_PC8:
- case R_VAX_PC16:
- case R_VAX_PC32:
- case R_VAX_8:
- case R_VAX_16:
- case R_VAX_32:
- if (h != NULL && h->plt.refcount > 0)
- --h->plt.refcount;
- break;
-
- default:
- break;
- }
- }
-
- return TRUE;
-}
-