mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-05 13:26:55 +00:00
Invalidate instruction cache when setting memory to be executable.
lli's remote MCJIT code calls setExecutable just prior to running code. In line with Darwin behaviour this seems to be the place to invalidate any caches needed so that relocations can take effect properly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182213 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -268,6 +268,9 @@ bool Memory::setExecutable (MemoryBlock &M, std::string *ErrMsg) {
|
||||
kern_return_t kr = vm_protect(mach_task_self(), (vm_address_t)M.Address,
|
||||
(vm_size_t)M.Size, 0, VM_PROT_READ | VM_PROT_EXECUTE | VM_PROT_COPY);
|
||||
return KERN_SUCCESS == kr;
|
||||
#elif defined(__arm__) || defined(__aarch64__)
|
||||
Memory::InvalidateInstructionCache(M.Address, M.Size);
|
||||
return true;
|
||||
#else
|
||||
return true;
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user