This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] give .comment sections SHF_MERGE|SHF_STRINGS


The compiler-generated .ident strings linked together tend all to be the
same, resulting in giant .comment sections with a duplicate string for each
translation unit.  We have the technology.  We can make them smaller, faster,
better than before.

This looks obviously trivial and safe.  But I can't be bothered to actually
test it or anything.  Anyone inspired?


Thanks,
Roland


2009-07-24  Roland McGrath  <roland@frob.com>

	* config/obj-elf.c (obj_elf_ident): Set SEC_MERGE | SEC_STRINGS
	flags on .comment section.

Index: gas/config/obj-elf.c
===================================================================
RCS file: /cvs/src/src/gas/config/obj-elf.c,v
retrieving revision 1.115
diff -u -r1.115 obj-elf.c
--- gas/config/obj-elf.c	23 Jul 2009 13:00:27 -0000	1.115
+++ gas/config/obj-elf.c	24 Jul 2009 19:01:23 -0000
@@ -1723,7 +1723,8 @@
       char *p;
       comment_section = subseg_new (".comment", 0);
       bfd_set_section_flags (stdoutput, comment_section,
-			     SEC_READONLY | SEC_HAS_CONTENTS);
+			     SEC_READONLY | SEC_HAS_CONTENTS
+			     | SEC_MERGE | SEC_STRINGS);
       p = frag_more (1);
       *p = 0;
     }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]