const MCSection &Sec, uint64_t FileOffset,
uint64_t RelocationsStart,
unsigned NumRelocations) {
- const MCSectionData &SD = Sec.getSectionData();
uint64_t SectionSize = Layout.getSectionAddressSize(&Sec);
const MCSectionMachO &Section = cast<MCSectionMachO>(Sec);
WriteBytes(Section.getSectionName(), 16);
WriteBytes(Section.getSegmentName(), 16);
if (is64Bit()) {
- Write64(getSectionAddress(&SD.getSection())); // address
+ Write64(getSectionAddress(&Sec)); // address
Write64(SectionSize); // size
} else {
- Write32(getSectionAddress(&SD.getSection())); // address
+ Write32(getSectionAddress(&Sec)); // address
Write32(SectionSize); // size
}
Write32(FileOffset);
Write32(NumRelocations ? RelocationsStart : 0);
Write32(NumRelocations);
Write32(Flags);
- Write32(IndirectSymBase.lookup(&SD.getSection())); // reserved1
+ Write32(IndirectSymBase.lookup(&Sec)); // reserved1
Write32(Section.getStubSize()); // reserved2
if (is64Bit())
Write32(0); // reserved3
for (MCAssembler::const_iterator it = Asm.begin(),
ie = Asm.end(); it != ie; ++it) {
const MCSection &Sec = *it;
- const MCSectionData &SD = it->getSectionData();
uint64_t Address = getSectionAddress(&Sec);
uint64_t Size = Layout.getSectionAddressSize(&Sec);
uint64_t FileSize = Layout.getSectionFileSize(&Sec);
VMSize = std::max(VMSize, Address + Size);
- if (SD.getSection().isVirtualSection())
+ if (it->isVirtualSection())
continue;
SectionDataSize = std::max(SectionDataSize, Address + Size);