fix(relinker): tell code from data in images without PT_SCE_DYNLIBDATA #13716
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/13716"
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 simnJS on 2026-10-31T02:25:41Z.
What
The code analysis builds its unwind function list, and with it the code/data decision for a relocation or
leatarget outside every unwind function, only for an image with aPT_SCE_DYNLIBDATAsegment. An image without one leaves the list empty, soaddPointerRootfollows every such target as code andBuildControlFlowGraphis told to follow code addresses. Read the unwind table in that branch as well, so an image withPT_GNU_EH_FRAMEand noPT_SCE_DYNLIBDATAgets the same classification. An image with neither keeps the previous behaviour.Trackmania (PPSA02195, 01.026.000) has no
PT_SCE_DYNLIBDATAin its executable nor in any of its five bundled modules, and its eboot statically links the OpenSSL CRYPTOGAMS x86-64 assembly, which keeps its constant blocks between the unwind functions. Eightleainstructions take the address of its AES constants and two take the address of the Keccak round constants. Those bytes were followed as code, and the Windows TLS rewrite stopped on64 22 d0at va0x1850935, then on64 20 73 71at va0x1870715, which is thed sqof the stringKeccak-1600 absorb and squeeze for x86_64, CRYPTOGAMS by <[email protected]>. With this change the conversion takes 55 pointer targets as data and completes.This is the same classification the existing debt entry describes for
PT_SCE_DYNLIBDATAimages, applied to an image that has the unwind table it needs. It does not change the masking of undecodable constant tables inRelativeJumpTables.cpp, which leaves a gap alone when it decodes as valid instructions.Tested
Linux, WSL Ubuntu 24.04.1, GCC 13.3.0, the distribution and compiler of the
ubuntu-24.04runner, replicating.github/workflows/fork-linux.yml: same CMake flags andANYPS5_AGC_EXECUTION_TESTS,ANYPS5_REQUIRE_VULKAN=1on lavapipe,GALLIUM_OVERRIDE_CPU_CAPS=avx,ctest --timeout 120 --repeat until-pass:2, full build then thelibstarget then every test. Run at--parallel 12rather than 4, the same value on both sides.813496001e, this branch's base: 3020 of 3029 pass. Nine fail:agc_driver_frame_capture_eop,agc_driver_frame_replay,agc_driver_frame_replay_concurrent,agc_driver_frame_replay_shader,agc_driver_frame_replay_shader_host,agc_driver_recorder,agc_storage_idle_writeback_race,agc_storage_kept_unit_settle,log_file.Windows 11 Pro 26200, WinLibs GCC 15.2.0 r7, Release:
tls_function_coverage_pointer_target_data(new): a non-SCE image whose function takes the address of64 20 00past the end of its unwind function. It fails on the base withUnsupported Windows guest TLS instruction (bytes: 64 20 00) (offset 0x1300)and passes here, reporting the target as data.tls_function_coveragelabel,tls_diagnostics,gs_trap_entry_rootsandmacos_gs_traps: 38 of 38 pass.Took 55 pointer target(s) outside the unwind functions as data, the first at 0x1850770. On the base it stops withUnsupported Windows guest TLS instruction.Not run: the full Windows suite on this branch, and the fork CI. GitHub Actions is disabled on my account at the moment, so the Linux figures above come from the local replica described here, not from a runner.
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)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-31T02:42:58Z.
Review: CHANGES_REQUESTED
Reviewed — changes requested
The source change and relevant Linux, Windows, and ASAN jobs look sound, but the live overlap report identifies #11525 on the same debt-file lines and the required landing order is not yet agreed.
What I ran
Reviewed head
c078d0fb7aa4426dc8ab9b47e8d961424e75ce73, PR based30e04fb8a381100fa7845f4d3853c042551e6a9, and currentmain0cc02f7cde69941f651819b1f7a80f7aa722a08b; the current-main merge preview was clean. Environment: Linux 6.1.0-54-amd64, Python 3.11.2, GCC 12.2.0. I did not build or run tests locally.Results
tls_function_coveragejob passed. Two macOS relinker jobs were pending. Broader Linux, write-watch, register-context, and Windows product jobs were skipped by workflow selection.docs/dev/debt/relinker.mdlines 39–40. I found no landing-order agreement in either PR's discussion.Unedited output from checks
Precheck excerpts:
Hosted checks:
Overlap report row:
Negative control
PT_SCE_DYNLIBDATAimagesFindings
Blocking
The overlap report names #11525 on the same
docs/dev/debt/relinker.mdlines changed here.CONTRIBUTING.mdrequires authors of overlapping PRs to agree on which lands first and declare that order withDepends on; neither discussion records an agreement yet. Please coordinate the landing order with #11525's author and update the checklist dependency entry to match.Non-blocking
I found no separate source-level blocker. The two macOS relinker jobs were still pending at the last check snapshot.
Sources
main0cc02f7c078d0fNot verified
No local build or test execution, full product CI, physical-console run, or title runtime. The author reports local Windows and Linux/WSL2 results; the macOS relinker jobs were pending, and the workflow skipped broader Linux and specialized jobs.
To get this to a good state
Please agree with #11525's author on landing order and record it in the
Depends onchecklist. I will rerun the same relevant checks on the updated head.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-19T04:41:30Z.
Review: APPROVED
Reviewed — looks good
No verified blocking defect was found in the changed code; the author-reported focused tests support the intended classification behavior, but I did not run checks on this revision.
What I ran
Reviewed head
0d9f99a233f35944a3c2d6f7ba67836638b68649using the prepared diff andrepo_read.pyfor repository context. No commands or tests were run.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
I did not run the build, test suite, Windows conversion, or fork CI. The description reports focused Windows tests and a local Linux replica; these results were not independently confirmed. No files were excluded by the manifest's review status.
To get this to a good state
Nothing is required.
Pull request closed