mirror of
https://github.com/partic2/libffi
synced 2026-11-10 18:17:19 +00:00
aarch64: Flush code mapping in addition to data mapping (#471)
This needs a new function, ffi_data_to_code_pointer, to translate from data pointers to code pointers. Fixes issue #470.
This commit is contained in:
committed by
Anthony Green
parent
042ef8c314
commit
44a6c28545
@@ -773,6 +773,10 @@ ffi_prep_closure_loc (ffi_closure *closure,
|
||||
*(UINT64 *)(tramp + 16) = (uintptr_t)start;
|
||||
|
||||
ffi_clear_cache(tramp, tramp + FFI_TRAMPOLINE_SIZE);
|
||||
|
||||
/* Also flush the cache for code mapping. */
|
||||
unsigned char *tramp_code = ffi_data_to_code_pointer (tramp);
|
||||
ffi_clear_cache (tramp_code, tramp_code + FFI_TRAMPOLINE_SIZE);
|
||||
#endif
|
||||
|
||||
closure->cif = cif;
|
||||
|
||||
Reference in New Issue
Block a user