[arm] EABI annotation of thumb symbols.

Daniel Jacobowitz drow@false.org
Thu Nov 4 15:08:00 GMT 2004


On Thu, Nov 04, 2004 at 10:03:25AM -0500, Ian Lance Taylor wrote:
> Richard Earnshaw <rearnsha@arm.com> writes:
> 
> > Don't do Thumb PLT's.  The idea doesn't work.
> > 
> >         1) You don't know whether the target will be ARM or Thumb (it's
> >         in another shared library which may not be the same at run time
> >         as the one you link against at static link time -- don't forget
> >         pre-emption).  So the sequence has to end with an instruction
> >         that can change instruction set state (on v4T that means bx).
> >         
> >         2) You don't have enough registers to do a bx at the end of the
> >         sequence and remember where you've come from (Needed for
> >         re-entry into the dynamic linker, especially if you want to
> >         continue to support pre-linking).  To avoid this you end up
> >         playing games that make the sequence as long as any ARM
> >         equivalent -- and there are still problems.
> 
> I certainly agree that Thumb PLTs are only useful on v5t and up.  For
> my purposes, that is OK, since our customers use XScale chips.
> 
> That said, I'm building Thumb shared libraries in which the PLT takes
> up 120K, or some 4.5% of the text section size.  It's probably
> possible to use version scripts to force some of the symbols to be
> local, but this source code is neither from us nor from our customer,
> so that is not a simple task.  Using Thumb instructions in the PLT
> would give me some clearly measurable size improvements.

Would it really?  Here's an alternative: in the patches I'll be
posting, I add support for independently sized PLT entries.  It would
then be relatively simple (not trivial, because of relaxation problems,
but doable) to use a two instruction ARM PLT sequence if it is in
range.  The largest shared library I have handy at the moment has an
85K PLT using the new three-word entries, and the first word is
_always_ redundant.  Then use interworking branches to get to the PLT.

I doubt you'll get a Thumb PLT sequence under eight bytes.

-- 
Daniel Jacobowitz



More information about the Binutils mailing list