From e3986eb967d82707399eff1ce7b8364f3f75af9b Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Tue, 9 Mar 2010 01:12:20 +0000 Subject: [PATCH] MC/Mach-O: Don't adjust section sizes when aligning zero fill sections, just pad the address. llvm-svn: 98027 --- lib/MC/MCAssembler.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/MC/MCAssembler.cpp b/lib/MC/MCAssembler.cpp index 4b78dc034fc..e2d7de9a0e9 100644 --- a/lib/MC/MCAssembler.cpp +++ b/lib/MC/MCAssembler.cpp @@ -1281,17 +1281,13 @@ void MCAssembler::Finish() { // 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", {