.debug sections without contents

* dwarf1.c (_bfd_dwarf1_find_nearest_line): Exclude .debug
	sections without contents.
This commit is contained in:
Alan Modra
2023-02-10 23:16:34 +10:30
parent 8cc96ee416
commit 480ddaa978

View File

@@ -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. */