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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
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