From 5cc53c34c366fa8b6e389c7c1751c50c0f64041a Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Thu, 18 Sep 2008 07:54:21 +0000 Subject: Preliminary support for systems which require changing JIT memory regions privilege from read / write to read / executable. llvm-svn: 56303 --- llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp') diff --git a/llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp b/llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp index 02752a01cdd..4803fdf153d 100644 --- a/llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp +++ b/llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp @@ -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; -- cgit v1.2.3