diff options
author | Preston Gurd <preston.gurd@intel.com> | 2012-04-12 20:13:57 +0000 |
---|---|---|
committer | Preston Gurd <preston.gurd@intel.com> | 2012-04-12 20:13:57 +0000 |
commit | c68dda815e64fb2fb463318d1eaa304e22199d50 (patch) | |
tree | 10f153529980e0bb8b0b15da7b9daddf04cb8d44 /lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h | |
parent | f0bcecc0d59455add4367204a198949d807fe1da (diff) |
This patch improves the MCJIT runtime dynamic loader by adding new handling
of zero-initialized sections, virtual sections and common symbols
and preventing the loading of sections which are not required for
execution such as debug information.
Patch by Andy Kaylor!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154610 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h')
-rw-r--r-- | lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h index d6430a91c2..bf678af6ec 100644 --- a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h +++ b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h @@ -110,6 +110,9 @@ protected: StringMap<SymbolLoc> SymbolTable; typedef DenseMap<const char*, SymbolLoc> LocalSymbolMap; + // Keep a map of common symbols to their sizes + typedef std::map<SymbolRef, unsigned> CommonSymbolMap; + // For each symbol, keep a list of relocations based on it. Anytime // its address is reassigned (the JIT re-compiled the function, e.g.), // the relocations get re-resolved. @@ -149,6 +152,12 @@ protected: return (uint8_t*)Sections[SectionID].Address; } + /// \brief Emits a section containing common symbols. + /// \return SectionID. + unsigned emitCommonSymbols(const CommonSymbolMap &Map, + uint64_t TotalSize, + LocalSymbolMap &Symbols); + /// \brief Emits section data from the object file to the MemoryManager. /// \param IsCode if it's true then allocateCodeSection() will be /// used for emmits, else allocateDataSection() will be used. |