aarch64: implement the trampoline table workaround for ffi closures on Apple systems

This is a direct copy/paste port of the ARM code, with changes because of Aarch64 pc-relative addressing restrictions.
This commit is contained in:
Yavor Georgiev
2015-01-16 15:31:55 +02:00
parent 05e65b4e20
commit 536366349c
4 changed files with 283 additions and 16 deletions
+6
View File
@@ -42,7 +42,13 @@ typedef enum ffi_abi
/* ---- Definitions for closures ----------------------------------------- */
#define FFI_CLOSURES 1
#if defined (__APPLE__)
#define FFI_TRAMPOLINE_SIZE 20
#define FFI_TRAMPOLINE_CLOSURE_OFFSET 16
#else
#define FFI_TRAMPOLINE_SIZE 24
#define FFI_TRAMPOLINE_CLOSURE_OFFSET FFI_TRAMPOLINE_SIZE
#endif
#define FFI_NATIVE_RAW_API 0
/* ---- Internal ---- */