ARM thumb interworking hole?
Ian Lance Taylor
ian@airs.com
Tue Jan 11 18:01:00 GMT 2005
Charles Manning <manningc2@actrix.gen.nz> writes:
> 2) Why do we need the call_via_rx stub anyway? It seems to me this is only
> required if the target address is ARM code that does not return via a "bx
> lr". Surely we should be able to assume that if the code is marked as
> interworking code, then straght interworking will do the job.
The problem is that ARMv4 Thumb code did not support blx. The only
way to jump to an address held in a register was bx. It would be
possible to use a two-instruction sequence (mov lr, pc; bx reg)
instead. I don't know why that wasn't done when not using
-mcaller-super-interworking, since it is no longer than the bl to
__call_via_*. And it would work with -mlong-calls.
In mainline gcc if you compile for an ARMv5 architecture with -mthumb,
the code will always use blx for a function call via a function
pointer.
Ian
More information about the Gcc
mailing list