Preliminary support for systems which require changing JIT memory regions privilege...
[oota-llvm.git] / lib / ExecutionEngine / JIT / JITEmitter.cpp
index 02752a01cdd315f0eeddb3f94c3d671238183c68..4803fdf153d20233bbfc6a1a0ad3943b948acb26 100644 (file)
@@ -925,6 +925,9 @@ bool JITEmitter::finishFunction(MachineFunction &F) {
        << Relocations.size() << " relocations\n";
   Relocations.clear();
 
+  // Mark code region readable and executable if it's not so already.
+  sys::Memory::SetRXPrivilege(FnStart, FnEnd-FnStart);
+
 #ifndef NDEBUG
   {
   DOUT << std::hex;