[PATCH] give .comment sections SHF_MERGE|SHF_STRINGS

Cary Coutant ccoutant@google.com
Fri Jul 24 22:35:00 GMT 2009


>> 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?
>
> How about making it comdat?

That would then keep only one string, even if some happened to be
different from the rest -- unless you copy the string itself into the
comdat key, but that would be pretty wasteful. This is what merge
sections are for.

-cary



More information about the Binutils mailing list