diff options
author | Sam James <sam@gentoo.org> | 2023-08-02 12:06:23 +0100 |
---|---|---|
committer | Sam James <sam@gentoo.org> | 2023-08-02 12:06:23 +0100 |
commit | b5c37946cce4b41af0436529b139fa3d23e61f73 (patch) | |
tree | 02129ebadb74e7d3f2430cf8221799ce186600e3 /bfd/peXXigen.c | |
parent | 675b9d612cc59446e84e2c6d89b45500cb603a8d (diff) | |
download | fsf-binutils-gdb-b5c37946cce4b41af0436529b139fa3d23e61f73.zip fsf-binutils-gdb-b5c37946cce4b41af0436529b139fa3d23e61f73.tar.gz fsf-binutils-gdb-b5c37946cce4b41af0436529b139fa3d23e61f73.tar.bz2 |
Revert "2.41 Release sources"
This reverts commit 675b9d612cc59446e84e2c6d89b45500cb603a8d.
See https://sourceware.org/pipermail/binutils/2023-August/128761.html.
Diffstat (limited to 'bfd/peXXigen.c')
-rw-r--r-- | bfd/peXXigen.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/bfd/peXXigen.c b/bfd/peXXigen.c index da53f34..cdd89f8 100644 --- a/bfd/peXXigen.c +++ b/bfd/peXXigen.c @@ -838,7 +838,20 @@ _bfd_XXi_only_swap_filehdr_out (bfd * abfd, void * in, void * out) /* Use a real timestamp by default, unless the no-insert-timestamp option was chosen. */ if ((pe_data (abfd)->timestamp) == -1) - H_PUT_32 (abfd, time (0), filehdr_out->f_timdat); + { + 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); + H_PUT_32 (abfd, now, filehdr_out->f_timdat); + } else H_PUT_32 (abfd, pe_data (abfd)->timestamp, filehdr_out->f_timdat); |