diff options
Diffstat (limited to 'llvm/lib/ExecutionEngine/SectionMemoryManager.cpp')
-rw-r--r-- | llvm/lib/ExecutionEngine/SectionMemoryManager.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/ExecutionEngine/SectionMemoryManager.cpp b/llvm/lib/ExecutionEngine/SectionMemoryManager.cpp index 925049b2..febcabf 100644 --- a/llvm/lib/ExecutionEngine/SectionMemoryManager.cpp +++ b/llvm/lib/ExecutionEngine/SectionMemoryManager.cpp @@ -112,6 +112,15 @@ uint8_t *SectionMemoryManager::allocateSection( // Save this address as the basis for our next request MemGroup.Near = MB; + // Copy the address to all the other groups, if they have not + // been initialized. + if (CodeMem.Near.base() == 0) + CodeMem.Near = MB; + if (RODataMem.Near.base() == 0) + RODataMem.Near = MB; + if (RWDataMem.Near.base() == 0) + RWDataMem.Near = MB; + // Remember that we allocated this memory MemGroup.AllocatedMem.push_back(MB); Addr = (uintptr_t)MB.base(); |