This is the mail archive of the
mailing list for the GCC project.
Re: Link problems with section anchors
>>>>> Richard Sandiford writes:
Richard> I think we're talking past each other. My position (and I believe Mark
Richard> and David's position) is that attribute ((section (".gnu.linkonce.*")))
Richard> is an invalid construct for that very reason. The section attribute
Richard> cannot be used to change semantics. It can only be used to change
Richard> the layout of the linked object.
Yes, I completely agree. The linker know about ".gnu.linkonce"
semantics, but the compiler does not. If one wants to set this in the
compiler, GCC needs to implement an attribute "linkonce" (or something
similar) and have that call varasm.c:make_decl_one_only(). That will have
the compiler set the appropriate bits its representation and choose the
correct section name using ".gnu.linkonce". In GCC, the section name is a
byproduct of the symbol attributes, not the other way around.