PR21910, segfault in common symbol override test when hash-style=gnu

PR 21910
	* elflink.c (bfd_elf_final_link): Don't segfault when sections
	needed to define various dynamic tags have been discarded.
This commit is contained in:
Alan Modra 2017-08-07 18:02:49 +09:30
parent 74cbb09e74
commit b3293efaf8
2 changed files with 7 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2017-08-07 Alan Modra <amodra@gmail.com>
PR 21910
* elflink.c (bfd_elf_final_link): Don't segfault when sections
needed to define various dynamic tags have been discarded.
2017-08-07 Nick Clifton <nickc@redhat.com>
PR 21884

View File

@ -12342,7 +12342,7 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info)
get_vma:
o = bfd_get_linker_section (dynobj, name);
do_vma:
if (o == NULL)
if (o == NULL || bfd_is_abs_section (o->output_section))
{
_bfd_error_handler
(_("could not find section %s"), name);