Repository navigation
fix(relinker): analyze referenced code beyond SCE scan boundaries - #10861
Felipebmaitan wants to merge 28 commits into
Conversation
MarcZX10
left a comment
There was a problem hiding this comment.
I reviewed the exact head f1b6e32c18f7de1606dc3956ac27388dd9761d3c. The relinker-only Release configure and full build pass on this Linux host. The eight focused SCE/extent/scanner tests pass, including all three new sce_referenced_code_{linux,windows,macos} cases. The full relinker CTest suite passes 178/180; masked_store_lowering and amd64_only_converter terminate with SIGILL on this Xeon E5-1620 v2 host, and neither test's source is changed here, so I cannot attribute those two failures to this patch. Hosted eligibility, conventions, intake, labels, Ubuntu/macOS relinker and ASan checks pass; Windows relinker was still pending at my check. Product jobs are skipped by path policy.
I found one repository-rule blocker in the overlap with #10792. Although this PR's body says merge-order coordination and composition testing remain necessary and the new scanner interface must preserve #10792's guest routing, its checklist currently says Depends on: none. I tested the two current heads with git merge-tree --write-tree; the composition has content conflicts in core/relinker/relinker/include/relinker/domain/ISyscallScanner.hpp and core/relinker/relinker/src/analysis/SyscallScanner.cpp. Please agree a merge order with #10792's author and update the affected checklist line(s) to show the dependency, then rebase and rerun the focused route/scanner tests on the composed result. The PR does merge cleanly with current main by itself; this request concerns the confirmed open-PR composition conflict.
MarcZX10
left a comment
There was a problem hiding this comment.
CI update for the exact head remains green: the Windows relinker job has now completed successfully. Together with the already-passing Ubuntu/macOS relinker matrix and relinker ASan, all four hosted relinker platform jobs and ASan pass. The local focused tests and full-suite result are recorded in my review above; the two local SIGILL failures remain limited to unchanged instruction-lowering tests on this host. The only outstanding review request is the confirmed composition conflict with #10792 and the missing agreed dependency/order in the checklist.
|
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
|
Hi @Felipebmaitan, #11033 fixes the signed overflow at |
|
Tested head f1b6e32 merged onto main aeff26b (clean) on Windows 11 (Ryzen 5 9600X), WinLibs GCC 15.2.0, Release.
AI-assisted: yes (Claude Code); results above were run on this machine. |
Recognize FreeBSD syscall 191 (pathconf) exact 13-byte numbered stubs emitted by ps5-payload-dev libc and rewrite them to an indirect tail jump (FF 25 <disp32> followed by 7 NOPs) directly into the libkernel pathconf import relocation slot. When pathconf is imported, routing applies without requiring --trap-sdk-syscall-stubs, allowing homebrew like Apotris to run out-of-the-box. If pathconf is not imported, the relinker continues to refuse the binary unless --trap-sdk-syscall-stubs is passed, under which it falls back to a UD2 trap. Closes boykopovar#10219.
ligmaSec
left a comment
There was a problem hiding this comment.
Built the exact head in relinker-only mode. sce_code_extent and the Linux, Windows, and macOS referenced-code output tests passed on Linux. Native Windows and macOS execution were outside this run. A trial merge against main at 67962e3245 conflicts in the code collector, syscall scanner, and PE patcher, among other files.
AI-assisted: yes.
What
SCE scan cutoffs can omit explicitly referenced code, leaving TLS instructions unchanged or forbidden syscalls unchecked. Follow supported entry/lifecycle/function/control-flow roots beyond the cutoff and use the discovered ranges for syscall checks and Windows/macOS TLS processing. Strong code roots inside recognized data tables retain the tested refusal.
Current head
ef92693f7218066d9eb983d1c4bb4171994daabamerges mainbab5bc6b9828b24b799add9dac6b768365f82125into published6f07b2b376aaf3e7c5e53bef4719e0a4048c27c6, preserving published history and authorship. This addresses the integration part of Dean's November 11 request and adriadam10's review.The resolutions keep main's LEA code-pointer/data classification with this PR's narrow-address reference protection and separate ordinary/authoritative traversal; retain numbered pathconf-191 routing with main's SDK-stub diagnostics and interrupt-table handling; and register both the routing and new address-data regressions. Main's deprecated-option documentation and this PR's routing documentation are combined. Existing jump-table masking, function-symbol roots, generated-trap continuations and strong-root regression remain.
Merge order: #10792 lands first, then #10861. The pathconf-routing prerequisite remains bundled until it lands; it is not being split out or presented as a separate implementation. #10479 and #9549 have now landed in main. No other author's branch was modified and no new author agreement is asserted.
Tested
Windows 11 Pro 10.0.26300, Ryzen 7 9800X3D, supported WinLibs GCC 15.2.0 r7, Python 3.11, Ninja Release, relinker-only. Main and candidate builds were serialized with at most two compiler jobs.
Exact head
ef92693f7218066d9eb983d1c4bb4171994daaba: full registered relinker suite 281/281 passed, zero failures/skips, 113.81 seconds. This includessce_referenced_code_*, code extent/gaps, relative jump tables,syscall_scanner, SDK/guest syscall routing/traps,code_analysis_address_data, function-symbol roots, strong-root conversion controls and TLS coverage. Windows-native execution is included where registered; Linux/Mach-O format checks do not establish guest execution on those OSes.Pinned main
bab5bc6b9828b24b799add9dac6b768365f82125: the 19-test focused SCE/code-analysis/syscall/function-root/control-flow selection 19/19 passed, 7.83 seconds.python tools/check_conventions.py --base origin/mainandgit diff --check origin/main...HEAD: pass.Refreshed overlap scan: 1,569 open heads, 71 shared-file candidates, exit 2. Direct rows include the declared feat(relinker): route ps5-payload-dev pathconf stub to libkernel export #10792 prerequisite and shared-line changes in fix(relinker): accept identical repeated dynamic tags in code analysis #14411/fix(relinker): report PLT stubs replaced after linking #18085; 35 base-conflicted comparisons remain inconclusive. No blanket overlap clearance or new merge-order agreement is claimed. Read-only composition with newer main
752c0f776bfa689bac02aca3c30afac4b0b8378dis clean; no files undercore/relinkerchanged between the pinned and newer main.Remaining conversion evidence: the requested fresh Sonic Superstars PPSA06888 and Dead Cells PPSA15552 comparison is pending. Their original
games/andbuild-relinker/resume-20261107/inputsdirectories are absent from the replacement checkout. Current input locations have been requested. The November 7 result (six bundle pairs, 198 byte-identical output files) applies only to its recorded old head/main; it is not reused as evidence for this integration. The separately unnamed gate-image manifest remains unavailable.No title gameplay, console behavior, fresh native Linux/macOS execution, GPU or performance qualification. Fresh hosted checks and collaborator re-review remain pending. Requesting adriadam10, oneandonlydean and MarcZX10 again was rejected by GitHub:
Felipebmaitan does not have the correct permissions to execute RequestReviewsByLogin. A collaborator must request the re-review; no review was dismissed.Executed relinker commands and artifact hashes
SHA-256: candidate converter
5b2931b9851c4b8e92ddb572ae9b9d2f5f5d8950a8ef5cd0b54313ec2c553a57; main converter182c67ed433ed2e9c3526fe19471192ed9fc8098e6def47a50b1979f2808e00e; candidate CTest log7e09d6fb748126797f0de230a2cc3dcaaf067107b2f3ae90a22f19892fecd022.Overlap notification reviewed: November 13, 23:21 UTC
The refreshed bot report adds no overlap relative to the pre-push scan. The remaining direct peer heads are unchanged: #14411
6527e2ff82d023f0ee501bd8e29828c4d17a9a58, #1808568df14da9cdf15ee9b79f71aa7e30719c604e6de.Inspected their shared changes. #14411 changes the public code-analysis policy for identical dynamic tags; this branch currently relaxes that check only in its internal auxiliary scans. A later composition must retain the chosen public policy, conflicting-value rejection and referenced-code traversal. #18085 adds replaced-PLT diagnostics around the syscall scan; a later composition must preserve those diagnostics alongside this branch's routed-stub output and tail scan. Neither supplies a helper this head requires, so no new functional dependency is established by these shared lines.
#10792 and #11628/#11661/#11689/#11698 disappeared from the report but are all confirmed OPEN at unchanged heads. Their absence is not evidence of a merge or clearance. #10792 remains the declared predecessor. The 30 remaining base-conflicted comparisons are inconclusive; no combined-runtime pass or new author ordering agreement is claimed. This notification requires no source change or repeated runtime tests.
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: feat(relinker): route ps5-payload-dev pathconf stub to libkernel export #10792
Fixes: none
Unblocks: none
GPUs tested: n/a
AI-assisted: yes