LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 38429 - Make sure lld-link's /Brepro sets the right "this is not a real timestamp" flags
Summary: Make sure lld-link's /Brepro sets the right "this is not a real timestamp" flags
Status: RESOLVED FIXED
Alias: None
Product: lld
Classification: Unclassified
Component: COFF (show other bugs)
Version: unspecified
Hardware: PC Linux
: P enhancement
Assignee: Unassigned LLVM Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-08-02 11:13 PDT by Nico Weber
Modified: 2018-09-05 16:15 PDT (History)
3 users (show)

See Also:
Fixed By Commit(s):


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nico Weber 2018-08-02 11:13:13 PDT
I happened to see this today: https://github.com/dotnet/roslyn/issues/5940

It explains what to do if the pe timestamp field is a hash and not a real timestamp. We should make sure that lld does all this.
Comment 1 Nico Weber 2018-09-04 08:49:25 PDT
Now also documented at https://docs.microsoft.com/en-us/windows/desktop/Debug/pe-format#section-data :

"The presence of an entry of type IMAGE_DEBUG_TYPE_REPRO indicates the PE file is built in a way to achieve determinism or reproducibility. If the input does not change, the output PE file is guaranteed to be bit-for-bit identical no matter when or where the PE is produced. Various date/time stamp fields in the PE file are filled with part or all the bits from a calculated hash value that uses PE file content as input, and therefore no longer represent the actual date and time when a PE file or related specific data within the PE is produced. The raw data of this debug entry may be empty, or may contain a calculated hash value preceded by a four-byte value that represents the hash value length."

Looks like link.exe writes a 0-sized entry with /debug and a long hash without. Just always doing the 0-sized things for lld-link is probably fine.

I'll try to make a patch.
Comment 2 Nico Weber 2018-09-04 08:50:21 PDT
Looks like llvm even knows the value already, see https://reviews.llvm.org/D20885?id=59297#inline-176515 , https://reviews.llvm.org/D20885 , r271549
Comment 3 Nico Weber 2018-09-04 12:48:13 PDT
https://reviews.llvm.org/D51652