From Jens Rehsack. Fix for 64-bit AIX.
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 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
diff --git a/src/powerpc/aix.S b/src/powerpc/aix.S
index 45502f7..4dacee5 100644
--- a/src/powerpc/aix.S
+++ b/src/powerpc/aix.S
@@ -96,8 +96,12 @@
.globl .ffi_call_AIX
.csect ffi_call_AIX[DS]
ffi_call_AIX:
+#if defined(_ARCH_PPC64)
+ .llong .ffi_call_AIX, TOC[tc0], 0
+#else
.long .ffi_call_AIX, TOC[tc0], 0
- .csect .text[PR]
+#endif
+ .csect .text[PR]
.ffi_call_AIX:
mr r12,r8 // We only need r12 until the call, so it doesn't have to be saved...
/* Save the old stack pointer as AP. */
@@ -216,7 +220,11 @@ L(float_return_value):
.globl .ffi_call_DARWIN
.csect ffi_call_DARWIN[DS]
ffi_call_DARWIN:
+#if defined(_ARCH_PPC64)
+ .llong .ffi_call_DARWIN, TOC[tc0], 0
+#else
.long .ffi_call_DARWIN, TOC[tc0], 0
+#endif
.csect .text[PR]
.ffi_call_DARWIN:
blr
diff --git a/src/powerpc/aix_closure.S b/src/powerpc/aix_closure.S
index 7bf5c65..e05c849 100644
--- a/src/powerpc/aix_closure.S
+++ b/src/powerpc/aix_closure.S
@@ -84,6 +84,7 @@
#define L(x) x
.file "aix_closure.S"
.toc
+ .extern .ffi_closure_helper_DARWIN
LC..60:
.tc L..60[TC],L..60
.csect .text[PR]
@@ -96,7 +97,11 @@ LC..60:
.csect ffi_closure_ASM[DS]
ffi_closure_ASM:
+#if defined(_ARCH_PPC64)
+ .llong .ffi_closure_ASM, TOC[tc0], 0
+#else
.long .ffi_closure_ASM, TOC[tc0], 0
+#endif
.csect .text[PR]
.ffi_closure_ASM: