Skip to content

Commit

Permalink
cmd/ld: always set timestamp in PE header to 0
Browse files Browse the repository at this point in the history
Fixes #9756.

Change-Id: If4ee6fe10f8f90294ff9c5e7480371494094b111
Signed-off-by: Shenghou Ma <minux@golang.org>
Reviewed-on: https://go-review.googlesource.com/3740
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
  • Loading branch information
minux committed Feb 5, 2015
1 parent da4abda commit 9837620
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions doc/go1.5.txt
Expand Up @@ -19,6 +19,7 @@ testing/quick: support generation of arrays (https://golang.org/cl/3865)
Tools:

cmd/vet: better validation of struct tags (https://golang.org/cl/2685)
cmd/ld: no longer record build timestamp in Windows PE file header (https://golang.org/cl/3740)

Performance:

Expand Down
4 changes: 3 additions & 1 deletion src/cmd/ld/pe.c
Expand Up @@ -646,7 +646,9 @@ asmbpe(void)
addpersrc();

fh.NumberOfSections = nsect;
fh.TimeDateStamp = time(0);
// Being able to produce identical output for identical input is
// much more beneficial than having build timestamp in the header.
fh.TimeDateStamp = 0;
fh.Characteristics = IMAGE_FILE_RELOCS_STRIPPED|
IMAGE_FILE_EXECUTABLE_IMAGE|IMAGE_FILE_DEBUG_STRIPPED;
if (pe64) {
Expand Down

0 comments on commit 9837620

Please sign in to comment.