diff options
author | Andrew Kaylor <andrew.kaylor@intel.com> | 2013-10-01 01:47:35 +0000 |
---|---|---|
committer | Andrew Kaylor <andrew.kaylor@intel.com> | 2013-10-01 01:47:35 +0000 |
commit | 8e9ec015348c5419b905c2ca6e39534429eda073 (patch) | |
tree | ef91e4612da9faa32322d7f2d4c33d71bc584334 /lib/ExecutionEngine/MCJIT/SectionMemoryManager.cpp | |
parent | 451c71d67b1dd324dcd76d771cf05bf7721bdc59 (diff) | |
download | llvm-8e9ec015348c5419b905c2ca6e39534429eda073.tar.gz llvm-8e9ec015348c5419b905c2ca6e39534429eda073.tar.bz2 llvm-8e9ec015348c5419b905c2ca6e39534429eda073.tar.xz |
Adding multiple module support for MCJIT.
Tests to follow.
PIC with small code model and EH frame handling will not work with multiple modules. There are also some rough edges to be smoothed out for remote target support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191722 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine/MCJIT/SectionMemoryManager.cpp')
-rw-r--r-- | lib/ExecutionEngine/MCJIT/SectionMemoryManager.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/ExecutionEngine/MCJIT/SectionMemoryManager.cpp b/lib/ExecutionEngine/MCJIT/SectionMemoryManager.cpp index 650832e129..5469c8374b 100644 --- a/lib/ExecutionEngine/MCJIT/SectionMemoryManager.cpp +++ b/lib/ExecutionEngine/MCJIT/SectionMemoryManager.cpp @@ -105,6 +105,9 @@ bool SectionMemoryManager::finalizeMemory(std::string *ErrMsg) // FIXME: Should in-progress permissions be reverted if an error occurs? error_code ec; + // Don't allow free memory blocks to be used after setting protection flags. + CodeMem.FreeMem.clear(); + // Make code memory executable. ec = applyMemoryGroupPermissions(CodeMem, sys::Memory::MF_READ | sys::Memory::MF_EXEC); @@ -115,6 +118,9 @@ bool SectionMemoryManager::finalizeMemory(std::string *ErrMsg) return true; } + // Don't allow free memory blocks to be used after setting protection flags. + RODataMem.FreeMem.clear(); + // Make read-only data memory read-only. ec = applyMemoryGroupPermissions(RODataMem, sys::Memory::MF_READ | sys::Memory::MF_EXEC); |