diff options
author | Tim Northover <Tim.Northover@arm.com> | 2012-10-29 10:47:04 +0000 |
---|---|---|
committer | Tim Northover <Tim.Northover@arm.com> | 2012-10-29 10:47:04 +0000 |
commit | f00677d74f1be5b4c7c73e1681a64c9062f4c7ee (patch) | |
tree | 055c21d0903a30c5697b6969427135c3f5a5bbd8 /lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h | |
parent | a41dce3c642e50775352cce49e3a3d0cd004d393 (diff) | |
download | llvm-f00677d74f1be5b4c7c73e1681a64c9062f4c7ee.tar.gz llvm-f00677d74f1be5b4c7c73e1681a64c9062f4c7ee.tar.bz2 llvm-f00677d74f1be5b4c7c73e1681a64c9062f4c7ee.tar.xz |
Make use of common-symbol alignment info in ELF loader.
Patch by Amara Emerson.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166919 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h')
-rw-r--r-- | lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h index 45633e735c..3baec3cf2a 100644 --- a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h +++ b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h @@ -140,8 +140,10 @@ protected: typedef StringMap<SymbolLoc> SymbolTableMap; SymbolTableMap GlobalSymbolTable; - // Keep a map of common symbols to their sizes - typedef std::map<SymbolRef, unsigned> CommonSymbolMap; + // Pair representing the size and alignment requirement for a common symbol. + typedef std::pair<unsigned, unsigned> CommonSymbolInfo; + // Keep a map of common symbols to their info pairs + typedef std::map<SymbolRef, CommonSymbolInfo> 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.), @@ -192,6 +194,13 @@ protected: return (uint8_t*)Sections[SectionID].Address; } + // Subclasses can override this method to get the alignment requirement of + // a common symbol. Returns no alignment requirement if not implemented. + virtual unsigned getCommonSymbolAlignment(const SymbolRef &Sym) { + return 0; + } + + void writeInt16BE(uint8_t *Addr, uint16_t Value) { if (sys::isLittleEndianHost()) Value = sys::SwapByteOrder(Value); |