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

This commit is contained in:
Manuel Jacob 2026-04-21 14:59:50 +01:00 committed by Nick Clifton
parent c365a263f5
commit a2dd0aa39f

View file

@ -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);