[lld] r205163 - [core] support .gnu.linkonce sections

Shankar Easwaran shankare at codeaurora.org
Mon Mar 31 09:27:11 PDT 2014


On 3/30/2014 11:11 PM, Rui Ueyama wrote:
> This is not an obvious change to Core, not suitable for post-commit review.
> Please roll it back until we reach a conclusion that this is the right
> design.
>
I am not sure why its not a change, that has to be present in core. See 
my notes below.

>> ==============================================================================
>> --- lld/trunk/include/lld/Core/DefinedAtom.h (original)
>> +++ lld/trunk/include/lld/Core/DefinedAtom.h Sun Mar 30 22:16:37 2014
>> @@ -147,6 +147,7 @@ public:
>>       typeRWNote,             // Identifies readwrite note sections [ELF]
>>       typeNoAlloc,            // Identifies non allocatable sections [ELF]
>>       typeGroupComdat,        // Identifies a section group [ELF, COFF]
>> +    typeGnuLinkOnce,        // Identifies a gnu.linkonce section [ELF]
>>
> So you defined a new type for gnu.linkonce sections, but throughout this
> patch typeGnuLinkOnce is not distinguished from typeGroupComdat.
There is one thing that distinguishes between comdat and linkonce in the 
patch, see my below comment.
>   All if's
> previously handled typeGroupComdat are now replaced with typeGroupComdat ||
> typeGnuLinkOnce. That does not look good.
>
> I don't see the reason we can't simply treat gnu.linkonce as
> typeGroupComdat. If we treat gnu.linkonce such a way, only the ELF object
> reader will have to handle gnu.linkonce sections and Resolver will remain
> unchanged.
The only distinguishing factor with gnu linkonce and group comdat is to 
produce an error when the same group signature is part of COMDAT and the 
same group has a signature with linkonce.

I dont think we can use typeGroupComdat for linkonce and comdat.

Thanks

Shankar Easwaran



More information about the llvm-commits mailing list