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: powerpc new PLT and GOT


On Thu, May 12, 2005 at 09:54:38AM -0700, Matt Thomas wrote:
> Not everyone who uses ABI_V4 uses glibc.  Two, one might try to use
> the new compiler/binutils on an older system who's dynamic loader doesn't
> support the new PLT/GOT mechanism.

Yes, but see below.

> > Some things I know need attention:
> > a) Should the new -fpic PLT/GOT code support be enabled by default?  The
> >    linker  will continue to generate the old GOT/PLT layout until a new
> >    glibc is available, a consequence of a "bl got-4" used in the current
> >    crti.o.  This is fortunate, and means we don't need to do a configure
> >    test on glibc to figure whether the new PLT/GOT code is safe to use.
> >    However, the new GOT pointer load sequence is larger, (but might be
> >    quicker) and new PLT calls always need the GOT pointer, so code
> >    increases a little in size.
> 
> As I said before, the issue isn't the linker but the dynamic loader.
> Unless you do a configure time to see if the dynamic loader does
> the right thing I don't see how you can enable it by default.

We're talking about two different things here, I think.  I'm
specifically referring to the compiler by default generating relocatable
object files suitable for the new GOT/PLT layout.  From these object
files GNU ld can generate a binary that uses either the old PLT scheme
or the new one.  If the old scheme is selected, because ld detects
"bl got-4" instructions, or because --bss-plt is passed to ld, then the
resultant binary will work with an old dynamic linker.  The new
R_PPC_REL16* relocs will only be found in relocatable object files; None
will be found in any fully linked object.

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre


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