fix(tools): read a PS4 executable's dynamic table from its library data segment in unwrap_self #19959
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/19959"
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 Gag21 on 2026-11-14T09:42:13Z.
What
A PS4 executable keeps
PT_DYNAMICwithout a vaddr, insidePT_SCE_DYNLIBDATA.unwrap_self.pyplaced everyPT_DYNAMICby the vaddr-to-file mapping of aPT_LOAD, so for these files it pointed the dynamic table at the start of the first load segment, and the relinker stopped withUnterminated dynamic segment (offset 0x4000). APT_DYNAMICwithout a vaddr whose stale range lies inside a recorded segment without a vaddr is now read from that segment. APT_DYNAMICat vaddr zero inside a load segment is placed as before.Tested
Windows 11, Python 3.14.0:
python -m unittest test_unwrap_selffromtools/testsruns 92 tests, OK (3 skipped); the new test fails onmain. On a PS4 title's executable and its bundledlibc.prx(CUSA01709, my own dump, no game files shared) the dynamic table now lands at its offset insidePT_SCE_DYNLIBDATA, andrelinker --dry-runpasses the dynamic-segment check and stops later atUndefined non-weak symbol has non-default visibility, which #17105 covers.python tools/check_conventions.py --base origin/mainpasses;python tools/pr_overlap.py --branchreports no overlap. Not run on Linux or macOS.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code