diff options
author | Egeyar Bagcioglu <egeyar.bagcioglu@oracle.com> | 2018-10-03 23:27:32 +0200 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2018-10-09 17:36:59 +1030 |
commit | 1c2649ed7481881cb963bb53251a79bfb8b1047e (patch) | |
tree | 689ba6603b120b942911b3d467a22d9eeb9c4dcb /bfd | |
parent | 35dc7e6b77c6d379dda8072e9f0b88a24c008d06 (diff) | |
download | gdb-1c2649ed7481881cb963bb53251a79bfb8b1047e.zip gdb-1c2649ed7481881cb963bb53251a79bfb8b1047e.tar.gz gdb-1c2649ed7481881cb963bb53251a79bfb8b1047e.tar.bz2 |
Do not place symbols into a discarded .dynsym
Prevents getting an error about dynamic symbols in sections indexed
64K+ when .dynsym is discarded.
* elflink.c (elf_link_output_extsym): Do not place symbols into a
discarded .dynsym.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 5 | ||||
-rw-r--r-- | bfd/elflink.c | 7 |
2 files changed, 9 insertions, 3 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 86387d8..68c1ff6 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2018-10-09 Egeyar Bagcioglu <egeyar.bagcioglu@oracle.com> + + * elflink.c (elf_link_output_extsym): Do not place symbols into a + discarded .dynsym. + 2018-10-08 H.J. Lu <hongjiu.lu@intel.com> PR ld/23428 diff --git a/bfd/elflink.c b/bfd/elflink.c index 02618be..78d8c54 100644 --- a/bfd/elflink.c +++ b/bfd/elflink.c @@ -10024,9 +10024,10 @@ elf_link_output_extsym (struct bfd_hash_entry *bh, void *data) /* If this symbol should be put in the .dynsym section, then put it there now. We already know the symbol index. We also fill in the entry in the .hash section. */ - if (elf_hash_table (flinfo->info)->dynsym != NULL - && h->dynindx != -1 - && elf_hash_table (flinfo->info)->dynamic_sections_created) + if (h->dynindx != -1 + && elf_hash_table (flinfo->info)->dynamic_sections_created + && elf_hash_table (flinfo->info)->dynsym != NULL + && !discarded_section (elf_hash_table (flinfo->info)->dynsym)) { bfd_byte *esym; |