summaryrefslogtreecommitdiff
path: root/bfd/dwarf2.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2017-04-23 13:55:49 +0930
committerAlan Modra <amodra@gmail.com>2017-04-23 20:33:13 +0930
commit97e83a100aa8250be783304bfe0429761c6e6b6b (patch)
tree6dec46c77d291dab23612e3dbd78899693fc0941 /bfd/dwarf2.c
parentf082820db966c79e47a143da774700055a1fad41 (diff)
PR 21409, segfault in _bfd_dwarf2_find_nearest_line
PR 21409 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Don't segfault when no symbols.
Diffstat (limited to 'bfd/dwarf2.c')
-rw-r--r--bfd/dwarf2.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/bfd/dwarf2.c b/bfd/dwarf2.c
index 132a67492a..0ef3e1fc53 100644
--- a/bfd/dwarf2.c
+++ b/bfd/dwarf2.c
@@ -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;