Repository navigation
fix(relinker): load Windows executables at a fixed low base - #4237
Conversation
|
Carried the current-main fix linked in #3043 with the source author preserved. Local conventions and diff checks pass; the branch reports 124 Linux relinker tests and Windows 10 runtime evidence. The PR explicitly records that Windows 11 build 26200 reserves the image range and remains unverified, so this is not claimed as a Windows 11 fix. |
ceaab5f to
dbb37ec
Compare
dbb37ec to
7b7457f
Compare
7b7457f to
faba550
Compare
|
Thanks for the correction. The #1955 failure was caused by RELOCS_STRIPPED and was fixed by #1958; I do not have evidence that Windows 11 build 26200 fails to load at the standard base. I will remove that claim from Limitations and shorten the TechnicalDebt entry, then rebase the PR onto current main. |
faba550 to
2805df4
Compare
|
Rebased onto current |
adriadam10
left a comment
There was a problem hiding this comment.
Rebased this onto current main locally; it builds, but two tests fail:
windows_fixed_base:test_windows_fixed_base.py:73asserts the default output keepsDYNAMIC_BASE(bool(characteristics & 0x40) == (base is None)). #319fa5779 added--windows-fixed-baseas the opt-in way to get a non-ASLR main image, anddocs/user/USAGE.mdsays that without it placement is unchanged. This PR changes that default.windows_address_space(this PR's own test): the guest module artifact comes out withDllCharacteristics 0x100, not0x140. The module goes through the sameWindowsPeWriter::Write, so on main's writer the flag can't be dropped for the executable alone; the PR needs to pass the distinction in (executable vs module).
Please rework this on top of main: either document why --windows-fixed-base 0x140000000 is not enough for #3043 (the default image base is already 0x140000000, below 1 TiB), or make the executable/module distinction explicit in WindowsPeWriter::Write, update windows_fixed_base and USAGE.md for the new default, and keep the module case in your test. The debt line should then also reflect the option that exists on main.
|
Follow-up to the default-image-base review: the Windows test recorded in issue #3043 using the existing fixed-base option removes the reported allocation crash and reaches the later |
2805df4 to
e5c782c
Compare
|
Thanks for flagging the mismatch. I reworked the rebased writer so |
|
I found your later follow-up (comment 6151045069) about the existing |
|
Title evidence and Windows test for this PR (Windows 10 19045, MinGW-w64 GCC 15.2.0, Release; head PPSA02530 (SDK word
Not run: Linux, a console. The relinker tests of this PR were not run by me. AI-assisted (Claude Code). |
|
Addendum to my Windows test above, for the executable header: AI-assisted (Claude Code). |
|
Correction to my Windows test above: I wrote that the relinker, AI-assisted (Claude Code). |
|
I pushed a docs commit for the two open points: |
Met on bf6b6c0: the code points were in already, and USAGE.md and the debt line now describe the default and name --windows-fixed-base.
What
Writes converted Windows executables without
DYNAMIC_BASE, so Windows can load the main image at its fixed low base inside the console's 40-bit address window. Guest modules keepDYNAMIC_BASE. The integration test checks both characteristics and confirms the executable fixture has relocations. This addresses the mspace buffer rejection described in #3043 for PRAGMATA.Tested
Checklist
main; no matching open fix PRLimitations
The runtime evidence is from Windows 10 and has not been verified on console hardware or other Windows versions.