ntdll: Add ".globl" for asm labels referenced from C.

Fixes syscall faults on 32-bit macOS.
Spotted by Stefan Dösinger.
This commit is contained in:
Brendan Shanks 2022-07-11 11:21:31 -07:00 committed by Alexandre Julliard
parent 8f3e19a52f
commit b8ec1068ba
4 changed files with 11 additions and 5 deletions

View file

@ -1261,7 +1261,8 @@ __ASM_GLOBAL_FUNC( __wine_syscall_dispatcher,
"5:\tmovw r0, #0x000d\n\t" /* STATUS_INVALID_PARAMETER */
"movt r0, #0xc000\n\t"
"add sp, sp, #0x10\n\t"
"b 4b\n"
"b 4b\n\t"
".globl " __ASM_NAME("__wine_syscall_dispatcher_return") "\n"
__ASM_NAME("__wine_syscall_dispatcher_return") ":\n\t"
"mov r8, r0\n\t"
"mov r0, r1\n\t"

View file

@ -1382,7 +1382,8 @@ __ASM_GLOBAL_FUNC( __wine_syscall_dispatcher,
"ret x16\n"
"4:\tmov x0, #0xc0000000\n\t" /* STATUS_INVALID_PARAMETER */
"movk x0, #0x000d\n\t"
"b 3b\n"
"b 3b\n\t"
".globl " __ASM_NAME("__wine_syscall_dispatcher_return") "\n"
__ASM_NAME("__wine_syscall_dispatcher_return") ":\n\t"
"mov sp, x0\n\t"
"mov x0, x1\n\t"

View file

@ -2498,7 +2498,8 @@ __ASM_GLOBAL_FUNC( __wine_syscall_dispatcher,
"movw $0,0x02(%ecx)\n\t" /* frame->restore_flags */
"popl 0x08(%ecx)\n\t" /* frame->eip */
"pushfl\n\t"
"popl 0x04(%ecx)\n" /* frame->eflags */
"popl 0x04(%ecx)\n\t" /* frame->eflags */
".globl " __ASM_NAME("__wine_syscall_dispatcher_prolog_end") "\n"
__ASM_NAME("__wine_syscall_dispatcher_prolog_end") ":\n\t"
"movl %esp,0x0c(%ecx)\n\t" /* frame->esp */
"movw %cs,0x10(%ecx)\n\t"
@ -2611,7 +2612,8 @@ __ASM_GLOBAL_FUNC( __wine_syscall_dispatcher,
"popl %ds\n\t"
"iret\n"
"6:\tmovl $0xc000000d,%eax\n\t" /* STATUS_INVALID_PARAMETER */
"jmp 5b\n"
"jmp 5b\n\t"
".globl " __ASM_NAME("__wine_syscall_dispatcher_return") "\n"
__ASM_NAME("__wine_syscall_dispatcher_return") ":\n\t"
"movl 8(%esp),%eax\n\t"
"movl 4(%esp),%esp\n\t"

View file

@ -3295,6 +3295,7 @@ __ASM_GLOBAL_FUNC( __wine_syscall_dispatcher,
"pushfq\n\t"
"popq 0x80(%rcx)\n\t"
"movl $0,0x94(%rcx)\n\t" /* frame->restore_flags */
".globl " __ASM_NAME("__wine_syscall_dispatcher_prolog_end") "\n"
__ASM_NAME("__wine_syscall_dispatcher_prolog_end") ":\n\t"
"movq %rax,0x00(%rcx)\n\t"
"movq %rbx,0x08(%rcx)\n\t"
@ -3424,7 +3425,8 @@ __ASM_GLOBAL_FUNC( __wine_syscall_dispatcher,
"movq 0x10(%rcx),%rcx\n"
"iretq\n"
"5:\tmovl $0xc000000d,%edx\n\t" /* STATUS_INVALID_PARAMETER */
"movq %rsp,%rcx\n"
"movq %rsp,%rcx\n\t"
".globl " __ASM_NAME("__wine_syscall_dispatcher_return") "\n"
__ASM_NAME("__wine_syscall_dispatcher_return") ":\n\t"
"movl 0xb0(%rcx),%r14d\n\t" /* frame->syscall_flags */
"movq %rdx,%rax\n\t"