1

The PE-Header of Windows executables contains as its third field the "Timestamp at compile time". To reach reproducibility in our build process we would like to set the time (Epoch seconds) to zero (=1970-01-01 00:00:00).

Does this have any side-effects? According to

https://support.microsoft.com/en-us/kb/164151

the header does not impact the function.

Are there compiler/linker flags to get this automatically?

Kind regards Stefan S.

  • though i see jason stating that windows doesn't care about time stamp i vaguely remember it is used for binding or some such things scrape oldnewthing by raymond chen for timestamp you should land the tidbit – blabb Mar 3 '16 at 20:33
  • I think this is what you're thinking of, @blabb: blogs.msdn.microsoft.com/oldnewthing/20100318-00/?p=14563 – Brendan Dolan-Gavitt Mar 4 '16 at 1:34
  • @blabb: Yes, but that's for DLLs and Stefan is asking about EXEs. Nonetheless, I'll update my answer to reflect this. Thanks. – Jason Geffner Mar 4 '16 at 1:44
  • @BrendanDolan-Gavitt yes that is the article jason you are welcome – blabb Mar 4 '16 at 6:10
5

Does this have any side-effects?

No, the Windows loader doesn't care about the timestamp in an EXE's PE header.

Are there compiler/linker flags to get this automatically?

No, Visual C++'s link.exe does not have a command line switch for specifying the timestamp to use. (And Visual C++'s cl.exe doesn't apply since the PE timestamp is a linking timestamp, not a compiling timestamp.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.