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

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=456481c6d634819b713eb88fc629a09b4e955aa3

commit 456481c6d634819b713eb88fc629a09b4e955aa3
Author: Alan Modra <amodra@gmail.com>
Date:   Thu Feb 23 12:54:09 2023 +1030

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

Diff:
---
 bfd/dwarf1.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

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;

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

only message in thread, other threads:[~2023-02-23  3:51 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:51 [binutils-gdb] 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).