]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Use bfd_get_current_time in places where it is suitable
authorNick Clifton <nickc@redhat.com>
Mon, 2 Oct 2023 12:24:05 +0000 (13:24 +0100)
committerNick Clifton <nickc@redhat.com>
Mon, 2 Oct 2023 12:24:05 +0000 (13:24 +0100)
bfd/ChangeLog
bfd/peXXigen.c
ld/ChangeLog
ld/pe-dll.c

index 6c4e3e5295381390f694dc86c282847e0a3a7d74..851b47606c48736b61164e28c3b82c6fe7e600a1 100644 (file)
@@ -1,3 +1,8 @@
+2023-10-02  Nick Clifton  <nickc@redhat.com>
+
+       * peXXigen.c (_bfd_XXi_only_swap_filehdr_out): Use
+       bfd_get_current_time when filing in the timestamp.
+
 2023-09-29  Nick Clifton  <nickc@redhat.com>
 
        PR 30906
index 2f2968d48e8cb10c0204cb48ac684eda14322cca..641c259d04be14e58dd35e6d6be2c290d3f8bee2 100644 (file)
@@ -839,17 +839,7 @@ _bfd_XXi_only_swap_filehdr_out (bfd * abfd, void * in, void * out)
      option was chosen.  */
   if ((pe_data (abfd)->timestamp) == -1)
     {
-      time_t now;
-      char *source_date_epoch;
-
-      /* If the SOURCE_DATE_EPOCH environment variable is
-        defined then use that as the time, otherwise use
-        the current time.  */
-      source_date_epoch = getenv ("SOURCE_DATE_EPOCH");
-      if (source_date_epoch)
-       now = (time_t) strtoll (source_date_epoch, NULL, 10);
-      else
-       now = time (NULL);
+      time_t now = bfd_get_current_time (0);
       H_PUT_32 (abfd, now, filehdr_out->f_timdat);
     }
   else
index 3e41bdc294effc4b06f51ced832d561392fe57c6..4e4f5326d80b67cbeb0c52ff1d8728dd5215f0ba 100644 (file)
@@ -1,3 +1,8 @@
+2023-10-02  Nick Clifton  <nickc@redhat.com>
+
+       * pe-dll.c (fill_edata): Use bfd_get_current_time when filling in
+       the timestamp.
+
 2023-09-27  Hsinyuan Xavier  <TheLastLin@hotmail.com>
 
        PR 30875
index df08a57e644e52a73d1d220103fc76e2412cc869..fc83f5208d6e5e71cd1d3183e55a3e2824d5c430 100644 (file)
@@ -1232,15 +1232,7 @@ fill_edata (bfd *abfd, struct bfd_link_info *info ATTRIBUTE_UNUSED)
 
   if (pe_data (abfd)->timestamp == -1)
     {
-      time_t now;
-      char *source_date_epoch;
-
-      source_date_epoch = getenv ("SOURCE_DATE_EPOCH");
-      if (source_date_epoch)
-       now = (time_t) strtoll (source_date_epoch, NULL, 10);
-      else
-       now = time (NULL);
-
+      time_t now = bfd_get_current_time (0);
       H_PUT_32 (abfd, now, edata_d + 4);
     }
   else