public inbox for libffi-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Richard Henderson <rth@twiddle.net>
To: libffi-discuss@sourceware.org
Subject: [PATCH 11/13] x86: Use win32 name mangling for fastcall functions
Date: Fri, 07 Nov 2014 15:31:00 -0000	[thread overview]
Message-ID: <1415374240-1792-12-git-send-email-rth@twiddle.net> (raw)
In-Reply-To: <1415374240-1792-1-git-send-email-rth@twiddle.net>

---
 src/x86/sysv.S | 21 +++++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)

diff --git a/src/x86/sysv.S b/src/x86/sysv.S
index f412b7a..e6a8c1e 100644
--- a/src/x86/sysv.S
+++ b/src/x86/sysv.S
@@ -47,6 +47,15 @@
 # define ENDF(X)
 #endif
 
+/* Handle win32 fastcall name mangling.  */
+#ifdef X86_WIN32
+# define ffi_call_i386		@ffi_call_i386@8
+# define ffi_closure_inner	@ffi_closure_inner@8
+#else
+# define ffi_call_i386		C(ffi_call_i386)
+# define ffi_closure_inner	C(ffi_closure_inner)
+#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.  */
@@ -54,8 +63,8 @@
 
 	.text
 	.align	16
-	.globl	C(ffi_call_i386)
-	FFI_HIDDEN(C(ffi_call_i386))
+	.globl	ffi_call_i386
+	FFI_HIDDEN(ffi_call_i386)
 
 /* This is declared as
 
@@ -68,7 +77,7 @@
         edx: argp
 */
 
-C(ffi_call_i386):
+ffi_call_i386:
 	cfi_startproc
 	movl	(%esp), %eax		/* move the return address */
 	movl	%ebp, (%ecx)		/* store %ebp into local frame */
@@ -168,7 +177,7 @@ E(X86_RET_UNUSED15)
 	ud2
 
 	cfi_endproc
-ENDF(C(ffi_call_i386))
+ENDF(ffi_call_i386)
 
 /* The inner helper is declared as
 
@@ -210,9 +219,9 @@ ENDF(C(ffi_call_i386))
 	addl	$C(_GLOBAL_OFFSET_TABLE_), %ebx
 #endif
 #if defined HAVE_HIDDEN_VISIBILITY_ATTRIBUTE || !defined __PIC__
-	call	C(ffi_closure_inner)
+	call	ffi_closure_inner
 #else
-	call	C(ffi_closure_inner)@PLT
+	call	ffi_closure_inner@PLT
 #endif
 .endm
 
-- 
1.9.3

  parent reply	other threads:[~2014-11-07 15:31 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-07 15:30 [PATCH 00/13] Go closures for i686 Richard Henderson
2014-11-07 15:30 ` [PATCH 02/13] x86: Remove some conditional compilation Richard Henderson
2014-11-07 15:31 ` [PATCH 13/13] x86: Work around two clang assembler bugs Richard Henderson
2014-11-07 15:31 ` [PATCH 03/13] x86: Force FFI_TYPE_LONGDOUBLE different from FFI_TYPE_DOUBLE Richard Henderson
2014-11-07 15:31 ` [PATCH 01/13] x86: Tidy ffi_abi Richard Henderson
2014-11-07 15:31 ` [PATCH 08/13] testsuite: Fix return_complex2 vs excessive precision Richard Henderson
2014-11-07 15:31 ` [PATCH 06/13] x86: Rewrite ffi_call Richard Henderson
2014-11-07 15:31 ` [PATCH 04/13] x86: Convert to gas generated unwind info Richard Henderson
2014-11-07 15:31 ` [PATCH 09/13] x86: Add support for Complex Richard Henderson
2014-11-07 15:31 ` Richard Henderson [this message]
2014-11-07 15:31 ` [PATCH 12/13] testsuite: Add two dg-do run markers Richard Henderson
2014-11-07 15:31 ` [PATCH 10/13] x86: Add support for Go closures Richard Henderson
2014-11-07 15:31 ` [PATCH 05/13] ffi_cif: Add cfa_escape Richard Henderson
2014-11-07 15:31 ` [PATCH 07/13] x86: Rewrite closures Richard Henderson
2014-11-07 16:09 ` [PATCH 00/13] Go closures for i686 Richard Henderson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1415374240-1792-12-git-send-email-rth@twiddle.net \
    --to=rth@twiddle.net \
    --cc=libffi-discuss@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).