dwarf1 .line SEC_HAS_CONTENTS

Message ID Y/bii4z1P2p0EwAC@squeak.grove.modra.org
State Repeat Merge
Headers
Series dwarf1 .line SEC_HAS_CONTENTS |

Checks

Context Check Description
snail/binutils-gdb-check warning Git am fail log

Commit Message

Alan Modra Feb. 23, 2023, 3:50 a.m. UTC
  * dwarf1.c (parse_line_table): Ignore .line without SEC_HAS_CONTENTS.
	Formatting.
  

Patch

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;