ARM/THUMB long calls stubs

Nick Clifton nickc@redhat.com
Thu Jul 29 16:23:00 GMT 2004


Hi Sami,

>>PS.  This patch will not be applied to the sources since the correct 
>>thing to do is to fix this problem in the linker.
> 
> 
> Do you know if someone is really working on it ;-) ? 

I do not believe so.  Volunteers are always welcome of course.

> Is there something I could do for it (no, I'm not familiar with binutils/gcc internals)?

The ARMv5t architecture (and later versions) have the blx Thumb 
instruction which resolves this problem without changes to the linker or 
synthesized branches, so one day, when then older ARM chips have all 
disappeared, this will no longer be an issue.

If you want to look at the code in the linker, the file to examine is 
<binutils>/bfd/elf32-arm.h.  But the solution is not straightforward. 
The linker has to detect out-of-range Thumb BL instructions and then 
work out how to synthesize a long jump for them.  Since this is going to 
involve inserting instructions into the output it is going to have to 
handle growing the size of sections, re-resolving relocations and all 
kinds of other ugliness.  Really not a nice thing to have to do.

Cheers
   Nick






More information about the Gcc-bugs mailing list