This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Link problems with section anchors


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]