MC/Mach-O: Don't adjust section sizes when aligning zero fill sections, just pad...
authorDaniel Dunbar <daniel@zuster.org>
Tue, 9 Mar 2010 01:12:20 +0000 (01:12 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Tue, 9 Mar 2010 01:12:20 +0000 (01:12 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98027 91177308-0d34-0410-b5e6-96231b3b80d8

lib/MC/MCAssembler.cpp

index 4b78dc034fcf9cb163c12f608305f7145df6bf36..e2d7de9a0e9e3c62fd98e171adb14c9a730bb857 100644 (file)
@@ -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", {