aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2023-02-10 23:16:34 +1030
committerAlan Modra <amodra@gmail.com>2023-02-11 16:41:00 +1030
commit480ddaa9784c652b7c575e17799e0408ac4e5b01 (patch)
treefbc2fc649e1283a00948aa2624ff11f5bc6614b7 /bfd
parent8cc96ee4169f631917d048cbaeec14ddf8ccb90d (diff)
downloadgdb-480ddaa9784c652b7c575e17799e0408ac4e5b01.zip
gdb-480ddaa9784c652b7c575e17799e0408ac4e5b01.tar.gz
gdb-480ddaa9784c652b7c575e17799e0408ac4e5b01.tar.bz2
.debug sections without contents
* dwarf1.c (_bfd_dwarf1_find_nearest_line): Exclude .debug sections without contents.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/dwarf1.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/bfd/dwarf1.c b/bfd/dwarf1.c
index c851f67..9046100 100644
--- a/bfd/dwarf1.c
+++ b/bfd/dwarf1.c
@@ -510,7 +510,8 @@ _bfd_dwarf1_find_nearest_line (bfd *abfd,
return false;
msec = bfd_get_section_by_name (abfd, ".debug");
- if (! msec)
+ if (! msec
+ || (msec->flags & SEC_HAS_CONTENTS) == 0)
/* No dwarf1 info. Note that at this point the stash
has been allocated, but contains zeros, this lets
future calls to this function fail quicker. */