ARM thumb interworking hole?

Ian Lance Taylor ian@airs.com
Tue Jan 11 22:52:00 GMT 2005


Richard Earnshaw <rearnsha@gcc.gnu.org> writes:

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

Oh, right.  Sorry.

Ian



More information about the Gcc mailing list