[PATCH] D51149: MC: Don't align COFF section contents.
Peter Collingbourne via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 22 22:40:37 PDT 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rL340514: MC: Don't align COFF section contents. (authored by pcc, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D51149?vs=162127&id=162136#toc
Repository:
rL LLVM
https://reviews.llvm.org/D51149
Files:
llvm/trunk/lib/MC/WinCOFFObjectWriter.cpp
llvm/trunk/test/MC/COFF/directive-section-characteristics.ll
Index: llvm/trunk/test/MC/COFF/directive-section-characteristics.ll
===================================================================
--- llvm/trunk/test/MC/COFF/directive-section-characteristics.ll
+++ llvm/trunk/test/MC/COFF/directive-section-characteristics.ll
@@ -13,7 +13,7 @@
; CHECK: Section {
; CHECK: Name: .drectve
-; CHECK: PointerToRawData: 0xB8
+; CHECK: PointerToRawData: 0xB5
; CHECK: Characteristics [
; CHECK: IMAGE_SCN_ALIGN_1BYTES
; CHECK: IMAGE_SCN_LNK_INFO
Index: llvm/trunk/lib/MC/WinCOFFObjectWriter.cpp
===================================================================
--- llvm/trunk/lib/MC/WinCOFFObjectWriter.cpp
+++ llvm/trunk/lib/MC/WinCOFFObjectWriter.cpp
@@ -620,14 +620,9 @@
// Write the section contents.
if (Sec.Header.PointerToRawData != 0) {
- assert(W.OS.tell() <= Sec.Header.PointerToRawData &&
+ assert(W.OS.tell() == Sec.Header.PointerToRawData &&
"Section::PointerToRawData is insane!");
- unsigned PaddingSize = Sec.Header.PointerToRawData - W.OS.tell();
- assert(PaddingSize < 4 &&
- "Should only need at most three bytes of padding!");
- W.OS.write_zeros(PaddingSize);
-
uint32_t CRC = writeSectionContents(Asm, Layout, MCSec);
// Update the section definition auxiliary symbol to record the CRC.
@@ -912,10 +907,7 @@
Sec->Header.SizeOfRawData = Layout.getSectionAddressSize(&Section);
if (IsPhysicalSection(Sec)) {
- // Align the section data to a four byte boundary.
- Offset = alignTo(Offset, 4);
Sec->Header.PointerToRawData = Offset;
-
Offset += Sec->Header.SizeOfRawData;
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D51149.162136.patch
Type: text/x-patch
Size: 1652 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180823/4795f635/attachment.bin>
More information about the llvm-commits
mailing list