@@ -462,16 +462,26 @@ class RuntimeDyldImpl {
462
462
loadObject (const object::ObjectFile &Obj) = 0;
463
463
464
464
uint64_t getSectionLoadAddress (unsigned SectionID) const {
465
- return Sections[SectionID].getLoadAddress ();
465
+ if (SectionID == AbsoluteSymbolSection)
466
+ return 0 ;
467
+ else
468
+ return Sections[SectionID].getLoadAddress ();
466
469
}
467
470
468
471
uint8_t *getSectionAddress (unsigned SectionID) const {
469
- return Sections[SectionID].getAddress ();
472
+ if (SectionID == AbsoluteSymbolSection)
473
+ return nullptr ;
474
+ else
475
+ return Sections[SectionID].getAddress ();
470
476
}
471
477
472
478
StringRef getSectionContent (unsigned SectionID) const {
473
- return StringRef (reinterpret_cast <char *>(Sections[SectionID].getAddress ()),
474
- Sections[SectionID].getStubOffset () + getMaxStubSize ());
479
+ if (SectionID == AbsoluteSymbolSection)
480
+ return {};
481
+ else
482
+ return StringRef (
483
+ reinterpret_cast <char *>(Sections[SectionID].getAddress ()),
484
+ Sections[SectionID].getStubOffset () + getMaxStubSize ());
475
485
}
476
486
477
487
uint8_t * getSymbolLocalAddress (StringRef Name) const {
@@ -519,9 +529,7 @@ class RuntimeDyldImpl {
519
529
520
530
for (auto &KV : GlobalSymbolTable) {
521
531
auto SectionID = KV.second .getSectionID ();
522
- uint64_t SectionAddr = 0 ;
523
- if (SectionID != AbsoluteSymbolSection)
524
- SectionAddr = getSectionLoadAddress (SectionID);
532
+ uint64_t SectionAddr = getSectionLoadAddress (SectionID);
525
533
Result[KV.first ()] =
526
534
JITEvaluatedSymbol (SectionAddr + KV.second .getOffset (), KV.second .getFlags ());
527
535
}
0 commit comments