public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* .debug sections without contents
@ 2023-02-11  6:12 Alan Modra
  0 siblings, 0 replies; only message in thread
From: Alan Modra @ 2023-02-11  6:12 UTC (permalink / raw)
  To: binutils

	* dwarf1.c (_bfd_dwarf1_find_nearest_line): Exclude .debug
	sections without contents.

diff --git a/bfd/dwarf1.c b/bfd/dwarf1.c
index c851f674680..90461004b0a 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.  */

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-02-11  6:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-11  6:12 .debug sections without contents Alan Modra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).