fix(relinker): stop code scans at the PLT for PS4 executables #3142
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3142"
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-10T22:58:51Z.
What
Limit syscall and import-call-site scans in PS4 executables with
PT_SCE_DYNLIBDATAto executable code through the PLT, rather than decoding the read-only data that follows the code. If relocations require a PLT and no PLT can be located, the relinker reports an error instead of guessing.Carried Get-fix's issue-linked commit from
fix/relinker-scan-code-extent; the original commit author is preserved. The limitation in--to-inteland theunused-filteranalyses remains documented in TechnicalDebt.Tested
Linux, GCC 12.2, Release:
dynamic_table_boundsandsce_code_extentpass on the combined validation branch. The full relinker-only suite was 104/105; the unrelatedimport_audittest fails because its test JSON has nosource_commitin this environment. The source author reports thesce_code_extentregression, mutation checks, and byte-identical PS5 conversion checks passing; see #3093.Windows 11, WinLibs GCC 15.2, Release, merged onto
maind31b57a4:sce_code_extentandstring_table_boundspass. The only full-suite failure not present on plainmainwasagc_driver_dcc_keys_first_write, which the reporter bisected to #3158.Checklist
main; no other open pull request implements this scan boundaryPT_SCE_DYNLIBDATAImported from boykopovar/AnyPS5. Originally posted by Dextroid17 on 2026-10-11T00:30:25Z.
Review: COMMENTED
The review of #3141 covers both of these — they are one idea applied twice, since both are about what
PT_SCE_DYNLIBDATAmeans for a PS4 executable. The part belonging to this one: limiting the code scan by the.eh_framefunction extents and finding the PLT by its actual bytes (ff 35…ff 25, with the two displacements landing at GOT+8 and GOT+16, and the search bounded tosize - 16so the whole 16-byte header stays in range) is the honest version of that scan. Requiring a located PLT when relocations need one, rather than guessing at an extent, is the piece I would single out — a wrong scan boundary fails silently, and an error does not.Also from that review, and true of both: the
import_auditfailure is an environment difference (it wants asource_commitstamp that already exists onmain, and fails when git cannot resolveHEADfor the audited root), and the mutation and byte-identical conversion checks belong to the source author in #3093, which is where both bodies attribute them.Written with AI assistance.
Imported from boykopovar/AnyPS5. Originally posted by Silverash-i8 on 2026-10-11T01:51:19Z.
Windows run, since the PR has no Windows results yet: Windows 11, WinLibs GCC 15.2.0 r7, Release, merged onto
maind31b57a4in one build with #3213, #3159, #3158, #3142, #3141 and #2977, on an RTX 5060 Laptop and the Arrow Lake iGPU (ANYPS5_GPU=Intel).string_table_boundsandsce_code_extentpass on Windows (they don't use the GPU).In the full
ctestof that build, the only failure not also on plainmainisagc_driver_dcc_keys_first_write, which I bisected to #3158 alone (reported there).AI-assisted (Claude Code); I ran this on my machine.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-11T03:44:17Z.
Thanks for checking the Windows build and distinguishing the
sce_code_extentresult from the unrelated #3158 failure. I added the Windows focused-test result and that full-suite context to the PR's Tested section.Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T07:12:27Z.
Checked on Linux: relinker build + ctest 95/95, including
sce_code_extent; the test fails when the pipeline change is reverted. Merges cleanly with #3141, and the TechnicalDebt line sits in the right section. Merging.