1 From 97e83a100aa8250be783304bfe0429761c6e6b6b Mon Sep 17 00:00:00 2001
2 From: Alan Modra <amodra@gmail.com>
3 Date: Sun, 23 Apr 2017 13:55:49 +0930
4 Subject: [PATCH] PR 21409, segfault in _bfd_dwarf2_find_nearest_line
7 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Don't segfault when
11 Upstream-Status: Accepted
13 Signed-off-by: Fan Xin <fan.xin@jp.fujitsu.com>
16 1 files changed, 1 insertions(+), 1 deletion(-)
18 diff --git a/bfd/dwarf2.c b/bfd/dwarf2.c
19 index 132a674..0ef3e1f 100644
22 @@ -4205,7 +4205,7 @@ _bfd_dwarf2_find_nearest_line (bfd *abfd,
23 looking up the function by section + offset uses the
24 DW_AT_decl_line from the function DW_TAG_subprogram for the line,
25 which will be the line of the function name. */
26 - if ((section->flags & SEC_CODE) == 0)
27 + if (symbols != NULL && (section->flags & SEC_CODE) == 0)