diff options
author | Alan Modra <amodra@gmail.com> | 2005-06-09 02:02:18 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2005-06-09 02:02:18 +0000 |
commit | 0e58fcf31568ed177c553ab05d95a31467173129 (patch) | |
tree | 7c70c256148107eb659165040ecc2822d63f61c6 /bfd/elflink.c | |
parent | 8f736feabda89768501fa9d2cc04328e2a578883 (diff) | |
download | gdb-0e58fcf31568ed177c553ab05d95a31467173129.zip gdb-0e58fcf31568ed177c553ab05d95a31467173129.tar.gz gdb-0e58fcf31568ed177c553ab05d95a31467173129.tar.bz2 |
* elflink.c (elf_mark_used_section): Delete.
(bfd_elf_gc_sections): Call bfd_generic_gc_sections.
* reloc.c (bfd_mark_used_section): New function.
(bfd_generic_gc_sections): Call bfd_mark_used_section.
Diffstat (limited to 'bfd/elflink.c')
-rw-r--r-- | bfd/elflink.c | 31 |
1 files changed, 1 insertions, 30 deletions
diff --git a/bfd/elflink.c b/bfd/elflink.c index 5dd5138..d90be1c 100644 --- a/bfd/elflink.c +++ b/bfd/elflink.c @@ -9067,27 +9067,6 @@ elf_gc_mark_dynamic_ref_symbol (struct elf_link_hash_entry *h, return TRUE; } -/* Mark sections containing global symbols. This is called through - elf_link_hash_traverse. */ - -static bfd_boolean -elf_mark_used_section (struct elf_link_hash_entry *h, - void *data ATTRIBUTE_UNUSED) -{ - if (h->root.type == bfd_link_hash_warning) - h = (struct elf_link_hash_entry *) h->root.u.i.link; - - if (h->root.type == bfd_link_hash_defined - || h->root.type == bfd_link_hash_defweak) - { - asection *s = h->root.u.def.section; - if (s != NULL && s->output_section != NULL) - s->output_section->flags |= SEC_KEEP; - } - - return TRUE; -} - /* Do mark and sweep of unused sections. */ bfd_boolean @@ -9100,15 +9079,7 @@ bfd_elf_gc_sections (bfd *abfd, struct bfd_link_info *info) struct elf_link_hash_entry *h, Elf_Internal_Sym *); if (!info->gc_sections) - { - /* If we are called when info->gc_sections is 0, we will mark - all sections containing global symbols for non-relocatable - link. */ - if (!info->relocatable) - elf_link_hash_traverse (elf_hash_table (info), - elf_mark_used_section, NULL); - return TRUE; - } + return bfd_generic_gc_sections (abfd, info); if (!get_elf_backend_data (abfd)->can_gc_sections || info->relocatable |