Add a hard-coded FFI_EXEC_TRAMPOLINE_TABLE arm implementation.
This implements support for re-mapping a shared table of executable trampolines directly in front of a writable configuration page, working around PROT_WRITE restrictions for sandboxed applications on Apple's iOS. This implementation is for testing purposes; a proper allocator is still necessary, and ARM-specific code needs to be moved out of src/closures.c.
This commit is contained in:
@@ -297,10 +297,17 @@ ffi_prep_closure_loc (ffi_closure* closure,
|
||||
{
|
||||
FFI_ASSERT (cif->abi == FFI_SYSV);
|
||||
|
||||
#if FFI_EXEC_TRAMPOLINE_TABLE
|
||||
// XXX - hardcoded offset
|
||||
void **config = (void **) (((uint8_t *) codeloc) - 4080);
|
||||
config[0] = closure;
|
||||
config[1] = ffi_closure_SYSV;
|
||||
#else
|
||||
FFI_INIT_TRAMPOLINE (&closure->tramp[0], \
|
||||
&ffi_closure_SYSV, \
|
||||
codeloc);
|
||||
|
||||
#endif
|
||||
|
||||
closure->cif = cif;
|
||||
closure->user_data = user_data;
|
||||
closure->fun = fun;
|
||||
|
||||
Reference in New Issue
Block a user