Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make sure lld-link's /Brepro sets the right "this is not a real timestamp" flags #37777

Closed
nico opened this issue Aug 2, 2018 · 4 comments
Closed
Labels
bugzilla Issues migrated from bugzilla lld:COFF

Comments

@nico
Copy link
Contributor

nico commented Aug 2, 2018

Bugzilla Link 38429
Resolution FIXED
Resolved on Sep 05, 2018 16:15
Version unspecified
OS Linux
CC @rnk

Extended Description

I happened to see this today: dotnet/roslyn#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.

@nico
Copy link
Contributor Author

nico commented Sep 4, 2018

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.

@nico
Copy link
Contributor Author

nico commented Sep 4, 2018

Looks like llvm even knows the value already, see https://reviews.llvm.org/D20885?id=59297#inline-176515 , https://reviews.llvm.org/D20885 , r271549

@nico
Copy link
Contributor Author

nico commented Sep 4, 2018

@nico
Copy link
Contributor Author

nico commented Sep 5, 2018

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 10, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla lld:COFF
Projects
None yet
Development

No branches or pull requests

1 participant