This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: ARM thumb interworking hole?
- From: Ian Lance Taylor <ian at airs dot com>
- To: manningc2 at actrix dot gen dot nz
- Cc: gcc at gcc dot gnu dot org
- Date: 11 Jan 2005 11:12:43 -0500
- Subject: Re: ARM thumb interworking hole?
- References: <20050110060158.0ED854265@blood.actrix.co.nz>
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