aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm-project/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h')
-rw-r--r--contrib/llvm-project/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h22
1 files changed, 15 insertions, 7 deletions
diff --git a/contrib/llvm-project/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h b/contrib/llvm-project/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h
index d34fae9aaf0c..a5bc181f8af9 100644
--- a/contrib/llvm-project/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h
+++ b/contrib/llvm-project/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h
@@ -462,16 +462,26 @@ public:
loadObject(const object::ObjectFile &Obj) = 0;
uint64_t getSectionLoadAddress(unsigned SectionID) const {
- return Sections[SectionID].getLoadAddress();
+ if (SectionID == AbsoluteSymbolSection)
+ return 0;
+ else
+ return Sections[SectionID].getLoadAddress();
}
uint8_t *getSectionAddress(unsigned SectionID) const {
- return Sections[SectionID].getAddress();
+ if (SectionID == AbsoluteSymbolSection)
+ return nullptr;
+ else
+ return Sections[SectionID].getAddress();
}
StringRef getSectionContent(unsigned SectionID) const {
- return StringRef(reinterpret_cast<char *>(Sections[SectionID].getAddress()),
- Sections[SectionID].getStubOffset() + getMaxStubSize());
+ if (SectionID == AbsoluteSymbolSection)
+ return {};
+ else
+ return StringRef(
+ reinterpret_cast<char *>(Sections[SectionID].getAddress()),
+ Sections[SectionID].getStubOffset() + getMaxStubSize());
}
uint8_t* getSymbolLocalAddress(StringRef Name) const {
@@ -519,9 +529,7 @@ public:
for (auto &KV : GlobalSymbolTable) {
auto SectionID = KV.second.getSectionID();
- uint64_t SectionAddr = 0;
- if (SectionID != AbsoluteSymbolSection)
- SectionAddr = getSectionLoadAddress(SectionID);
+ uint64_t SectionAddr = getSectionLoadAddress(SectionID);
Result[KV.first()] =
JITEvaluatedSymbol(SectionAddr + KV.second.getOffset(), KV.second.getFlags());
}