[PATCH] D139184: [LLD][Windows]Feature "checksum" for Windows PE

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 29 01:51:15 PST 2022


mstorsjo added a comment.

In D139184#4019268 <https://reviews.llvm.org/D139184#4019268>, @Qfrost911 wrote:

> But I still have some confusion. You mentioned if we post "/RELEASE", we need to compare the value read from llvm-readobj and an expected checksum. But how do I calc an expected checksum using lit tools? Adding RFC1071 in lit test?

No, you don't need to reimplement it - like I said, it's enough to just check against a hardcoded test value.

> We cannot determine a unique checksum for each specific yaml, because some values in PE will be changed every time compilation. These values can impact the checksum.

If that's the case, we should add flags that make the output deterministic.

There's a flag `/Brepro` which you can add, which changes the timestamp field into a deterministic hash-based timestamp. Or you can add `/timestamp:0`. With either of those flags in place, the output of e.g. the tests in the `heap.test` file I suggested as example, all are completely deterministic, producing exactly the same binary each time.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D139184/new/

https://reviews.llvm.org/D139184



More information about the llvm-commits mailing list