This is the mail archive of the binutils-cvs@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] Ensure that the timestamp in PE/COFF headers is always initialised.


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=1c5f704fc035bc705dee887418f42cb8bca24b5d

commit 1c5f704fc035bc705dee887418f42cb8bca24b5d
Author: Nick Clifton <nickc@redhat.com>
Date:   Tue Sep 27 12:08:19 2016 +0100

    Ensure that the timestamp in PE/COFF headers is always initialised.
    
    	PR ld/20634
    	* peXXigen.c (_bfd_XXi_only_swap_filehdr_out): Put 0 in the
    	timestamp field if real time values are not being stored.

Diff:
---
 bfd/ChangeLog  | 6 ++++++
 bfd/peXXigen.c | 2 ++
 2 files changed, 8 insertions(+)

diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index b95d68c..f332490 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,9 @@
+2016-09-27  Nick Clifton  <nickc@redhat.com>
+
+	PR ld/20634
+	* peXXigen.c (_bfd_XXi_only_swap_filehdr_out): Put 0 in the
+	timestamp field if real time values are not being stored.
+
 2016-09-26  Vlad Zakharov  <vzakhar@synopsys.com>
 
 	* warning.m4 (AC_EGREP_CPP_FOR_BUILD): Introduce macro
diff --git a/bfd/peXXigen.c b/bfd/peXXigen.c
index c92c1ea..d713d96 100644
--- a/bfd/peXXigen.c
+++ b/bfd/peXXigen.c
@@ -879,6 +879,8 @@ _bfd_XXi_only_swap_filehdr_out (bfd * abfd, void * in, void * out)
   /* Only use a real timestamp if the option was chosen.  */
   if ((pe_data (abfd)->insert_timestamp))
     H_PUT_32 (abfd, time (0), filehdr_out->f_timdat);
+  else
+    H_PUT_32 (abfd, 0, filehdr_out->f_timdat);
 
   PUT_FILEHDR_SYMPTR (abfd, filehdr_in->f_symptr,
 		      filehdr_out->f_symptr);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]