diff options
author | Jim Grosbach <grosbach@apple.com> | 2011-03-22 01:06:42 +0000 |
---|---|---|
committer | Jim Grosbach <grosbach@apple.com> | 2011-03-22 01:06:42 +0000 |
commit | f922910494377909b4cf2a0b73f509b2b1925799 (patch) | |
tree | c37590a3359f2455da81da8d741d996bb40c0a79 /lib/ExecutionEngine/RuntimeDyld | |
parent | bd17478f2f6dd3630c4e2fafaa71e2424e08c96e (diff) | |
download | external_llvm-f922910494377909b4cf2a0b73f509b2b1925799.zip external_llvm-f922910494377909b4cf2a0b73f509b2b1925799.tar.gz external_llvm-f922910494377909b4cf2a0b73f509b2b1925799.tar.bz2 |
Hook up the MCJIT to the RuntimeDyld library.
Lots of cleanup to make the interfaces prettier, use the JITMemoryManager,
handle multiple functions and modules, etc.. This gets far enough that
the MCJIT compiles and runs code, though.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128052 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine/RuntimeDyld')
-rw-r--r-- | lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp index 3186bf2..a57055e 100644 --- a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp +++ b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp @@ -145,6 +145,10 @@ loadSegment32(const MachOObject *Obj, SymbolTable[Name] = Address; } + // We've loaded the section; now mark the functions in it as executable. + // FIXME: We really should use the JITMemoryManager for this. + sys::Memory::setRangeExecutable(Data.base(), Data.size()); + delete SectionBases; return false; } @@ -220,12 +224,14 @@ loadSegment64(const MachOObject *Obj, SymbolTable[Name] = Address; } + // We've loaded the section; now mark the functions in it as executable. + // FIXME: We really should use the JITMemoryManager for this. + sys::Memory::setRangeExecutable(Data.base(), Data.size()); + delete SectionBases; return false; } - - bool RuntimeDyldImpl::loadObject(MemoryBuffer *InputBuffer) { // If the linker is in an error state, don't do anything. if (hasError()) |