[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 07:52:30 PST 2019
DiggerLin created this revision.
DiggerLin added reviewers: jasonliu, daltenty, sfertile, hubert.reinterpretcast.
Herald added subscribers: llvm-commits, hiraditya.
Herald added a project: LLVM.
if the size of Csect is zero, the Csect do not need write any data into sections
for example, the TOC Csect has zero size, it do not need invoke a
Asm.writeSectionData(W.OS, Csect.MCCsect, Layout);
Repository:
rG LLVM Github Monorepo
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.232567.patch
Type: text/x-patch
Size: 590 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191206/72340cfb/attachment.bin>
More information about the llvm-commits
mailing list