Index: elfcopy/archive.c =================================================================== --- elfcopy/archive.c +++ elfcopy/archive.c @@ -440,6 +440,7 @@ struct archive *a; struct archive_entry *entry; struct ar_obj *obj; + time_t timestamp; int nr; if ((a = archive_write_new()) == NULL) @@ -450,7 +451,9 @@ /* Write the archive symbol table, even if it's empty. */ entry = archive_entry_new(); archive_entry_copy_pathname(entry, "/"); - archive_entry_set_mtime(entry, time(NULL), 0); + if (elftc_timestamp(×tamp) != 0) + err(EXIT_FAILURE, "elftc_timestamp"); + archive_entry_set_mtime(entry, timestamp, 0); archive_entry_set_size(entry, (ecp->s_cnt + 1) * sizeof(uint32_t) + ecp->s_sn_sz); AC(archive_write_header(a, entry)); Index: elfcopy/pe.c =================================================================== --- elfcopy/pe.c +++ elfcopy/pe.c @@ -54,6 +54,7 @@ PE_Buffer *pb; const char *name; size_t indx; + time_t timestamp; int elferr; if (ecp->otf == ETF_EFI || ecp->oem == EM_X86_64) @@ -89,7 +90,9 @@ pch.ch_machine = IMAGE_FILE_MACHINE_UNKNOWN; break; } - pch.ch_timestamp = (uint32_t) time(NULL); + if (elftc_timestamp(×tamp) != 0) + err(EXIT_FAILURE, "elftc_timestamp"); + pch.ch_timestamp = (uint32_t) timestamp; if (pe_update_coff_header(pe, &pch) < 0) err(EXIT_FAILURE, "pe_update_coff_header() failed");