Commit b8ec1068 authored by Brendan Shanks's avatar Brendan Shanks Committed by Alexandre Julliard

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

Fixes syscall faults on 32-bit macOS. Spotted by Stefan Dösinger.
parent 8f3e19a5
...@@ -1261,7 +1261,8 @@ __ASM_GLOBAL_FUNC( __wine_syscall_dispatcher, ...@@ -1261,7 +1261,8 @@ __ASM_GLOBAL_FUNC( __wine_syscall_dispatcher,
"5:\tmovw r0, #0x000d\n\t" /* STATUS_INVALID_PARAMETER */ "5:\tmovw r0, #0x000d\n\t" /* STATUS_INVALID_PARAMETER */
"movt r0, #0xc000\n\t" "movt r0, #0xc000\n\t"
"add sp, sp, #0x10\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" __ASM_NAME("__wine_syscall_dispatcher_return") ":\n\t"
"mov r8, r0\n\t" "mov r8, r0\n\t"
"mov r0, r1\n\t" "mov r0, r1\n\t"
......
...@@ -1382,7 +1382,8 @@ __ASM_GLOBAL_FUNC( __wine_syscall_dispatcher, ...@@ -1382,7 +1382,8 @@ __ASM_GLOBAL_FUNC( __wine_syscall_dispatcher,
"ret x16\n" "ret x16\n"
"4:\tmov x0, #0xc0000000\n\t" /* STATUS_INVALID_PARAMETER */ "4:\tmov x0, #0xc0000000\n\t" /* STATUS_INVALID_PARAMETER */
"movk x0, #0x000d\n\t" "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" __ASM_NAME("__wine_syscall_dispatcher_return") ":\n\t"
"mov sp, x0\n\t" "mov sp, x0\n\t"
"mov x0, x1\n\t" "mov x0, x1\n\t"
......
...@@ -2498,7 +2498,8 @@ __ASM_GLOBAL_FUNC( __wine_syscall_dispatcher, ...@@ -2498,7 +2498,8 @@ __ASM_GLOBAL_FUNC( __wine_syscall_dispatcher,
"movw $0,0x02(%ecx)\n\t" /* frame->restore_flags */ "movw $0,0x02(%ecx)\n\t" /* frame->restore_flags */
"popl 0x08(%ecx)\n\t" /* frame->eip */ "popl 0x08(%ecx)\n\t" /* frame->eip */
"pushfl\n\t" "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" __ASM_NAME("__wine_syscall_dispatcher_prolog_end") ":\n\t"
"movl %esp,0x0c(%ecx)\n\t" /* frame->esp */ "movl %esp,0x0c(%ecx)\n\t" /* frame->esp */
"movw %cs,0x10(%ecx)\n\t" "movw %cs,0x10(%ecx)\n\t"
...@@ -2611,7 +2612,8 @@ __ASM_GLOBAL_FUNC( __wine_syscall_dispatcher, ...@@ -2611,7 +2612,8 @@ __ASM_GLOBAL_FUNC( __wine_syscall_dispatcher,
"popl %ds\n\t" "popl %ds\n\t"
"iret\n" "iret\n"
"6:\tmovl $0xc000000d,%eax\n\t" /* STATUS_INVALID_PARAMETER */ "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" __ASM_NAME("__wine_syscall_dispatcher_return") ":\n\t"
"movl 8(%esp),%eax\n\t" "movl 8(%esp),%eax\n\t"
"movl 4(%esp),%esp\n\t" "movl 4(%esp),%esp\n\t"
......
...@@ -3295,6 +3295,7 @@ __ASM_GLOBAL_FUNC( __wine_syscall_dispatcher, ...@@ -3295,6 +3295,7 @@ __ASM_GLOBAL_FUNC( __wine_syscall_dispatcher,
"pushfq\n\t" "pushfq\n\t"
"popq 0x80(%rcx)\n\t" "popq 0x80(%rcx)\n\t"
"movl $0,0x94(%rcx)\n\t" /* frame->restore_flags */ "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" __ASM_NAME("__wine_syscall_dispatcher_prolog_end") ":\n\t"
"movq %rax,0x00(%rcx)\n\t" "movq %rax,0x00(%rcx)\n\t"
"movq %rbx,0x08(%rcx)\n\t" "movq %rbx,0x08(%rcx)\n\t"
...@@ -3424,7 +3425,8 @@ __ASM_GLOBAL_FUNC( __wine_syscall_dispatcher, ...@@ -3424,7 +3425,8 @@ __ASM_GLOBAL_FUNC( __wine_syscall_dispatcher,
"movq 0x10(%rcx),%rcx\n" "movq 0x10(%rcx),%rcx\n"
"iretq\n" "iretq\n"
"5:\tmovl $0xc000000d,%edx\n\t" /* STATUS_INVALID_PARAMETER */ "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" __ASM_NAME("__wine_syscall_dispatcher_return") ":\n\t"
"movl 0xb0(%rcx),%r14d\n\t" /* frame->syscall_flags */ "movl 0xb0(%rcx),%r14d\n\t" /* frame->syscall_flags */
"movq %rdx,%rax\n\t" "movq %rdx,%rax\n\t"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment