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
@@ -921,6 +921,13 @@ ffi_closure_alloc (size_t size, void **code)
|
||||
return ptr;
|
||||
}
|
||||
|
||||
void *
|
||||
ffi_data_to_code_pointer (void *data)
|
||||
{
|
||||
msegmentptr seg = segment_holding (gm, data);
|
||||
return add_segment_exec_offset (data, seg);
|
||||
}
|
||||
|
||||
/* Release a chunk of memory allocated with ffi_closure_alloc. If
|
||||
FFI_CLOSURE_FREE_CODE is nonzero, the given address can be the
|
||||
writable or the executable address given. Otherwise, only the
|
||||
@@ -960,6 +967,12 @@ ffi_closure_free (void *ptr)
|
||||
free (ptr);
|
||||
}
|
||||
|
||||
void *
|
||||
ffi_data_to_code_pointer (void *data)
|
||||
{
|
||||
return data;
|
||||
}
|
||||
|
||||
# endif /* ! FFI_MMAP_EXEC_WRIT */
|
||||
#endif /* FFI_CLOSURES */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user