diff options
author | Alan Modra <amodra@gmail.com> | 2019-05-27 09:38:42 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2019-05-27 13:56:28 +0930 |
commit | 3d7d6a6ff4678685f86976f08ab4c9c639e262e1 (patch) | |
tree | d3b5ce6d4a5e6502170e32affe05d38abbb26049 /ld/emultempl | |
parent | Automatic date update in version.in (diff) | |
download | binutils-gdb-3d7d6a6ff4678685f86976f08ab4c9c639e262e1.tar.gz binutils-gdb-3d7d6a6ff4678685f86976f08ab4c9c639e262e1.tar.bz2 binutils-gdb-3d7d6a6ff4678685f86976f08ab4c9c639e262e1.zip |
Generic ELF target group signature symbol
Even though the generic ELF target doesn't handle groups correctly,
this helps avoid a segfault in bfd_elf_set_group_contents seen on
d30v-elf, dlx-elf, pj-elf, and xgate-elf when linking the pr22836
testcase.
PR 24596
bfd/
* linker.c (_bfd_generic_link_output_symbols): Heed BSF_KEEP.
ld/
* emultempl/genelf.em (gld${EMULATION_NAME}_after_open): Set
BFS_KEEP on group signature symbol.
Diffstat (limited to 'ld/emultempl')
-rw-r--r-- | ld/emultempl/genelf.em | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ld/emultempl/genelf.em b/ld/emultempl/genelf.em index 472f701dbe9..664a5b1804a 100644 --- a/ld/emultempl/genelf.em +++ b/ld/emultempl/genelf.em @@ -45,7 +45,9 @@ gld${EMULATION_NAME}_after_open (void) if ((sec->flags & (SEC_GROUP | SEC_LINKER_CREATED)) == SEC_GROUP) { struct bfd_elf_section_data *sec_data = elf_section_data (sec); - elf_group_id (sec) = syms[sec_data->this_hdr.sh_info - 1]; + struct bfd_symbol *sym = syms[sec_data->this_hdr.sh_info - 1]; + elf_group_id (sec) = sym; + sym->flags |= BSF_KEEP; } } |