Ensure that the timestamp in PE/COFF headers is always initialised.
authorNick Clifton <nickc@redhat.com>
Tue, 27 Sep 2016 11:08:19 +0000 (12:08 +0100)
committerNick Clifton <nickc@redhat.com>
Tue, 27 Sep 2016 11:08:19 +0000 (12:08 +0100)
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.

bfd/ChangeLog
bfd/peXXigen.c

index b95d68ca621040faf001f5e4ff8db8e34693b01b..f332490f3bd554d9f8ccdf27b17529c301980a2e 100644 (file)
@@ -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
index c92c1eaf5c0746b0ef48e3ce378224abec581c2f..d713d96e0f8161cc78a3df8d182ed7da43882c08 100644 (file)
@@ -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);