[lld] r230194 - [ELF] Add .gnu.linkonce support.

Shankar Easwaran shankare at codeaurora.org
Mon Feb 23 10:35:52 PST 2015


On 2/23/2015 12:27 PM, Rafael Espíndola wrote:
> On Feb 23, 2015 12:40 PM, "Shankar Easwaran" <shankare at codeaurora.org>
> wrote:
>> On 2/23/2015 10:02 AM, Rafael Espíndola wrote:
>>> On 22 February 2015 at 19:04, Shankar Easwaran <shankare at codeaurora.org>
> wrote:
>>>> Author: shankare
>>>> Date: Sun Feb 22 18:04:49 2015
>>>> New Revision: 230194
>>>>
>>>> URL: http://llvm.org/viewvc/llvm-project?rev=230194&view=rev
>>>> Log:
>>>> [ELF] Add .gnu.linkonce support.
>>>>
>>>> When the GNU linker sees two input sections with the same name, and the
> name
>>>> starts with ".gnu.linkonce.", the linker will only keep one copy and
> discard the
>>>> other. Any section whose name starts with “.gnu.linkonce.” is a COMDAT
> section.
>>>> Some architectures like Hexagon use this section to store floating
> point constants,
>>>> that need be deduped.
>>> Why not use SHF_MERGE sections?
>> I have seen SHF_MERGE only works with readonly, I may be wrong.
> How can you merge read write data?
:) So we use .gnu.linkonce.
>
>> SHF_MERGE does not work as there are specific signatures that are used
> with .gnu.linkonce to store hot code too (.gnu.linkonce.t) and we also use
> TLS floating point data in gnu linkonce too.
>
> Code isn't a floating point constant :-)
We have more usecases of usage of .gnu.linkonce is what I meant to say :)

Shankar Easwaran

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by the Linux Foundation





More information about the llvm-commits mailing list