diff options
author | Andrew Kaylor <andrew.kaylor@intel.com> | 2012-11-15 23:50:01 +0000 |
---|---|---|
committer | Andrew Kaylor <andrew.kaylor@intel.com> | 2012-11-15 23:50:01 +0000 |
commit | a342cb9613d33a50e25800d1d2414bec31249ab6 (patch) | |
tree | 7f0814847e10d3f1ce87575c47321120964f387c /llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp | |
parent | dcc794906556b5e7fbf407226a725ed13fd8287e (diff) | |
download | bcm5719-llvm-a342cb9613d33a50e25800d1d2414bec31249ab6.tar.gz bcm5719-llvm-a342cb9613d33a50e25800d1d2414bec31249ab6.zip |
Interface changes to allow RuntimeDyld memory managers to set memory permissions after an object has been loaded.
llvm-svn: 168114
Diffstat (limited to 'llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp')
-rw-r--r-- | llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp b/llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp index 752c5b73ea3..d72e56378ba 100644 --- a/llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp +++ b/llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp @@ -118,17 +118,26 @@ void MCJIT::emitObject(Module *m) { // FIXME: Add a parameter to identify which object is being finalized when // MCJIT supports multiple modules. +// FIXME: Provide a way to separate code emission, relocations and page +// protection in the interface. void MCJIT::finalizeObject() { // If the module hasn't been compiled, just do that. if (!isCompiled) { // If the call to Dyld.resolveRelocations() is removed from emitObject() // we'll need to do that here. emitObject(M); + + // Set page permissions. + MemMgr->applyPermissions(); + return; } // Resolve any relocations. Dyld.resolveRelocations(); + + // Set page permissions. + MemMgr->applyPermissions(); } void *MCJIT::getPointerToBasicBlock(BasicBlock *BB) { |