Loading...
--- dyld/dyld-1340/common/SwiftVisitor.cpp
+++ dyld/dyld-1231.3/common/SwiftVisitor.cpp
@@ -35,7 +35,6 @@
#include <assert.h>
using namespace metadata_visitor;
-using mach_o::Header;
//
// MARK: --- SwiftVisitor methods ---
@@ -77,21 +76,21 @@
#endif
__block std::optional<SwiftVisitor::SectionContent> sectionContent;
- ((const Header*)mf)->forEachSection(^(const Header::SegmentInfo& segInfo, const Header::SectionInfo& sectInfo, bool& stop) {
- if ( sectInfo.segmentName != segmentName )
+ mf->forEachSection(^(const dyld3::MachOFile::SectionInfo& sectInfo, bool malformedSectionRange, bool& stop) {
+ if ( (strcmp(sectInfo.segInfo.segName, segmentName) != 0) )
return;
- if ( sectInfo.sectionName != sectionName )
+ if ( strcmp(sectInfo.sectName, sectionName) != 0 )
return;
#if SUPPORT_VM_LAYOUT
- const void* targetValue = (const void*)(sectInfo.address + this->dylibMA->getSlide());
- ResolvedValue target(targetValue, VMAddress(sectInfo.address));
+ const void* targetValue = (const void*)(sectInfo.sectAddr + this->dylibMA->getSlide());
+ ResolvedValue target(targetValue, VMAddress(sectInfo.sectAddr));
#else
- VMOffset offsetInSegment(sectInfo.address - segInfo.vmaddr);
- ResolvedValue target(this->segments[sectInfo.segIndex], offsetInSegment);
+ VMOffset offsetInSegment(sectInfo.sectAddr - sectInfo.segInfo.vmAddr);
+ ResolvedValue target(this->segments[sectInfo.segInfo.segIndex], offsetInSegment);
#endif
sectionContent.emplace(std::move(target));
- sectionContent->sectSize = sectInfo.size;
+ sectionContent->sectSize = sectInfo.sectSize;
stop = true;
});