From f8b8ad77a8b5632886a4cfe41d798bae7277efcb 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98027 91177308-0d34-0410-b5e6-96231b3b80d8 --- 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", {