Merge branch 'master' of https://github.com/landonf/libffi-ios
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 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141
diff --git a/include/ffi.h.in b/include/ffi.h.in
index 96b8fd3..747dd17 100644
--- a/include/ffi.h.in
+++ b/include/ffi.h.in
@@ -270,7 +270,12 @@ size_t ffi_java_raw_size (ffi_cif *cif);
__declspec(align(8))
#endif
typedef struct {
+#if @FFI_EXEC_TRAMPOLINE_TABLE@
+ void *trampoline_table;
+ void *trampoline_table_entry;
+#else
char tramp[FFI_TRAMPOLINE_SIZE];
+#endif
ffi_cif *cif;
void (*fun)(ffi_cif*,void*,void**,void*);
void *user_data;
@@ -303,7 +308,12 @@ ffi_prep_closure_loc (ffi_closure*,
# pragma pack 8
#endif
typedef struct {
+#if @FFI_EXEC_TRAMPOLINE_TABLE@
+ void *trampoline_table;
+ void *trampoline_table_entry;
+#else
char tramp[FFI_TRAMPOLINE_SIZE];
+#endif
ffi_cif *cif;
@@ -324,7 +334,12 @@ typedef struct {
} ffi_raw_closure;
typedef struct {
+#if @FFI_EXEC_TRAMPOLINE_TABLE@
+ void *trampoline_table;
+ void *trampoline_table_entry;
+#else
char tramp[FFI_TRAMPOLINE_SIZE];
+#endif
ffi_cif *cif;
diff --git a/src/arm/sysv.S b/src/arm/sysv.S
index 14a7f03..2b7ea60 100644
--- a/src/arm/sysv.S
+++ b/src/arm/sysv.S
@@ -147,23 +147,6 @@ _L__\name:
.endm
#endif
-.macro RETLDM regs=, cond=, dirn=ia
-#if defined (__INTERWORKING__)
- .ifc "\regs",""
- ldr\cond lr, [sp], #4
- .else
- ldm\cond\dirn sp!, {\regs, lr}
- .endif
- bx\cond lr
-#else
- .ifc "\regs",""
- ldr\cond pc, [sp], #4
- .else
- ldm\cond\dirn sp!, {\regs, pc}
- .endif
-#endif
-.endm
-
@ r0: ffi_prep_args
@ r1: &ecif
@ r2: cif->bytes
@@ -187,7 +170,7 @@ ARM_FUNC_START ffi_call_SYSV
@ r1 already set
@ Call ffi_prep_args(stack, &ecif)
- bl ffi_prep_args
+ bl CNAME(ffi_prep_args)
@ move first 4 parameters in registers
ldmia sp, {r0-r3}
@@ -335,7 +318,12 @@ ARM_FUNC_START ffi_closure_SYSV
/* Below are VFP hard-float ABI call and closure implementations.
Add VFP FPU directive here. */
+#ifndef __APPLE__
+ /* XXX - .fpu pseudo-directive is not supported by Apple's assembler,
+ and VFP hard-float calling conventions are not supported by the
+ compiler. */
.fpu vfp
+#endif
@ r0: fn
@ r1: &ecif
@@ -362,7 +350,7 @@ ARM_FUNC_START ffi_call_VFP
sub r2, fp, #64 @ VFP scratch space
@ Call ffi_prep_args(stack, &ecif, vfp_space)
- bl ffi_prep_args
+ bl CNAME(ffi_prep_args)
@ Load VFP register args if needed
cmp r0, #0
@@ -424,11 +412,18 @@ LSYM(Lbase_args):
fstmiadeq r2, {d0-d3}
LSYM(Lepilogue_vfp):
- RETLDM "r0-r3,fp"
+#if defined (__INTERWORKING__)
+ ldmia sp!, {r0-r3,fp, lr}
+ bx lr
+#else
+ ldmia sp!, {r0-r3,fp, pc}
+#endif
.ffi_call_VFP_end:
UNWIND .fnend
+#ifdef __ELF__
.size CNAME(ffi_call_VFP),.ffi_call_VFP_end-CNAME(ffi_call_VFP)
+#endif
ARM_FUNC_START ffi_closure_VFP
@@ -444,7 +439,7 @@ ARM_FUNC_START ffi_closure_VFP
sub sp, sp, #72
str sp, [sp, #64]
add r1, sp, #64
- bl ffi_closure_SYSV_inner
+ bl CNAME(ffi_closure_SYSV_inner)
cmp r0, #FFI_TYPE_INT
beq .Lretint_vfp
@@ -490,7 +485,9 @@ ARM_FUNC_START ffi_closure_VFP
.ffi_closure_VFP_end:
UNWIND .fnend
+#ifdef __ELF__
.size CNAME(ffi_closure_VFP),.ffi_closure_VFP_end-CNAME(ffi_closure_VFP)
+#endif
#if defined __ELF__ && defined __linux__
.section .note.GNU-stack,"",%progbits