mirror of
https://github.com/reactos/reactos.git
synced 2026-06-21 05:06:03 +08:00
lld can leave the PE checksum field zero for reproducible output. This is acceptable for user-mode images, but Windows rejects kernel-mode images without a valid checksum. Keep preserving linker-produced zero checksums for other images, but force checksum recalculation when pefixup is operating on a kernel-mode image. This was found while validating Clang-built amd64 kmtest drivers against Windows 7: the same driver source built with GCC loaded, while the Clang/lld-built .sys failed with ERROR_BAD_EXE_FORMAT / 0xC1. Recalculating the PE checksum made the Clang-built driver load and the tests run correctly.