Repository navigation
Commit 45303a2
authored
[PEFIXUP] Recalculate checksums for kernel-mode images (reactos#8969)
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.1 parent f86835f commit 45303a2
1 file changed
Lines changed: 11 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
521 | 521 | | |
522 | 522 | | |
523 | 523 | | |
524 | | - | |
525 | | - | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
526 | 535 | | |
527 | 536 | | |
528 | 537 | | |
| |||
0 commit comments