This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: farcall-section test
On Tue, Feb 24, 2009 at 01:53:43PM +0000, Paul Brook wrote:
> Hmm, I guess so.
>
> Actually, reading the AAELF again, it says "T is 1 if the target symbol has
> type STT_FUNC and the symbol addresses a Thumb instruction". i.e.
> non-function symbols are treated as ARM.
>
> Also relevant is:
> "A linker may use a veneer [...] if [...] The target symbol has type
> STT_FUNC."
>
> i.e. an error is the correct behavior here. IMO this makes sense: If a symbol
> isn't marked as a function, we can't really be sure it's actually a public
> entry point, and probably can't safely clobber r12.
I don't think it means exactly that. Here's the full quote:
A linker may use a veneer (a sequence of instructions) to effect the
relocated branch if any of the following conditions apply:
The target symbol has type STT_FUNC
The target symbol and relocated place are in separate input
sections to the linker
In all other cases a linker shall diagnose an error if relocation
cannot be effected without a veneer.
Note "any". Sounds like we should be able to do this - and hot/cold
partitioning should know that the branch might corrupt IP. On the
other hand, I can't find another way to interpret the quote about
setting "T"...
Unrelated: do we implement this one?
On platforms that do not support dynamic pre-emption of symbols an
unresolved weak reference to a symbol relocated by R_ARM_CALL shall be
treated as a jump to the next instruction (the call becomes a
no-op).
--
Daniel Jacobowitz
CodeSourcery