fix(relinker): put extra PT_LOAD on a fresh page #4919
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/4919"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-13T04:10:10Z.
What
Fixes #4913. Carries Leandro Soares's
c3aa504abcommit and preserves his original commit authorship. The relinker's extra RWXPT_LOADnow starts on a fresh page above the highest guest segment, so its mapping cannot replace the last page of a guest segment when that segment ends in the middle of a page.Adds the two reported range cases while keeping the existing layout expectation.
Tested
Linux, GCC 12.2, Release, relinker-only build:
program_layout_ranges: passed (1/1).progress_history: passed (142/142).tools/check_conventions.py --base upstream/main: passed.git diff --check upstream/main...HEAD: passed.The unfiltered 143-test run passed 142 tests.
progress_historyfails in the local Python 3.11.2 becausetarfile.TarFile.extractall()does not accept thefilterargument used by that test; this is unrelated to the relinker change. No real title was relinked in this session.Checklist
main; no open pull request implements the same changeImported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-13T09:27:58Z.
Windows test: head
a5758f12fmerged onto currentmain2a2a3dc65(clean merge, no conflicts). Windows 10, MinGW GCC (WinLibs), Ninja Release,-j2: full build 0 errors;ctest -R ^program_layout_ranges$passed (1 of 1);python tools/check_conventions.py --base upstream/mainpassed. I did not run the new tests againstmainwithout the change.AI-assisted (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-13T23:25:41Z.
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
main)core/relinker/elfpatcher/src/general/ProgramHeaderLayoutBuilder.cppL123-130, L132-145core/relinker/elfpatcher/tests/ProgramLayoutRangeTests.cppL24, L49Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-13T23:27:06Z.
The overlap check now includes #5543, which addresses the same extra-PT_LOAD page-placement issue and adds broader structural and end-to-end regression coverage. These two changes should not be merged together; #5543 is the more complete candidate. I am leaving this PR open, but calling out the duplicate so the merge order is clear.
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-14T02:33:24Z.
Closing: same change as #5543, which fixes the same extra PT_LOAD placement with wider tests and is further along.
Reopen if something here is still missing on current main.
Pull request closed