This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: ARM thumb interworking hole?
On Tue, 2005-01-11 at 16:12, Ian Lance Taylor wrote:
> 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.
No, because it doesn't work:
mov lr, pc
strips the Thumb bit. That is, it really does give you '.+4' rather
than the '.+5' that's needed for a return value.
R.