[PATCH 3/3] kernelbase: Align stack in GetProcAddress() on x64.

Paul Gofman pgofman at codeweavers.com
Tue Oct 27 06:01:57 CDT 2020


Signed-off-by: Paul Gofman <pgofman at codeweavers.com>
---
 dlls/kernelbase/loader.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/dlls/kernelbase/loader.c b/dlls/kernelbase/loader.c
index 4fb4293ca2b..1617ac11153 100644
--- a/dlls/kernelbase/loader.c
+++ b/dlls/kernelbase/loader.c
@@ -447,18 +447,18 @@ __ASM_GLOBAL_FUNC( GetProcAddress,
                    "movq %rsp,%rbp\n\t"
                    __ASM_SEH(".seh_setframe %rbp,0\n\t")
                    __ASM_CFI(".cfi_def_cfa_register %rbp\n\t")
-                   "subq $0x60,%rsp\n\t"
-                   __ASM_SEH(".seh_stackalloc 0x60\n\t")
                    __ASM_SEH(".seh_endprologue\n\t")
-                   "movaps %xmm0,-0x10(%rbp)\n\t"
-                   "movaps %xmm1,-0x20(%rbp)\n\t"
-                   "movaps %xmm2,-0x30(%rbp)\n\t"
-                   "movaps %xmm3,-0x40(%rbp)\n\t"
+                   "subq $0x60,%rsp\n\t"
+                   "andq $~15,%rsp\n\t"
+                   "movaps %xmm0,0x20(%rsp)\n\t"
+                   "movaps %xmm1,0x30(%rsp)\n\t"
+                   "movaps %xmm2,0x40(%rsp)\n\t"
+                   "movaps %xmm3,0x50(%rsp)\n\t"
                    "call " __ASM_NAME("get_proc_address") "\n\t"
-                   "movaps -0x40(%rbp), %xmm3\n\t"
-                   "movaps -0x30(%rbp), %xmm2\n\t"
-                   "movaps -0x20(%rbp), %xmm1\n\t"
-                   "movaps -0x10(%rbp), %xmm0\n\t"
+                   "movaps 0x50(%rsp), %xmm3\n\t"
+                   "movaps 0x40(%rsp), %xmm2\n\t"
+                   "movaps 0x30(%rsp), %xmm1\n\t"
+                   "movaps 0x20(%rsp), %xmm0\n\t"
                    "leaq 0(%rbp),%rsp\n\t"
                    __ASM_CFI(".cfi_def_cfa_register %rsp\n\t")
                    "popq %rbp\n\t"
-- 
2.26.2




More information about the wine-devel mailing list