Comment 8 for bug 503185

Revision history for this message
Dave Martin (dave-martin-arm) wrote :

ARMv7 generally does not allow the PC to be used as a destination register for random operations. The code will also not work in Thumb because the "Thumb bit" in the return address (bottom bit of lr) is not set properly.

The best way to fix this is to precompute the address of the kuser helper code to call (in r3) and call it with BLX r3. This only works on v5 and above; this is reasonable because the code won't build for Thumb on ARMv4T anyway for various other reasons.

The attached patch attempts to do this when appropriate.

I will try to test it, but haven't been able to do so yet.