-/* Update the got entry reference counts for the section being removed. */
-
-static bfd_boolean
-elf64_alpha_gc_sweep_hook (bfd *abfd, struct bfd_link_info *info,
- asection *sec, const Elf_Internal_Rela *relocs)
-{
- Elf_Internal_Shdr *symtab_hdr;
- struct alpha_elf_link_hash_entry **sym_hashes;
- const Elf_Internal_Rela *rel, *relend;
-
- if (info->relocatable)
- return TRUE;
-
- symtab_hdr = &elf_symtab_hdr (abfd);
- sym_hashes = alpha_elf_sym_hashes (abfd);
-
- relend = relocs + sec->reloc_count;
- for (rel = relocs; rel < relend; rel++)
- {
- unsigned long r_symndx, r_type;
- struct alpha_elf_link_hash_entry *h = NULL;
- struct alpha_elf_got_entry *gotent;
-
- r_symndx = ELF64_R_SYM (rel->r_info);
- if (r_symndx >= symtab_hdr->sh_info)
- {
- h = sym_hashes[r_symndx - symtab_hdr->sh_info];
- while (h->root.root.type == bfd_link_hash_indirect
- || h->root.root.type == bfd_link_hash_warning)
- h = (struct alpha_elf_link_hash_entry *) h->root.root.u.i.link;
- }
-
- r_type = ELF64_R_TYPE (rel->r_info);
- switch (r_type)
- {
- case R_ALPHA_LITERAL:
- /* ??? Ignore re-computation of gotent_flags. We're not
- carrying a use-count for each bit in that mask. */
-
- case R_ALPHA_TLSGD:
- case R_ALPHA_GOTDTPREL:
- case R_ALPHA_GOTTPREL:
- /* Fetch the got entry from the tables. */
- gotent = get_got_entry (abfd, h, r_type, r_symndx, rel->r_addend);
-
- /* The got entry *must* exist, since we should have created it
- before during check_relocs. Also note that get_got_entry
- assumed this was going to be another use, and so incremented
- the use count again. Thus the use count must be at least the
- one real use and the "use" we just added. */
- if (gotent == NULL || gotent->use_count < 2)
- {
- abort ();
- return FALSE;
- }
- gotent->use_count -= 2;
- break;
-
- default:
- break;
- }
- }
-
- return TRUE;
-}
-