[binutils-gdb] When setting the date stamp on an archive, honor the SOURCE_DATE_EPOCH environment variable

Nick Clifton via Binutils-cvs <[email protected]>
Newsgroups gmane.comp.gnu.binutils.cvs
Message-ID <[email protected]>
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=a2dd0aa39f9f95da718b375662b8c62f4d8ce833

commit a2dd0aa39f9f95da718b375662b8c62f4d8ce833
Author: Manuel Jacob <[email protected]>
Date:   Tue Apr 21 14:59:50 2026 +0100

    When setting the date stamp on an archive, honor the SOURCE_DATE_EPOCH environment variable

Diff:
---
 bfd/archive.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bfd/archive.c b/bfd/archive.c
index db978dfea2c..44030eb3d63 100644
--- a/bfd/archive.c
+++ b/bfd/archive.c
@@ -2915,7 +2915,7 @@ _bfd_coff_write_armap (bfd *arch,
     return false;
   _bfd_ar_spacepad (hdr.ar_date, sizeof (hdr.ar_date), "%ld",
 		    ((arch->flags & BFD_DETERMINISTIC_OUTPUT) == 0
-		     ? time (NULL) : 0));
+		     ? bfd_get_current_time (0) : 0));
   /* This, at least, is what Intel coff sets the values to.  */
   _bfd_ar_spacepad (hdr.ar_uid, sizeof (hdr.ar_uid), "%ld", 0);
   _bfd_ar_spacepad (hdr.ar_gid, sizeof (hdr.ar_gid), "%ld", 0);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.