diff --git a/lib/MC/WinCOFFObjectWriter.cpp b/lib/MC/WinCOFFObjectWriter.cpp index ce6dcfda8ff..c519a9d6d5e 100644 --- a/lib/MC/WinCOFFObjectWriter.cpp +++ b/lib/MC/WinCOFFObjectWriter.cpp @@ -940,7 +940,8 @@ void WinCOFFObjectWriter::WriteObject(MCAssembler &Asm, if (IsPhysicalSection(Sec)) { // Align the section data to a four byte boundary. - Sec->Header.PointerToRawData = RoundUpToAlignment(offset, 4); + offset = RoundUpToAlignment(offset, 4); + Sec->Header.PointerToRawData = offset; offset += Sec->Header.SizeOfRawData; }