This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: linker behaviour for sections having flags SHF_MERGE/SHF_STRINGS
Hi Cary,
The testcase ran fine with -O2.
Is there any document, that specifies the optimizations done at each level ?
Thanks
Shankar Easwaran
Ian Lance Taylor-3 wrote:
>
> On Fri, Nov 9, 2012 at 5:40 PM, Cary Coutant <ccoutant@google.com> wrote:
>>>> $gold merge_test.o
>>>> $ readelf -p 2 a.out
>>>>
>>>> String dump of section '.rodata':
>>>> [ 0] abc
>>>> [ 4] c
>>>>
>>>> Question :-
>>>> Why is the difference ?
>>>
>>> Possibly a gold bug.
>>
>> Try running gold with the -O2 option. By default, gold won't do the
>> trailing substring optimization.
>
> And that is because we looked at some very large executables and found
> that it almost never fired, but took something like 5% of total link
> time. It's available if you want it but on average it doesn't seem
> like a good tradeoff by default.
>
> Ian
>
>
--
View this message in context: http://old.nabble.com/linker-behaviour-for-sections-having-flags-SHF_MERGE-SHF_STRINGS-tp34661603p34669662.html
Sent from the Sourceware - binutils list mailing list archive at Nabble.com.