summaryrefslogtreecommitdiff
path: root/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2014-03-20 21:06:46 +0000
committerLang Hames <lhames@gmail.com>2014-03-20 21:06:46 +0000
commit20425d92dfb39377e6b8eb111971d5ac3042421a (patch)
tree108613187a8bd7d182f7d7499f011d8288e4e1c1 /lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h
parentee3242ed0b25f1b2d53d47eabe727035f387123a (diff)
downloadllvm-20425d92dfb39377e6b8eb111971d5ac3042421a.tar.gz
llvm-20425d92dfb39377e6b8eb111971d5ac3042421a.tar.bz2
llvm-20425d92dfb39377e6b8eb111971d5ac3042421a.tar.xz
Add an option to MCJIT to have it forward all sections to the
RTDyldMemoryManager, regardless of whether it thinks they're "required for execution". Currently, RuntimeDyld only passes sections that are "required for execution" to the RTDyldMemoryManager, and takes "required for execution" to mean exactly "contains symbols or relocations". There are two problems with this: (1) It can drop sections with anonymous data that is referenced by code. (2) It leaves the JIT client no way to inspect interesting sections that aren't actually required to run the program (e.g dwarf sections). A test case is still in the works. Future work: We may want to replace this with a generic section filtering mechanism, but that will require more consideration. For now, this flag at least allows clients to volunteer to do the filtering themselves. Fixes <rdar://problem/15177691>. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204398 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h')
-rw-r--r--lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h
index 8fd55920f2..0b7de17a6e 100644
--- a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h
+++ b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h
@@ -187,6 +187,10 @@ protected:
Triple::ArchType Arch;
bool IsTargetLittleEndian;
+ // True if all sections should be passed to the memory manager, false if only
+ // sections containing relocations should be. Defaults to 'false'.
+ bool ProcessAllSections;
+
// This mutex prevents simultaneously loading objects from two different
// threads. This keeps us from having to protect individual data structures
// and guarantees that section allocation requests to the memory manager
@@ -320,10 +324,15 @@ protected:
unsigned computeSectionStubBufSize(ObjectImage &Obj, const SectionRef &Section);
public:
- RuntimeDyldImpl(RTDyldMemoryManager *mm) : MemMgr(mm), HasError(false) {}
+ RuntimeDyldImpl(RTDyldMemoryManager *mm)
+ : MemMgr(mm), ProcessAllSections(false), HasError(false) {}
virtual ~RuntimeDyldImpl();
+ void setProcessAllSections(bool ProcessAllSections) {
+ this->ProcessAllSections = ProcessAllSections;
+ }
+
ObjectImage* loadObject(ObjectImage* InputObject);
void *getSymbolAddress(StringRef Name) {