fix(tools): keep ELF hash metadata inside load mappings #5308
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/5308"
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 Ondra97 on 2026-10-13T16:52:32Z.
What
For sectionless ELF files, the audit checked that hash headers were file-backed but read the remaining SysV table and GNU bloom/bucket prefix using raw file offsets alone. Data outside every declared PT_LOAD file range could therefore be treated as active symbol metadata. Validate the complete SysV table and GNU prefix through the existing virtual-address mapper before using them. GNU chain validation is retained.
Tested
Windows, Python 3.14: full import_audit suite passed 47/47. New synthetic fixtures keep hash headers and dynamic metadata mapped while leaving the hash tails outside file-backed load ranges. All four import/export and SysV/GNU rejection cases failed before the fix and passed afterwards. Existing valid SysV and GNU fixtures remain covered. Python-only change; no title run is claimed.
Local conventions and whitespace checks passed. Current open PRs were checked for overlapping files, lines and functions.
CI relinker builds and test suites passed on Linux, Windows and macOS for
b309086b1(Build). Full runtime-library jobs were skipped by the automatic PR policy.Combined local validation of #5283, #5286, #5298, #5302, #5305, #5308 and #5310 on main
61b8742b6: all seven patches merge without conflicts; the full relinker-only build and 150/150 CTest tests passed.Checklist
Based on current
main; no other open PR implements the same functionsOne topic per PR; follow-ups go in a new PR
No comments in code except technical debt
Unimplemented paths throw (
NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt fileNo notes, investigation
.mdfiles or images added to the repository (attach them to this PR)New third-party code is a submodule built from source
Generic behaviour, not specific to one title
Depends on: none
Unblocks: none
GPUs tested: n/a
AI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-14T18:30:56Z.
Checked the SysV table and GNU bloom/bucket prefix now go through
file_offset(which also bounds-checks the file, so dropping the oldtakeloses nothing). The new test fails on main and passes with the fix; import_audit and the scoped ctest pass on the PR merged onto main, relinker CI green. Merging.