mirror of
https://github.com/FEX-Emu/FEX.git
synced 2025-01-07 14:10:23 +00:00
1d1ed012d8
FEX had a bug with this instruction where it was incorrectly using both the address size override and operand size override to truncate the immediate offset. This isn't how the instruction should behave as it should actually ignore the address size override. This now puts it correctly inline with how the jump instruction works and adds a unit test to ensure it doesn't break again. This fixes a crash from the Arch rootfs from the glibc dynamic linker being compiling in a way where a call instruction was getting aligned using this prefix (Since the compiler knew it does nothing).
25 lines
420 B
NASM
25 lines
420 B
NASM
%ifdef CONFIG
|
|
{
|
|
"RegData": {
|
|
"RAX": "1"
|
|
}
|
|
}
|
|
%endif
|
|
|
|
; FEX had a bug with relative call instructions.
|
|
; It was incorrectly truncating the immediate displacement based on address size override AND operand size override.
|
|
; Address size override doesn't actually change immediate representation on the call instruction.
|
|
|
|
mov rsp, 0xe000_1000
|
|
mov rax, 0
|
|
|
|
jmp .after
|
|
.test:
|
|
mov rax, 1
|
|
hlt
|
|
|
|
.after:
|
|
a32 call .test
|
|
|
|
hlt
|