]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
string merge section map output
authorAlan Modra <amodra@gmail.com>
Wed, 23 Apr 2025 01:20:18 +0000 (10:50 +0930)
committerAlan Modra <amodra@gmail.com>
Wed, 23 Apr 2025 03:03:46 +0000 (12:33 +0930)
This fixes an inconsistency in the linker map file, where string merge
sections (other than the first) kept their sizes.  String merge
sections of like entsize all are accounted in the fisrt string merge
section size.

* ldlang.c (print_input_section): Print SEC_EXCLUDE section size
as zero.

ld/ldlang.c

index 0bb9e17d92798527da071cc93ff6098137aef0f1..97fdb91da33ff463ff7293de9413c484716360b4 100644 (file)
@@ -5062,7 +5062,8 @@ print_input_section (asection *i, bool is_discarded)
     }
   print_spaces (SECTION_NAME_MAP_LENGTH - len);
 
-  if (i->output_section != NULL
+  if ((i->flags & SEC_EXCLUDE) == 0
+      && i->output_section != NULL
       && i->output_section->owner == link_info.output_bfd)
     addr = i->output_section->vma + i->output_offset;
   else