Don't attach linker created section to --just-syms bfd
authorAlan Modra <amodra@gmail.com>
Sun, 25 Jun 2017 23:40:22 +0000 (09:10 +0930)
committerAlan Modra <amodra@gmail.com>
Sun, 25 Jun 2017 23:40:22 +0000 (09:10 +0930)
commit57963c05b9911c3555add356a7cd9952d391dfe4
tree2a15f546eac184b349e54b5a30cd4875cda2b2ac
parentcc75e0fdaeb179efc66ddd1cb1b6da40e6adacc1
Don't attach linker created section to --just-syms bfd

All sections on a --just-syms bfd are discarded from the output, so
attaching linker created sections to such a bfd results in errors.
In other cases, like the .note.GNU-stack check, it's wrong to have a
--just-syms object potentially affect the output.

bfd/
* elflink.c (_bfd_elf_link_create_dynstrtab): Don't make dynobj
a --just-syms bfd.
(_bfd_elf_size_group_sections): Skip --just-syms bfds.
(bfd_elf_size_dynamic_sections): Ignore .note.GNU-stack and
.preinit_array on --just-syms bfds.
(_bfd_elf_gc_mark_extra_sections): Skip --just-syms bfds.
(elf_gc_sweep, bfd_elf_parse_eh_frame_entries): Likewise.
(bfd_elf_gc_sections, bfd_elf_discard_info): Likewise.
ld/
* emultempl/elf32.em (gld${EMULATION_NAME}_after_open): Skip
--just-syms bfds when looking for a place to attach .note.gnu.build-id
and .eh_frame_hdr sections.  Delete dead code.
bfd/ChangeLog
bfd/elflink.c
ld/ChangeLog
ld/emultempl/elf32.em