Move the macros from unix64.S into a shared header asmnames.h and use
them in win64.S too.
--- /dev/null
+#ifndef ASMNAMES_H
+#define ASMNAMES_H
+
+#define C2(X, Y) X ## Y
+#define C1(X, Y) C2(X, Y)
+#ifdef __USER_LABEL_PREFIX__
+# define C(X) C1(__USER_LABEL_PREFIX__, X)
+#else
+# define C(X) X
+#endif
+
+#ifdef __APPLE__
+# define L(X) C1(L, X)
+#else
+# define L(X) C1(.L, X)
+#endif
+
+#if defined(__ELF__) && defined(__PIC__)
+# define PLT(X) X@PLT
+#else
+# define PLT(X) X
+#endif
+
+#ifdef __ELF__
+# define ENDF(X) .type X,@function; .size X, . - X
+#else
+# define ENDF(X)
+#endif
+
+#endif /* ASMNAMES_H */
#include <fficonfig.h>
#include <ffi.h>
#include "internal64.h"
+#include "asmnames.h"
.text
-#define C2(X, Y) X ## Y
-#define C1(X, Y) C2(X, Y)
-#ifdef __USER_LABEL_PREFIX__
-# define C(X) C1(__USER_LABEL_PREFIX__, X)
-#else
-# define C(X) X
-#endif
-
-#ifdef __APPLE__
-# define L(X) C1(L, X)
-#else
-# define L(X) C1(.L, X)
-#endif
-
-#ifdef __ELF__
-# define PLT(X) X@PLT
-# define ENDF(X) .type X,@function; .size X, . - X
-#else
-# define PLT(X) X
-# define ENDF(X)
-#endif
-
/* This macro allows the safe creation of jump tables without an
actual table. The entry points into the table are all 8 bytes.
The use of ORG asserts that we're at the correct location. */
#include <fficonfig.h>
#include <ffi.h>
#include <ffi_cfi.h>
+#include "asmnames.h"
#if defined(HAVE_AS_CFI_PSEUDO_OP)
.cfi_sections .debug_frame
#define arg3 %rcx
#endif
-#ifdef SYMBOL_UNDERSCORE
-#define SYMBOL_NAME(name) _##name
-#else
-#define SYMBOL_NAME(name) name
-#endif
-
.macro E which
.align 8
.org 0b + \which * 8
movsd %xmm0, (%r8)
epilogue
E FFI_TYPE_LONGDOUBLE
- call abort
+ call PLT(C(abort))
E FFI_TYPE_UINT8
movzbl %al, %eax
movq %rax, (%r8)
movq %rax, (%r8)
epilogue
E FFI_TYPE_COMPLEX
- call abort
+ call PLT(C(abort))
E FFI_TYPE_SMALL_STRUCT_1B
movb %al, (%r8)
epilogue
epilogue
.align 8
-99: call abort
+99: call PLT(C(abort))
.purgem epilogue