From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10408 invoked by alias); 7 Nov 2014 15:31:19 -0000 Mailing-List: contact libffi-discuss-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libffi-discuss-owner@sourceware.org Received: (qmail 10226 invoked by uid 89); 7 Nov 2014 15:31:17 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-wg0-f51.google.com Received: from mail-wg0-f51.google.com (HELO mail-wg0-f51.google.com) (74.125.82.51) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Fri, 07 Nov 2014 15:31:11 +0000 Received: by mail-wg0-f51.google.com with SMTP id l18so3980940wgh.38 for ; Fri, 07 Nov 2014 07:31:08 -0800 (PST) X-Received: by 10.180.90.241 with SMTP id bz17mr5898432wib.75.1415374268475; Fri, 07 Nov 2014 07:31:08 -0800 (PST) Received: from pike.twiddle.home.com ([87.111.149.167]) by mx.google.com with ESMTPSA id p1sm12186731wjy.22.2014.11.07.07.31.07 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 07 Nov 2014 07:31:08 -0800 (PST) From: Richard Henderson 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 Message-Id: <1415374240-1792-12-git-send-email-rth@twiddle.net> In-Reply-To: <1415374240-1792-1-git-send-email-rth@twiddle.net> References: <1415374240-1792-1-git-send-email-rth@twiddle.net> X-SW-Source: 2014/txt/msg00202.txt.bz2 --- 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