This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: ARM thumb interworking hole?


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]