This is the mail archive of the
gcc-patches@gcc.gnu.org
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 14:25:24 +0100
- Subject: Re: Link problems with section anchors
- References: <44D2755E.9020600@us.ibm.com> <20060804013032.GB23605@bubble.grove.modra.org> <87y7u427or.fsf@talisman.home> <200608041354.k74DsG832840@makai.watson.ibm.com> <87lkq41tx5.fsf@talisman.home> <200608041411.k74EBg832682@makai.watson.ibm.com> <20060809041155.GE6370@bubble.grove.modra.org> <87u04mctj1.fsf@talisman.home> <20060809130756.GB7210@bubble.grove.modra.org> <87d5bacam6.fsf@talisman.home>
Richard Sandiford wrote:
> I think we're talking past each other. My position (and I believe Mark
> and David's position) is that attribute ((section (".gnu.linkonce.*")))
> is an invalid construct for that very reason. The section attribute
> cannot be used to change semantics. It can only be used to change
> the layout of the linked object.
Indeed.
In particular, I do not believe that GCC should try to infer any
properties of a symbol based on the section attribute other than the
obvious fact that the symbol is located in the section indicated.
The fact that symbols in sections named .gnu.linkonce.* happen to have
special properties when using certain tools on certain operating systems
is not something that GCC should need to know. A more extreme version
of this would be to use __attribute__((section(...))) to place a symbol
into a section that happens to be 1-byte aligned in your linker script
and hope that GCC will figure out that the symbol is packed.
Section names should have no meaning to GCC, except in so far as certain
back ends need to know that they can implement semantics required by GCC
by placing objects in particular sections.
--
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713