aboutsummaryrefslogtreecommitdiff
path: root/bfd/elflink.c
diff options
context:
space:
mode:
Diffstat (limited to 'bfd/elflink.c')
-rw-r--r--bfd/elflink.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/bfd/elflink.c b/bfd/elflink.c
index c80ee82..658e584 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -12154,6 +12154,7 @@ bfd_elf_gc_sections (bfd *abfd, struct bfd_link_info *info)
bfd *sub;
elf_gc_mark_hook_fn gc_mark_hook;
const struct elf_backend_data *bed = get_elf_backend_data (abfd);
+ struct elf_link_hash_table *htab;
if (!bed->can_gc_sections
|| !is_elf_hash_table (info->hash))
@@ -12163,10 +12164,10 @@ bfd_elf_gc_sections (bfd *abfd, struct bfd_link_info *info)
}
bed->gc_keep (info);
+ htab = elf_hash_table (info);
/* Try to parse each bfd's .eh_frame section. Point elf_eh_frame_section
at the .eh_frame section if we can mark the FDEs individually. */
- _bfd_elf_begin_eh_frame_parsing (info);
for (sub = info->input_bfds; sub != NULL; sub = sub->link.next)
{
asection *sec;
@@ -12183,27 +12184,20 @@ bfd_elf_gc_sections (bfd *abfd, struct bfd_link_info *info)
sec = bfd_get_next_section_by_name (sec);
}
}
- _bfd_elf_end_eh_frame_parsing (info);
/* Apply transitive closure to the vtable entry usage info. */
- elf_link_hash_traverse (elf_hash_table (info),
- elf_gc_propagate_vtable_entries_used,
- &ok);
+ elf_link_hash_traverse (htab, elf_gc_propagate_vtable_entries_used, &ok);
if (!ok)
return FALSE;
/* Kill the vtable relocations that were not used. */
- elf_link_hash_traverse (elf_hash_table (info),
- elf_gc_smash_unused_vtentry_relocs,
- &ok);
+ elf_link_hash_traverse (htab, elf_gc_smash_unused_vtentry_relocs, &ok);
if (!ok)
return FALSE;
/* Mark dynamically referenced symbols. */
- if (elf_hash_table (info)->dynamic_sections_created)
- elf_link_hash_traverse (elf_hash_table (info),
- bed->gc_mark_dynamic_ref,
- info);
+ if (htab->dynamic_sections_created)
+ elf_link_hash_traverse (htab, bed->gc_mark_dynamic_ref, info);
/* Grovel through relocs to find out who stays ... */
gc_mark_hook = bed->gc_mark_hook;
@@ -12682,7 +12676,6 @@ bfd_elf_discard_info (bfd *output_bfd, struct bfd_link_info *info)
{
asection *i;
- _bfd_elf_begin_eh_frame_parsing (info);
for (i = o->map_head.s; i != NULL; i = i->map_head.s)
{
if (i->size == 0)
@@ -12703,7 +12696,6 @@ bfd_elf_discard_info (bfd *output_bfd, struct bfd_link_info *info)
fini_reloc_cookie_for_section (&cookie, i);
}
- _bfd_elf_end_eh_frame_parsing (info);
}
for (abfd = info->input_bfds; abfd != NULL; abfd = abfd->link.next)