From: Josh Triplett Date: Fri, 21 Mar 2014 17:57:06 +0000 (-0700) Subject: win32.S: Make calls to ffi_closure_SYSV_inner position-independent X-Git-Tag: v3.1~20^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2087dcf736274286f76c69d3988fb6d7cc4fd0f5;p=platform%2Fupstream%2Flibffi.git win32.S: Make calls to ffi_closure_SYSV_inner position-independent Now that non-Windows platforms include win32.S, it needs to support building as position-independent code. This fixes one source of build failures on target platforms that do not allow text relocations. --- diff --git a/src/x86/win32.S b/src/x86/win32.S index 700cb61..7cbae2a 100644 --- a/src/x86/win32.S +++ b/src/x86/win32.S @@ -688,7 +688,16 @@ USCORE_SYMBOL(ffi_closure_SYSV): movl %edx, 4(%esp) /* args = __builtin_dwarf_cfa () */ leal -12(%ebp), %edx movl %edx, (%esp) /* &resp */ +#if defined(HAVE_HIDDEN_VISIBILITY_ATTRIBUTE) || !defined(__PIC__) call USCORE_SYMBOL(ffi_closure_SYSV_inner) +#else + movl %ebx, 8(%esp) + call 1f +1: popl %ebx + addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %ebx + call ffi_closure_SYSV_inner@PLT + movl 8(%esp), %ebx +#endif movl -12(%ebp), %ecx 0: @@ -956,7 +965,16 @@ USCORE_SYMBOL(ffi_closure_STDCALL): movl %edx, 4(%esp) /* args */ leal -12(%ebp), %edx movl %edx, (%esp) /* &resp */ +#if defined(HAVE_HIDDEN_VISIBILITY_ATTRIBUTE) || !defined(__PIC__) call USCORE_SYMBOL(ffi_closure_SYSV_inner) +#else + movl %ebx, 8(%esp) + call 1f +1: popl %ebx + addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %ebx + call ffi_closure_SYSV_inner@PLT + movl 8(%esp), %ebx +#endif movl -12(%ebp), %ecx 0: call 1f