[binutils-gdb] string merge section map output

Alan Modra amodra@sourceware.org
Wed Apr 23 03:04:45 GMT 2025


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

commit 9dd98830e85cf98aafa224e485b3823210a20350
Author: Alan Modra <amodra@gmail.com>
Date:   Wed Apr 23 10:50:18 2025 +0930

    string merge section map output
    
    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.

Diff:
---
 ld/ldlang.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/ld/ldlang.c b/ld/ldlang.c
index 0bb9e17d927..97fdb91da33 100644
--- a/ld/ldlang.c
+++ b/ld/ldlang.c
@@ -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


More information about the Binutils-cvs mailing list