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: Richard Sandiford <richard at codesourcery dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: David Edelsohn <dje at watson dot ibm dot com>, Steven Munroe <munroesj at us dot ibm dot com>, mark at codesourcery dot com
- Date: Wed, 09 Aug 2006 14:16:49 +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>
Alan Modra <amodra@bigpond.net.au> writes:
> On Wed, Aug 09, 2006 at 07:28:18AM +0100, Richard Sandiford wrote:
>> Yes, but as David says, changing _sections_ with the section attribute
>> is fine. Our position is that changing program semantics isn't.
>> And that's the difference between .sdata and .gnu.linkonce.
>> The former doesn't change program semantics but the latter does.
>
> Eh? Setting the section name to .gnu.linkonce.* _already_ changes
> program semantics. The linker knows that .gnu.linkonce.* is special, at
> least if you're using the GNU linker.
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.
Richard