diff options
author | Nick Clifton <nickc@redhat.com> | 2023-09-26 14:07:23 +0100 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2023-09-26 14:07:23 +0100 |
commit | 6f56739807051e82a6327ff184b01be67be37670 (patch) | |
tree | de68ace335c036865cc3dda48f599baf25cc9383 /bfd/archive64.c | |
parent | 0128542673364609a0b2e1d8a3f1896fc89584d2 (diff) | |
download | gdb-6f56739807051e82a6327ff184b01be67be37670.zip gdb-6f56739807051e82a6327ff184b01be67be37670.tar.gz gdb-6f56739807051e82a6327ff184b01be67be37670.tar.bz2 |
Allow the use of SOURCE_DATE_EPOCH in the timestamps for members of static archives.
(For some reason this commit was not applied at the time that the patch was approved).
Diffstat (limited to 'bfd/archive64.c')
-rw-r--r-- | bfd/archive64.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/bfd/archive64.c b/bfd/archive64.c index 63d2393..b80f3e8 100644 --- a/bfd/archive64.c +++ b/bfd/archive64.c @@ -186,8 +186,16 @@ _bfd_archive_64_bit_write_armap (bfd *arch, memcpy (hdr.ar_name, "/SYM64/", strlen ("/SYM64/")); if (!_bfd_ar_sizepad (hdr.ar_size, sizeof (hdr.ar_size), mapsize)) return false; - _bfd_ar_spacepad (hdr.ar_date, sizeof (hdr.ar_date), "%ld", - time (NULL)); + + time_t date; + + if (arch->flags & BFD_DETERMINISTIC_OUTPUT) + date = 0; + else + date = bfd_get_current_time (0); + + _bfd_ar_spacepad (hdr.ar_date, sizeof (hdr.ar_date), "%ld", (long) date); + /* 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); |