dwarf1 .line SEC_HAS_CONTENTS
authorAlan Modra <amodra@gmail.com>
Thu, 23 Feb 2023 02:24:09 +0000 (12:54 +1030)
committerAlan Modra <amodra@gmail.com>
Thu, 23 Feb 2023 02:28:53 +0000 (12:58 +1030)
* dwarf1.c (parse_line_table): Ignore .line without SEC_HAS_CONTENTS.
Formatting.

bfd/dwarf1.c

index 90461004b0a546466a70d89d25fcb7229489d48f..a80d19db7def118610a733673b7314f7209677f1 100644 (file)
@@ -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;