aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h')
-rw-r--r--lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h27
1 files changed, 23 insertions, 4 deletions
diff --git a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h
index c153ee1..412cf20 100644
--- a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h
+++ b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h
@@ -90,9 +90,17 @@ public:
/// used to make a relocation section relative instead of symbol relative.
int64_t Addend;
+ struct SectionPair {
+ uint32_t SectionA;
+ uint32_t SectionB;
+ };
+
/// SymOffset - Section offset of the relocation entry's symbol (used for GOT
/// lookup).
- uint64_t SymOffset;
+ union {
+ uint64_t SymOffset;
+ SectionPair Sections;
+ };
/// True if this is a PCRel relocation (MachO specific).
bool IsPCRel;
@@ -113,6 +121,16 @@ public:
bool IsPCRel, unsigned Size)
: SectionID(id), Offset(offset), RelType(type), Addend(addend),
SymOffset(0), IsPCRel(IsPCRel), Size(Size) {}
+
+ RelocationEntry(unsigned id, uint64_t offset, uint32_t type, int64_t addend,
+ unsigned SectionA, uint64_t SectionAOffset, unsigned SectionB,
+ uint64_t SectionBOffset, bool IsPCRel, unsigned Size)
+ : SectionID(id), Offset(offset), RelType(type),
+ Addend(SectionAOffset - SectionBOffset + addend), IsPCRel(IsPCRel),
+ Size(Size) {
+ Sections.SectionA = SectionA;
+ Sections.SectionB = SectionB;
+ }
};
class RelocationValueRef {
@@ -121,7 +139,8 @@ public:
uint64_t Offset;
int64_t Addend;
const char *SymbolName;
- RelocationValueRef() : SectionID(0), Offset(0), Addend(0), SymbolName(0) {}
+ RelocationValueRef() : SectionID(0), Offset(0), Addend(0),
+ SymbolName(nullptr) {}
inline bool operator==(const RelocationValueRef &Other) const {
return SectionID == Other.SectionID && Offset == Other.Offset &&
@@ -335,7 +354,7 @@ public:
// Work in progress.
SymbolTableMap::const_iterator pos = GlobalSymbolTable.find(Name);
if (pos == GlobalSymbolTable.end())
- return 0;
+ return nullptr;
SymbolLoc Loc = pos->second;
return getSectionAddress(Loc.first) + Loc.second;
}
@@ -372,7 +391,7 @@ public:
virtual void deregisterEHFrames();
- virtual void finalizeLoad(ObjSectionToIDMap &SectionMap) {}
+ virtual void finalizeLoad(ObjectImage &ObjImg, ObjSectionToIDMap &SectionMap) {}
};
} // end namespace llvm