summaryrefslogtreecommitdiff
path: root/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
diff options
context:
space:
mode:
authorJim Grosbach <grosbach@apple.com>2011-03-22 01:06:42 +0000
committerJim Grosbach <grosbach@apple.com>2011-03-22 01:06:42 +0000
commitf922910494377909b4cf2a0b73f509b2b1925799 (patch)
treec37590a3359f2455da81da8d741d996bb40c0a79 /lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
parentbd17478f2f6dd3630c4e2fafaa71e2424e08c96e (diff)
downloadllvm-f922910494377909b4cf2a0b73f509b2b1925799.tar.gz
llvm-f922910494377909b4cf2a0b73f509b2b1925799.tar.bz2
llvm-f922910494377909b4cf2a0b73f509b2b1925799.tar.xz
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/RuntimeDyld.cpp')
-rw-r--r--lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
index 3186bf26b2..a57055eb8d 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())