[PATCH] D71120: [NFC][AIX][XCOFF] if the size of Csect is zero, the Csect do not need write any data into sections

Digger via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 6 09:44:25 PST 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rG50d72fa1461b: [NFC][AIX][XCOFF] if the size of Csect is zero, the Csect do not need write any… (authored by DiggerLin).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D71120/new/

https://reviews.llvm.org/D71120

Files:
  llvm/lib/MC/XCOFFObjectWriter.cpp


Index: llvm/lib/MC/XCOFFObjectWriter.cpp
===================================================================
--- llvm/lib/MC/XCOFFObjectWriter.cpp
+++ llvm/lib/MC/XCOFFObjectWriter.cpp
@@ -368,7 +368,8 @@
       for (const auto &Csect : *Group) {
         if (uint32_t PaddingSize = Csect.Address - CurrentAddressLocation)
           W.OS.write_zeros(PaddingSize);
-        Asm.writeSectionData(W.OS, Csect.MCCsect, Layout);
+        if (Csect.Size)
+          Asm.writeSectionData(W.OS, Csect.MCCsect, Layout);
         CurrentAddressLocation = Csect.Address + Csect.Size;
       }
     }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D71120.232595.patch
Type: text/x-patch
Size: 590 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191206/20412679/attachment.bin>


More information about the llvm-commits mailing list