In preparation for building as x86_64 on ARM64EC.
---
 mingw-w64-crt/Makefile.am                     |  3 ++-
 mingw-w64-crt/cfguard/guard_dispatch.S        | 11 +++++++++++
 mingw-w64-crt/cfguard/mingw_cfguard_support.c |  8 --------
 3 files changed, 13 insertions(+), 9 deletions(-)
 create mode 100644 mingw-w64-crt/cfguard/guard_dispatch.S

diff --git a/mingw-w64-crt/Makefile.am b/mingw-w64-crt/Makefile.am
index 4a3aff664..283ecdffc 100644
--- a/mingw-w64-crt/Makefile.am
+++ b/mingw-w64-crt/Makefile.am
@@ -1092,7 +1092,8 @@ src_libmingwex_x86=\
 
 
 src_libmingwex32=$(src_libmingwex_x86)
-src_libmingwex64=$(src_libmingwex_x86)
+src_libmingwex64=$(src_libmingwex_x86) \
+  cfguard/guard_dispatch.S
 
 # these only go into the ARM32 version:
 src_libmingwexarm32=\
diff --git a/mingw-w64-crt/cfguard/guard_dispatch.S 
b/mingw-w64-crt/cfguard/guard_dispatch.S
new file mode 100644
index 000000000..c8e479bc6
--- /dev/null
+++ b/mingw-w64-crt/cfguard/guard_dispatch.S
@@ -0,0 +1,11 @@
+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the mingw-w64 runtime package.
+ * No warranty is given; refer to the file DISCLAIMER.PD within this package.
+ */
+
+        .text
+        .align 16
+        .def __guard_dispatch_icall_dummy;    .scl    2;    .type    32;    
.endef
+__guard_dispatch_icall_dummy:
+        jmp *%rax
diff --git a/mingw-w64-crt/cfguard/mingw_cfguard_support.c 
b/mingw-w64-crt/cfguard/mingw_cfguard_support.c
index 1e777ebfc..5c736e162 100644
--- a/mingw-w64-crt/cfguard/mingw_cfguard_support.c
+++ b/mingw-w64-crt/cfguard/mingw_cfguard_support.c
@@ -17,14 +17,6 @@
 // really matter here because this is a no-op anyway.
 static void __guard_check_icall_dummy(void) {}
 
-// When CFGuard is not active, directly tail-call the target address, which
-// is passed via %rax.
-__asm__(
-    ".globl __guard_dispatch_icall_dummy\n"
-    "__guard_dispatch_icall_dummy:\n"
-    "    jmp *%rax\n"
-);
-
 // This is intentionally declared as _not_ a function pointer, so that the
 // jmp instruction is not included as a valid call target for CFGuard.
 extern void *__guard_dispatch_icall_dummy;
-- 
2.49.0



_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to