aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
diff options
context:
space:
mode:
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 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())