summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/Unix
diff options
context:
space:
mode:
authorTim Northover <t.p.northover@gmail.com>2013-05-19 15:28:16 +0000
committerTim Northover <t.p.northover@gmail.com>2013-05-19 15:28:16 +0000
commit77d0a4ac626bc56e31a83dfe410114f88b95ee5d (patch)
treeb127911bc31150b0ce1e1250c7be15b5297befa5 /llvm/lib/Support/Unix
parent1dbf9a236ffaec9db9d3e08295367cdead59f288 (diff)
downloadbcm5719-llvm-77d0a4ac626bc56e31a83dfe410114f88b95ee5d.tar.gz
bcm5719-llvm-77d0a4ac626bc56e31a83dfe410114f88b95ee5d.zip
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. llvm-svn: 182213
Diffstat (limited to 'llvm/lib/Support/Unix')
-rw-r--r--llvm/lib/Support/Unix/Memory.inc3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/Support/Unix/Memory.inc b/llvm/lib/Support/Unix/Memory.inc
index cdd475c17f7..1c6af7fa0f2 100644
--- a/llvm/lib/Support/Unix/Memory.inc
+++ b/llvm/lib/Support/Unix/Memory.inc
@@ -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
OpenPOWER on IntegriCloud