| author | |
| committer | |
| log | c15755092821c5c27727ebf416689084eab5b73e |
| tree | afc1104bb5d008af0b39309e19ff46f2ef30058d |
| parent | d30d37e356a7e5339c353b2aec94aa9eee59d8c6 |
Just keep things simple and zero the timestamp. It's not obvious that there's
any real benefit to adding complexity and harming performance by computing a
hash of the whole file for the timestamp value.
See:
* https://learn.microsoft.com/en-us/windows/win32/debug/pe-format#general-concepts
* https://learn.microsoft.com/en-us/windows/win32/debug/pe-format#debug-type
In the future, we should at least add an empty `IMAGE_DEBUG_TYPE_REPRO` entry to
the debug data directory for this case, but I didn't want to do too much surgery
right now since it's early days for COFF support in the self-hosted linker.1 files changed, 1 insertions(+), 1 deletions(-)
src/link/Coff.zig+1-1| ... | ... | @@ -2289,7 +2289,7 @@ fn writeHeader(self: *Coff) !void { |
| 2289 | 2289 | flags.DLL = 1; |
| 2290 | 2290 | } |
| 2291 | 2291 | |
| 2292 | const timestamp = std.time.timestamp(); | |
| 2292 | const timestamp = if (self.repro) 0 else std.time.timestamp(); | |
| 2293 | 2293 | const size_of_optional_header = @as(u16, @intCast(self.getOptionalHeaderSize() + self.getDataDirectoryHeadersSize())); |
| 2294 | 2294 | var coff_header = coff.CoffHeader{ |
| 2295 | 2295 | .machine = coff.MachineType.fromTargetCpuArch(target.cpu.arch), |