MC/Mach-O: Don't adjust section sizes when aligning zero fill sections, just pad the address.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98027 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Daniel Dunbar 2010-03-09 01:12:20 +00:00
parent 768069ee7a
commit f8b8ad77a8

View File

@ -1281,17 +1281,13 @@ void MCAssembler::Finish() {
// Align this section if necessary by adding padding bytes to the previous // Align this section if necessary by adding padding bytes to the previous
// section. // section.
if (uint64_t Pad = OffsetToAlignment(Address, it->getAlignment())) { if (uint64_t Pad = OffsetToAlignment(Address, it->getAlignment()))
assert(Prev && "Missing prev section!");
Prev->setFileSize(Prev->getFileSize() + Pad);
Address += Pad; Address += Pad;
}
SD.setAddress(Address); SD.setAddress(Address);
LayoutSection(SD); LayoutSection(SD);
Address += SD.getSize(); Address += SD.getSize();
Prev = &SD;
} }
DEBUG_WITH_TYPE("mc-dump", { DEBUG_WITH_TYPE("mc-dump", {