summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/lib/MC/WinCOFFObjectWriter.cpp10
-rw-r--r--llvm/test/MC/COFF/directive-section-characteristics.ll2
2 files changed, 2 insertions, 10 deletions
diff --git a/llvm/lib/MC/WinCOFFObjectWriter.cpp b/llvm/lib/MC/WinCOFFObjectWriter.cpp
index 82c9fe76758..ab6fc2be633 100644
--- a/llvm/lib/MC/WinCOFFObjectWriter.cpp
+++ b/llvm/lib/MC/WinCOFFObjectWriter.cpp
@@ -620,14 +620,9 @@ void WinCOFFObjectWriter::writeSection(MCAssembler &Asm,
// 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 @@ void WinCOFFObjectWriter::assignFileOffsets(MCAssembler &Asm,
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;
}
diff --git a/llvm/test/MC/COFF/directive-section-characteristics.ll b/llvm/test/MC/COFF/directive-section-characteristics.ll
index a44c81d2262..eed2dbf598e 100644
--- a/llvm/test/MC/COFF/directive-section-characteristics.ll
+++ b/llvm/test/MC/COFF/directive-section-characteristics.ll
@@ -13,7 +13,7 @@ entry:
; CHECK: Section {
; CHECK: Name: .drectve
-; CHECK: PointerToRawData: 0xB8
+; CHECK: PointerToRawData: 0xB5
; CHECK: Characteristics [
; CHECK: IMAGE_SCN_ALIGN_1BYTES
; CHECK: IMAGE_SCN_LNK_INFO
OpenPOWER on IntegriCloud