PR 21409, segfault in _bfd_dwarf2_find_nearest_line

PR 21409
	* dwarf2.c (_bfd_dwarf2_find_nearest_line): Don't segfault when
	no symbols.
This commit is contained in:
Alan Modra 2017-04-23 13:55:49 +09:30
parent f082820db9
commit 97e83a100a
2 changed files with 7 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2017-04-23 Alan Modra <amodra@gmail.com>
PR 21409
* dwarf2.c (_bfd_dwarf2_find_nearest_line): Don't segfault when
no symbols.
2017-04-21 H.J. Lu <hongjiu.lu@intel.com>
PR ld/21402

View File

@ -4205,7 +4205,7 @@ _bfd_dwarf2_find_nearest_line (bfd *abfd,
looking up the function by section + offset uses the
DW_AT_decl_line from the function DW_TAG_subprogram for the line,
which will be the line of the function name. */
if ((section->flags & SEC_CODE) == 0)
if (symbols != NULL && (section->flags & SEC_CODE) == 0)
{
asymbol **tmp;