mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-18 16:53:50 +08:00
Don't segfault on discarded section dynsyms
We get lots of errors before we get to this code, but let's not segfault. * elflink.c (bfd_elf_final_link): Don't segfault on local dynsyms defined in excluded sections.
This commit is contained in:
@ -1,3 +1,8 @@
|
|||||||
|
2020-07-29 Alan Modra <amodra@gmail.com>
|
||||||
|
|
||||||
|
* elflink.c (bfd_elf_final_link): Don't segfault on local dynsyms
|
||||||
|
defined in excluded sections.
|
||||||
|
|
||||||
2020-07-28 Alan Modra <amodra@gmail.com>
|
2020-07-28 Alan Modra <amodra@gmail.com>
|
||||||
|
|
||||||
* elf.c (assign_section_numbers): Comment. Don't segfault on
|
* elf.c (assign_section_numbers): Comment. Don't segfault on
|
||||||
|
@ -12599,10 +12599,13 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info)
|
|||||||
the original st_name with the dynstr_index. */
|
the original st_name with the dynstr_index. */
|
||||||
sym = e->isym;
|
sym = e->isym;
|
||||||
sym.st_other &= ~ELF_ST_VISIBILITY (-1);
|
sym.st_other &= ~ELF_ST_VISIBILITY (-1);
|
||||||
|
sym.st_shndx = SHN_UNDEF;
|
||||||
|
|
||||||
s = bfd_section_from_elf_index (e->input_bfd,
|
s = bfd_section_from_elf_index (e->input_bfd,
|
||||||
e->isym.st_shndx);
|
e->isym.st_shndx);
|
||||||
if (s != NULL)
|
if (s != NULL
|
||||||
|
&& s->output_section != NULL
|
||||||
|
&& elf_section_data (s->output_section) != NULL)
|
||||||
{
|
{
|
||||||
sym.st_shndx =
|
sym.st_shndx =
|
||||||
elf_section_data (s->output_section)->this_idx;
|
elf_section_data (s->output_section)->this_idx;
|
||||||
|
Reference in New Issue
Block a user