From: Brendan Shanks bshanks@codeweavers.com
GCC always assembles 'jmp 1f' to 'eb 01', as does Clang when using -O1 or higher optimization. But with -O0, Clang outputs 'e9 01 00 00 00'.
The 'subq $0xb,0x70(%rcx)' line in __wine_syscall_dispatcher relies on 'jmp 1f' being 2 bytes.
Based on patch by Alex S. --- include/wine/asm.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/include/wine/asm.h b/include/wine/asm.h index 7a6c03b5df7..37760a59dcd 100644 --- a/include/wine/asm.h +++ b/include/wine/asm.h @@ -245,9 +245,9 @@ ".byte 0x75,0x03\n\t" /* jne 1f */ \ ".byte 0x0f,0x05\n\t" /* syscall */ \ ".byte 0xc3\n\t" /* ret */ \ - "jmp 1f\n\t" \ - ".byte 0xc3\n" /* ret */ \ - "1:\t.byte 0xff,0x14,0x25\n\t" /* 1: callq *(0x7ffe1000) */ \ + ".byte 0xeb,0x01\n\t" /* jmp 1f */ \ + ".byte 0xc3\n\t" /* ret */ \ + ".byte 0xff,0x14,0x25\n\t" /* 1: callq *(0x7ffe1000) */ \ ".long 0x7ffe1000\n\t" \ "ret" ) # else @@ -260,10 +260,10 @@ ".byte 0x75,0x03\n\t" /* jne 1f */ \ ".byte 0x0f,0x05\n\t" /* syscall */ \ ".byte 0xc3\n\t" /* ret */ \ - "jmp 1f\n\t" \ + ".byte 0xeb,0x02\n\t" /* jmp 1f */ \ ".byte 0xc3\n" /* ret */ \ - "nop\n" \ - "1:\tcallq *" __ASM_NAME("__wine_syscall_dispatcher") "(%rip)\n\t" \ + "nop\n\t" \ + "callq *" __ASM_NAME("__wine_syscall_dispatcher") "(%rip)\n\t" /* 1: callq __wine_syscall_dispatcher */ \ "ret" ) # endif #elif defined __arm__