public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* dwarf1 .line SEC_HAS_CONTENTS
@ 2023-02-23  3:50 Alan Modra
  0 siblings, 0 replies; only message in thread
From: Alan Modra @ 2023-02-23  3:50 UTC (permalink / raw)
  To: binutils

	* dwarf1.c (parse_line_table): Ignore .line without SEC_HAS_CONTENTS.
	Formatting.

diff --git a/bfd/dwarf1.c b/bfd/dwarf1.c
index 90461004b0a..a80d19db7de 100644
--- a/bfd/dwarf1.c
+++ b/bfd/dwarf1.c
@@ -301,13 +301,13 @@ parse_line_table (struct dwarf1_debug* stash, struct dwarf1_unit* aUnit)
       bfd_size_type size;
 
       msec = bfd_get_section_by_name (stash->abfd, ".line");
-      if (! msec)
+      if (! msec || (msec->flags & SEC_HAS_CONTENTS) == 0)
 	return false;
 
       size = msec->rawsize ? msec->rawsize : msec->size;
       stash->line_section
-	= bfd_simple_get_relocated_section_contents
-	(stash->abfd, msec, NULL, stash->syms);
+	= bfd_simple_get_relocated_section_contents (stash->abfd, msec, NULL,
+						     stash->syms);
 
       if (! stash->line_section)
 	return false;

-- 
Alan Modra
Australia Development Lab, IBM

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

only message in thread, other threads:[~2023-02-23  3:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-23  3:50 dwarf1 .line SEC_HAS_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).