diff options
author | Alan Modra <amodra@gmail.com> | 2015-01-15 19:07:33 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2015-01-15 23:39:39 +1030 |
commit | ca55926c2fad07fef0e6dce8beb948167990a2e7 (patch) | |
tree | 5bb72aa33060d91909ca6fa668506bce9f414ae7 /bfd | |
parent | 3af8af43f74936bd3c81fe57903327b7cc05a37c (diff) | |
download | gdb-ca55926c2fad07fef0e6dce8beb948167990a2e7.zip gdb-ca55926c2fad07fef0e6dce8beb948167990a2e7.tar.gz gdb-ca55926c2fad07fef0e6dce8beb948167990a2e7.tar.bz2 |
Omit section dynsyms for any linker created section
This is a simplification, and fixes a testcase I had where an empty
powerpc64 .branch_lt section was chosen for the data_index_section
dynamic symbol and thus wasn't removed.
* elflink.c (_bfd_elf_link_omit_section_dynsym): Return true for
any output section matching a linker created dynobj section.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 5 | ||||
-rw-r--r-- | bfd/elflink.c | 14 |
2 files changed, 8 insertions, 11 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 7dbb299..d054282 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,5 +1,10 @@ 2015-01-15 Alan Modra <amodra@gmail.com> + * elflink.c (_bfd_elf_link_omit_section_dynsym): Return true for + any output section matching a linker created dynobj section. + +2015-01-15 Alan Modra <amodra@gmail.com> + PR 17842 * elflink.c (elf_link_output_sym): Assert elf_onesymtab set. (bfd_elf_final_link): Always create a symbol table when emit_relocs. diff --git a/bfd/elflink.c b/bfd/elflink.c index 4378bb2..6e77265 100644 --- a/bfd/elflink.c +++ b/bfd/elflink.c @@ -762,6 +762,7 @@ _bfd_elf_link_omit_section_dynsym (bfd *output_bfd ATTRIBUTE_UNUSED, asection *p) { struct elf_link_hash_table *htab; + asection *ip; switch (elf_section_data (p)->this_hdr.sh_type) { @@ -777,18 +778,9 @@ _bfd_elf_link_omit_section_dynsym (bfd *output_bfd ATTRIBUTE_UNUSED, if (htab->text_index_section != NULL) return p != htab->text_index_section && p != htab->data_index_section; - if (strcmp (p->name, ".got") == 0 - || strcmp (p->name, ".got.plt") == 0 - || strcmp (p->name, ".plt") == 0) - { - asection *ip; - - if (htab->dynobj != NULL + return (htab->dynobj != NULL && (ip = bfd_get_linker_section (htab->dynobj, p->name)) != NULL - && ip->output_section == p) - return TRUE; - } - return FALSE; + && ip->output_section == p); /* There shouldn't be section relative relocations against any other section. */ |