diff options
| author | Ed Maste <emaste@FreeBSD.org> | 2016-08-31 13:50:23 +0000 |
|---|---|---|
| committer | Ed Maste <emaste@FreeBSD.org> | 2016-08-31 13:50:23 +0000 |
| commit | 665a3a9a7974db933528226e33ee6852fb764c5f (patch) | |
| tree | f029bc14f9bccfe14f7e39b7a71dc463816ebe7b /elfcopy/pe.c | |
| parent | e2f022b8a2b496795155ba6b175f4c677c91be35 (diff) | |
Diffstat (limited to 'elfcopy/pe.c')
| -rw-r--r-- | elfcopy/pe.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/elfcopy/pe.c b/elfcopy/pe.c index 586b21a74095..8deb80918553 100644 --- a/elfcopy/pe.c +++ b/elfcopy/pe.c @@ -34,7 +34,7 @@ #include "elfcopy.h" -ELFTC_VCSID("$Id: pe.c 3477 2016-05-25 20:00:42Z kaiwang27 $"); +ELFTC_VCSID("$Id: pe.c 3490 2016-08-31 00:12:22Z emaste $"); /* Convert ELF object to Portable Executable (PE). */ void @@ -54,6 +54,7 @@ create_pe(struct elfcopy *ecp, int ifd, int ofd) 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 @@ create_pe(struct elfcopy *ecp, int ifd, int ofd) 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"); |
