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
diff --git a/lib/MC/MCAssembler.cpp b/lib/MC/MCAssembler.cpp
index 4b78dc0..e2d7de9 100644
--- a/lib/MC/MCAssembler.cpp
+++ b/lib/MC/MCAssembler.cpp
@@ -1281,17 +1281,13 @@
// Align this section if necessary by adding padding bytes to the previous
// section.
- if (uint64_t Pad = OffsetToAlignment(Address, it->getAlignment())) {
- assert(Prev && "Missing prev section!");
- Prev->setFileSize(Prev->getFileSize() + Pad);
+ if (uint64_t Pad = OffsetToAlignment(Address, it->getAlignment()))
Address += Pad;
- }
SD.setAddress(Address);
LayoutSection(SD);
Address += SD.getSize();
- Prev = &SD;
}
DEBUG_WITH_TYPE("mc-dump", {