diff options
author | Alan Modra <amodra@gmail.com> | 2023-02-10 23:16:34 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2023-02-11 16:41:00 +1030 |
commit | 480ddaa9784c652b7c575e17799e0408ac4e5b01 (patch) | |
tree | fbc2fc649e1283a00948aa2624ff11f5bc6614b7 | |
parent | 8cc96ee4169f631917d048cbaeec14ddf8ccb90d (diff) | |
download | binutils-480ddaa9784c652b7c575e17799e0408ac4e5b01.zip binutils-480ddaa9784c652b7c575e17799e0408ac4e5b01.tar.gz binutils-480ddaa9784c652b7c575e17799e0408ac4e5b01.tar.bz2 |
.debug sections without contents
* dwarf1.c (_bfd_dwarf1_find_nearest_line): Exclude .debug
sections without contents.
-rw-r--r-- | bfd/dwarf1.c | 3 |
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. */ |