[llvm] r246905 - WinCOFFObjectWriter.cpp: Roll back TimeDateStamp along ENABLE_TIMESTAMPS.
NAKAMURA Takumi via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 4 18:17:49 PDT 2015
Author: chapuni
Date: Fri Sep 4 20:17:49 2015
New Revision: 246905
URL: http://llvm.org/viewvc/llvm-project?rev=246905&view=rev
Log:
WinCOFFObjectWriter.cpp: Roll back TimeDateStamp along ENABLE_TIMESTAMPS.
We want a deterministic output. GNU AS leaves it zero.
FIXME: It may be optional by its user, like llc and clang.
Modified:
llvm/trunk/lib/MC/WinCOFFObjectWriter.cpp
Modified: llvm/trunk/lib/MC/WinCOFFObjectWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/WinCOFFObjectWriter.cpp?rev=246905&r1=246904&r2=246905&view=diff
==============================================================================
--- llvm/trunk/lib/MC/WinCOFFObjectWriter.cpp (original)
+++ llvm/trunk/lib/MC/WinCOFFObjectWriter.cpp Fri Sep 4 20:17:49 2015
@@ -1013,12 +1013,17 @@ void WinCOFFObjectWriter::writeObject(MC
Header.PointerToSymbolTable = offset;
+#if (ENABLE_TIMESTAMPS == 1)
// MS LINK expects to be able to use this timestamp to implement their
// /INCREMENTAL feature.
std::time_t Now = time(nullptr);
if (Now < 0 || !isUInt<32>(Now))
Now = UINT32_MAX;
Header.TimeDateStamp = Now;
+#else
+ // We want a deterministic output. It looks like GNU as also writes 0 in here.
+ Header.TimeDateStamp = 0;
+#endif
// Write it all to disk...
WriteFileHeader(Header);
More information about the llvm-commits
mailing list