[llvm] r196341 - Produce deterministic coff files.
Rafael Espindola
rafael.espindola at gmail.com
Tue Dec 3 18:02:56 PST 2013
Author: rafael
Date: Tue Dec 3 20:02:55 2013
New Revision: 196341
URL: http://llvm.org/viewvc/llvm-project?rev=196341&view=rev
Log:
Produce deterministic coff files.
Added:
llvm/trunk/test/MC/COFF/timestamp.s
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=196341&r1=196340&r2=196341&view=diff
==============================================================================
--- llvm/trunk/lib/MC/WinCOFFObjectWriter.cpp (original)
+++ llvm/trunk/lib/MC/WinCOFFObjectWriter.cpp Tue Dec 3 20:02:55 2013
@@ -845,7 +845,8 @@ void WinCOFFObjectWriter::WriteObject(MC
Header.PointerToSymbolTable = offset;
- Header.TimeDateStamp = sys::TimeValue::now().toEpochTime();
+ // We want a deterministic output. It looks like GUN as also writes 0 in here.
+ Header.TimeDateStamp = 0;
// Write it all to disk...
WriteFileHeader(Header);
Added: llvm/trunk/test/MC/COFF/timestamp.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/COFF/timestamp.s?rev=196341&view=auto
==============================================================================
--- llvm/trunk/test/MC/COFF/timestamp.s (added)
+++ llvm/trunk/test/MC/COFF/timestamp.s Tue Dec 3 20:02:55 2013
@@ -0,0 +1,4 @@
+// RUN: llvm-mc -filetype=obj -triple i686-pc-win32 %s -o - | llvm-readobj -h | FileCheck %s
+
+// CHECK: ImageFileHeader {
+// CHECK: TimeDateStamp: {{.*}} (0x0)
More information about the llvm-commits
mailing list