This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH] give .comment sections SHF_MERGE|SHF_STRINGS
- From: Roland McGrath <roland at redhat dot com>
- To: binutils at sources dot redhat dot com
- Cc: Andreas Schwab <schwab at redhat dot com>, Nick Clifton <nickc at redhat dot com>
- Date: Fri, 24 Jul 2009 12:08:34 -0700 (PDT)
- Subject: [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;
}