This is the mail archive of the binutils@sourceware.org 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: farcall-section test


> 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".  

Ok. I misread that.

> 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"...

Yeah. I guess there are three options for non-function symbols:
- Don't cause a mode switch (i.e. target is arm for R_ARM_CALL and Thumb for 
R_ARM_THM_CALL). If you have both Arm and Thumb code jumping to the same 
symbol you loose.
- Interpret the T bit literally, and always treat them as ARM. If you have 
Thumb code you loose.
- Figure it out from mapping symbols.

The first is attractive because it matches our current behavior for 
intra-section branches resolved by GAS, and for "near" relocations.

> 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).

Yes, we do implement this. grep for "A branch to an undefined weak symbol".

Paul


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