Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/ntdll/unix/signal_i386.c | 13 ++++++++++ dlls/ntdll/unix/signal_x86_64.c | 45 +++++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+)
diff --git a/dlls/ntdll/unix/signal_i386.c b/dlls/ntdll/unix/signal_i386.c index 6d8cd0f3bd0..10908d6752c 100644 --- a/dlls/ntdll/unix/signal_i386.c +++ b/dlls/ntdll/unix/signal_i386.c @@ -2470,8 +2470,11 @@ __ASM_GLOBAL_FUNC( __wine_syscall_dispatcher, "movl %fs:0x1f8,%ecx\n\t" /* x86_thread_data()->syscall_frame */ "movw $0,0x02(%ecx)\n\t" /* frame->restore_flags */ "pushfl\n\t" + __ASM_CFI(".cfi_adjust_cfa_offset 4\n\t") "popl 0x04(%ecx)\n" /* frame->eflags */ + __ASM_CFI(".cfi_adjust_cfa_offset -4\n\t") "popl 0x08(%ecx)\n\t" /* frame->eip */ + __ASM_CFI(".cfi_adjust_cfa_offset -4\n\t") __ASM_NAME("__wine_syscall_dispatcher_prolog_end") ":\n\t" "movl %esp,0x0c(%ecx)\n\t" /* frame->esp */ "movw %cs,0x10(%ecx)\n\t" @@ -2486,6 +2489,16 @@ __ASM_GLOBAL_FUNC( __wine_syscall_dispatcher, "movl %esi,0x30(%ecx)\n\t" "movl %ebp,0x34(%ecx)\n\t" "leal 0x34(%ecx),%ebp\n\t" + __ASM_CFI(".cfi_def_cfa %ebp,0\n\t") + __ASM_CFI(".cfi_rel_offset %eip,-0x2c\n\t") + __ASM_CFI(".cfi_rel_offset %esp,-0x28\n\t") + __ASM_CFI(".cfi_rel_offset %eax,-0x18\n\t") + __ASM_CFI(".cfi_rel_offset %ebx,-0x14\n\t") + __ASM_CFI(".cfi_rel_offset %ecx,-0x10\n\t") + __ASM_CFI(".cfi_rel_offset %edx,-0x0c\n\t") + __ASM_CFI(".cfi_rel_offset %edi,-0x08\n\t") + __ASM_CFI(".cfi_rel_offset %esi,-0x04\n\t") + __ASM_CFI(".cfi_rel_offset %ebp,-0x00\n\t") "leal 4(%esp),%esi\n\t" /* first argument */ "movl %eax,%ebx\n\t" "shrl $8,%ebx\n\t" diff --git a/dlls/ntdll/unix/signal_x86_64.c b/dlls/ntdll/unix/signal_x86_64.c index e65e256a674..a82ecbd22bf 100644 --- a/dlls/ntdll/unix/signal_x86_64.c +++ b/dlls/ntdll/unix/signal_x86_64.c @@ -3113,8 +3113,11 @@ __ASM_GLOBAL_FUNC( __wine_syscall_dispatcher, "movq %gs:0x30,%rcx\n\t" "movq 0x328(%rcx),%rcx\n\t" /* amd64_thread_data()->syscall_frame */ "pushfq\n\t" + __ASM_CFI(".cfi_adjust_cfa_offset 8\n\t") "popq 0x80(%rcx)\n\t" + __ASM_CFI(".cfi_adjust_cfa_offset -8\n\t") "popq 0x70(%rcx)\n\t" /* frame->rip */ + __ASM_CFI(".cfi_adjust_cfa_offset -8\n\t") "movl $0,0x94(%rcx)\n\t" /* frame->restore_flags */ __ASM_NAME("__wine_syscall_dispatcher_prolog_end") ":\n\t" "movq %rax,0x00(%rcx)\n\t" @@ -3134,6 +3137,20 @@ __ASM_GLOBAL_FUNC( __wine_syscall_dispatcher, "movw %ss,0x90(%rcx)\n\t" "movw %gs,0x92(%rcx)\n\t" "movq %rbp,0x98(%rcx)\n\t" + __ASM_CFI(".cfi_def_cfa %rcx,0\n\t") + __ASM_CFI(".cfi_rel_offset %rax,0x00\n\t") + __ASM_CFI(".cfi_rel_offset %rbx,0x08\n\t") + __ASM_CFI(".cfi_rel_offset %rcx,0x10\n\t") + __ASM_CFI(".cfi_rel_offset %rdx,0x18\n\t") + __ASM_CFI(".cfi_rel_offset %rsi,0x20\n\t") + __ASM_CFI(".cfi_rel_offset %rdi,0x28\n\t") + __ASM_CFI(".cfi_rel_offset %r12,0x50\n\t") + __ASM_CFI(".cfi_rel_offset %r13,0x58\n\t") + __ASM_CFI(".cfi_rel_offset %r14,0x60\n\t") + __ASM_CFI(".cfi_rel_offset %r15,0x68\n\t") + __ASM_CFI(".cfi_rel_offset %rip,0x70\n\t") + __ASM_CFI(".cfi_rel_offset %rsp,0x88\n\t") + __ASM_CFI(".cfi_rel_offset %rbp,0x98\n\t") /* Legends of Runeterra hooks the first system call return instruction, and * depends on us returning to it. Adjust the return address accordingly. */ "subq $0xb,0x70(%rcx)\n\t" @@ -3172,6 +3189,20 @@ __ASM_GLOBAL_FUNC( __wine_syscall_dispatcher, "leaq -0x98(%rbp),%rcx\n" "2:\n\t" #endif + __ASM_CFI(".cfi_def_cfa %rbp,0\n\t") + __ASM_CFI(".cfi_rel_offset %rax,-0x98\n\t") + __ASM_CFI(".cfi_rel_offset %rbx,-0x90\n\t") + __ASM_CFI(".cfi_rel_offset %rcx,-0x88\n\t") + __ASM_CFI(".cfi_rel_offset %rdx,-0x80\n\t") + __ASM_CFI(".cfi_rel_offset %rsi,-0x78\n\t") + __ASM_CFI(".cfi_rel_offset %rdi,-0x70\n\t") + __ASM_CFI(".cfi_rel_offset %r12,-0x48\n\t") + __ASM_CFI(".cfi_rel_offset %r13,-0x40\n\t") + __ASM_CFI(".cfi_rel_offset %r14,-0x38\n\t") + __ASM_CFI(".cfi_rel_offset %r15,-0x30\n\t") + __ASM_CFI(".cfi_rel_offset %rip,-0x28\n\t") + __ASM_CFI(".cfi_rel_offset %rsp,-0x10\n\t") + __ASM_CFI(".cfi_rel_offset %rbp,-0x00\n\t") "leaq 0x28(%rsp),%rsi\n\t" /* first argument */ "movq %rcx,%rsp\n\t" "movq 0x00(%rcx),%rax\n\t" @@ -3199,6 +3230,20 @@ __ASM_GLOBAL_FUNC( __wine_syscall_dispatcher, "movq (%rbx),%r10\n\t" /* table->ServiceTable */ "callq *(%r10,%rax,8)\n\t" "leaq -0x98(%rbp),%rcx\n" + __ASM_CFI(".cfi_def_cfa %rcx,0\n\t") + __ASM_CFI(".cfi_rel_offset %rax,0x00\n\t") + __ASM_CFI(".cfi_rel_offset %rbx,0x08\n\t") + __ASM_CFI(".cfi_rel_offset %rcx,0x10\n\t") + __ASM_CFI(".cfi_rel_offset %rdx,0x18\n\t") + __ASM_CFI(".cfi_rel_offset %rsi,0x20\n\t") + __ASM_CFI(".cfi_rel_offset %rdi,0x28\n\t") + __ASM_CFI(".cfi_rel_offset %r12,0x50\n\t") + __ASM_CFI(".cfi_rel_offset %r13,0x58\n\t") + __ASM_CFI(".cfi_rel_offset %r14,0x60\n\t") + __ASM_CFI(".cfi_rel_offset %r15,0x68\n\t") + __ASM_CFI(".cfi_rel_offset %rip,0x70\n\t") + __ASM_CFI(".cfi_rel_offset %rsp,0x88\n\t") + __ASM_CFI(".cfi_rel_offset %rbp,0x98\n\t") "2:\tmovl 0x94(%rcx),%edx\n\t" /* frame->restore_flags */ #ifdef __linux__ "testl $12,%r14d\n\t" /* SYSCALL_HAVE_PTHREAD_TEB | SYSCALL_HAVE_WRFSGSBASE */