mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-04-20 22:13:25 +00:00
ARM: Fix BLX encoding for Thumb interworking calls.
Thanks to Charles Baylis.
This commit is contained in:
parent
8ada57eb49
commit
fcc8244899
@ -273,7 +273,7 @@ static void emit_call(ASMState *as, void *target)
|
|||||||
ptrdiff_t delta = ((char *)target - (char *)p) - 8;
|
ptrdiff_t delta = ((char *)target - (char *)p) - 8;
|
||||||
if ((((delta>>2) + 0x00800000) >> 24) == 0) {
|
if ((((delta>>2) + 0x00800000) >> 24) == 0) {
|
||||||
if ((delta & 1))
|
if ((delta & 1))
|
||||||
*p = ARMI_BLX | ((uint32_t)(delta>>2) & 0x00ffffffu) | ((delta&2) << 27);
|
*p = ARMI_BLX | ((uint32_t)(delta>>2) & 0x00ffffffu) | ((delta&2) << 23);
|
||||||
else
|
else
|
||||||
*p = ARMI_BL | ((uint32_t)(delta>>2) & 0x00ffffffu);
|
*p = ARMI_BL | ((uint32_t)(delta>>2) & 0x00ffffffu);
|
||||||
} else { /* Target out of range: need indirect call. But don't use R0-R3. */
|
} else { /* Target out of range: need indirect call. But don't use R0-R3. */
|
||||||
|
Loading…
Reference in New Issue
Block a user