This is the mail archive of the
mailing list for the GCC project.
Re: Link problems with section anchors
- From: Mark Mitchell <mark at codesourcery dot com>
- To: gcc-patches at gcc dot gnu dot org, David Edelsohn <dje at watson dot ibm dot com>, Steven Munroe <munroesj at us dot ibm dot com>, mark at codesourcery dot com, richard at codesourcery dot com
- Date: Wed, 09 Aug 2006 11:09:12 +0100
- Subject: Re: Link problems with section anchors
- References: <44D2755E.firstname.lastname@example.org> <20060804013032.GB23605@bubble.grove.modra.org> <email@example.com> <200608041354.k74DsG832840@makai.watson.ibm.com> <firstname.lastname@example.org> <200608041411.k74EBg832682@makai.watson.ibm.com> <20060809041155.GE6370@bubble.grove.modra.org> <email@example.com>
Richard Sandiford wrote:
> I really think recognising ".gnu.linkonce" as a magic string is a bad
> idea. There was talk on #gcc at the time about adding a new attribute
> specifically for making something link-once. I still think that's the
> right way to go.
I agree with both points.
I think everyone agrees that, for ELF, it's unfortunate that there's as
much code as there is throughout the toolchain relying on section names.
We should in general try to avoid adding more. (Furthermore, the
special .gnu.linkonce semantics only apply if you're using the GNU
assembler (or perhaps GNU linker?) on an ELF system, so even if we did
recognize the string, we'd need to do it conditionally.)
In short, I, too, think an attribute would be much better.
I also think that DECL_ONE_ONLY should definitely apply only to
declarations with external linkage, i.e., with TREE_PUBLIC set.
Otherwise, we're squandering a valuable bit in the tree representation
for other declarations.
(650) 331-3385 x713