This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils 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: [arm] EABI annotation of thumb symbols.


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.

Ian


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