PR24339, segfault on NULL symbol section

PR 24339
	* elflink.c (elf_link_add_object_symbols): Bail out on a local
	symbol after globals if elf_bad_symtab is not set.
This commit is contained in:
Alan Modra 2019-03-15 16:49:59 +10:30
parent 1ff31e135f
commit fe3fef62ad
2 changed files with 13 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2019-03-15 Alan Modra <amodra@gmail.com>
PR 24339
* elflink.c (elf_link_add_object_symbols): Bail out on a local
symbol after globals if elf_bad_symtab is not set.
2019-03-15 Alan Modra <amodra@gmail.com>
PR 24337

View File

@ -4442,7 +4442,13 @@ error_free_dyn:
global symbols follow all local symbols, and that sh_info
point to the first global symbol. Unfortunately, Irix 5
screws this up. */
continue;
if (elf_bad_symtab (abfd))
continue;
/* If we aren't prepared to handle locals within the globals
then we'll likely segfault on a NULL section. */
bfd_set_error (bfd_error_bad_value);
goto error_free_vers;
case STB_GLOBAL:
if (isym->st_shndx != SHN_UNDEF && !common)