fix(tools): audit sectionless guest modules #4559
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/4559"
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-12T15:38:24Z.
What
Fixes #4202. Carries Leandro Soares's
--modulesimport audit and extends it to sectionless ELF modules, which are common in shipped PRX files.The audit reads sectionless dynamic symbols and
DT_NEEDEDentries throughPT_DYNAMIC, maps virtual addresses through file-backed load segments, and determines symbol-table bounds from SysV or GNU hash data. It audits both undefined imports and sibling module exports. Unsupported or malformed dynamic layouts fail with a file-specific diagnostic instead of being silently skipped. The usage guide describes the supported layouts.The first commit preserves Leandro's original commit authorship. The follow-up is authored by MarcZX100.
Tested
Linux:
python3 -m unittest tools.tests.test_import_audit: passed (44 tests).python3 -m unittest discover -s tools/tests -p 'test_*.py': passed (205 tests).python3 tools/check_conventions.py --base upstream/main: passed.git diff --check upstream/main...HEADandgit diff --check: passed.Tests cover sectioned and sectionless modules, SysV and GNU hash tables, module imports and exports,
DT_NEEDED, missing symbols, malformed files, and suffix handling. No native build or game run was needed for this tooling change.Checklist
main; no other open pull request implements the remaining sectionless-module behaviorImported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-12T16:03:49Z.
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)tools/import_audit.pyL368tools/tests/test_import_audit.pyL264Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-13T13:17:12Z.
Windows test: head
acd821f7cmerged onto currentmain0f2683cb7, together with 5 other open pull requests in one build (the merges were conflict-free); a failure would have been bisected per PR. Windows 10, MinGW GCC (WinLibs), Ninja Release,-j2: full build 0 errors; ctest for the tests this change adds or touches: import_audit passed;python tools/check_conventions.py --base upstream/mainpassed for the combined tree. I did not run the new tests againstmainwithout the change.AI-assisted (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-13T14:26:36Z.
Checked the sectioned and sectionless readers (SysV and GNU hash), the new module-import records and the docs. Tests pass (44 in
test_import_audit), the new tests fail onmainwithout the change (5 failures, 2 errors), and truncated sectionless images only raiseAuditError. Windows run by @xXPBSXx also green; merging once the full Build is green.