fix(relinker): analyze referenced code beyond SCE scan boundaries #10861

Open
Felipebmaitan wants to merge 28 commits from upstream-pr/10861 into main
Felipebmaitan commented 2026-10-25 06:02:38 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Felipebmaitan on 2026-10-25T06:02:38Z.


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 ef92693f7218066d9eb983d1c4bb4171994daaba merges main bab5bc6b9828b24b799add9dac6b768365f82125 into published 6f07b2b376aaf3e7c5e53bef4719e0a4048c27c6, 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 includes sce_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/main and git diff --check origin/main...HEAD: pass.

  • Refreshed overlap scan: 1,569 open heads, 71 shared-file candidates, exit 2. Direct rows include the declared #10792 prerequisite and shared-line changes in #14411/#18085; 35 base-conflicted comparisons remain inconclusive. No blanket overlap clearance or new merge-order agreement is claimed. Read-only composition with newer main 752c0f776bfa689bac02aca3c30afac4b0b8378d is clean; no files under core/relinker changed 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/ and build-relinker/resume-20261107/inputs directories 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

cmake -S . -B build-relinker -G Ninja -DCMAKE_BUILD_TYPE=Release -DANYPS5_RELINKER_ONLY=ON -DBUILD_TESTING=ON -DPython3_EXECUTABLE=<Python 3.11>

cmake --build build-relinker --parallel 2

ctest --test-dir build-relinker/core/relinker -j 2 --output-on-failure --no-tests=error

SHA-256: candidate converter 5b2931b9851c4b8e92ddb572ae9b9d2f5f5d8950a8ef5cd0b54313ec2c553a57; main converter 182c67ed433ed2e9c3526fe19471192ed9fc8098e6def47a50b1979f2808e00e; candidate CTest log 7e09d6fb748126797f0de230a2cc3dcaaf067107b2f3ae90a22f19892fecd022.

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, #18085 68df14da9cdf15ee9b79f71aa7e30719c604e6de.

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 functions

  • One 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 file

  • No notes, investigation .md files 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: #10792

  • Fixes: none

  • Unblocks: none

  • GPUs tested: n/a

  • AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5002281080 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10861). Originally posted by [Felipebmaitan](https://github.com/Felipebmaitan) on 2026-10-25T06:02:38Z. --- ### 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 `ef92693f7218066d9eb983d1c4bb4171994daaba` merges main `bab5bc6b9828b24b799add9dac6b768365f82125` into published `6f07b2b376aaf3e7c5e53bef4719e0a4048c27c6`, preserving published history and authorship. This addresses the integration part of [Dean's November 11 request](https://github.com/boykopovar/AnyPS5/pull/10861#issuecomment-6788818221) and [adriadam10's review](https://github.com/boykopovar/AnyPS5/pull/10861#pullrequestreview-5660241900). 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 includes `sce_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/main` and `git diff --check origin/main...HEAD`: pass. - Refreshed overlap scan: 1,569 open heads, 71 shared-file candidates, exit 2. Direct rows include the declared #10792 prerequisite and shared-line changes in #14411/#18085; 35 base-conflicted comparisons remain inconclusive. No blanket overlap clearance or new merge-order agreement is claimed. Read-only composition with newer main `752c0f776bfa689bac02aca3c30afac4b0b8378d` is clean; no files under `core/relinker` changed 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/` and `build-relinker/resume-20261107/inputs` directories 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. <details><summary>Executed relinker commands and artifact hashes</summary> ```text cmake -S . -B build-relinker -G Ninja -DCMAKE_BUILD_TYPE=Release -DANYPS5_RELINKER_ONLY=ON -DBUILD_TESTING=ON -DPython3_EXECUTABLE=<Python 3.11> cmake --build build-relinker --parallel 2 ctest --test-dir build-relinker/core/relinker -j 2 --output-on-failure --no-tests=error ``` SHA-256: candidate converter `5b2931b9851c4b8e92ddb572ae9b9d2f5f5d8950a8ef5cd0b54313ec2c553a57`; main converter `182c67ed433ed2e9c3526fe19471192ed9fc8098e6def47a50b1979f2808e00e`; candidate CTest log `7e09d6fb748126797f0de230a2cc3dcaaf067107b2f3ae90a22f19892fecd022`. </details> <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> <details><summary>Overlap notification reviewed: November 13, 23:21 UTC</summary> [The refreshed bot report](https://github.com/boykopovar/AnyPS5/pull/10861#issuecomment-6394382739) adds no overlap relative to the pre-push scan. The remaining direct peer heads are unchanged: #14411 `6527e2ff82d023f0ee501bd8e29828c4d17a9a58`, #18085 `68df14da9cdf15ee9b79f71aa7e30719c604e6de`. 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. </details> ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: #10792 <!-- #PR, or none --> - [x] Fixes: none <!-- issue it closes as Fixes #N, or none --> - [x] Unblocks: none <!-- title ID and Game bring-up discussion, e.g. PPSA01325 #3232, or none --> - [x] GPUs tested: n/a <!-- for AGC, shader recompiler or VideoOut changes: vendor, model, driver and OS of each GPU the GPU tests ran on; otherwise n/a --> - [x] AI-assisted: yes <!-- yes / no -->
MarcZX10 commented 2026-10-25 06:08:16 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-25T06:08:16Z.

Review: DISMISSED


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.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5641805602 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10861#pullrequestreview-5641805602). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-25T06:08:16Z. **Review:** DISMISSED --- 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 commented 2026-10-25 06:12:02 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-25T06:12:02Z.

Review: COMMENTED


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.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5641813114 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10861#pullrequestreview-5641813114). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-25T06:12:02Z. **Review:** COMMENTED --- 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.
adriadam10 commented 2026-10-26 23:01:50 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-26T23:01:50Z.

Review: CHANGES_REQUESTED


This conflicts with main in code, not only in docs, so it needs a rebase from you before it can go further:

  • core/relinker/relinker/src/guest/GuestModuleBuilder.cpp:397 and core/relinker/relinker/src/pipeline/RelinkerPipeline.cpp:387: main now has the relative jump table masking (RelativeJumpTables.cpp, unwindRanges, scanCode masked with 0x90, hasEhFrame/sceImage split) in the same blocks where this PR adds hasCodeTail and the tail scan. Please combine them so the masked buffer is what the syscall scan and the new referenced-code scan both see, and rerun sce_referenced_code_* plus the jump-table tests on the result.
  • docs/dev/debt/relinker.md: main has an entry saying code after the last unwind function or PLT is not analyzed ("a TLS access in it is not rewritten ... a function symbol or init/fini array entry pointing into it fails the conversion"). This PR changes exactly that, so that entry has to be rewritten to what remains true after the change, next to the RelativeJumpTables entry (keep both).
  • #10792 overlaps in ISyscallScanner.hpp and SyscallScanner.cpp (as @MarcZX10 found with git merge-tree). Agree the order with its author and put it in Depends on in the checklist (currently none); after the rebase, rerun the guest routing and scanner tests on the composed result.

The rest (CI on the relinker matrix, the negative control and the homebrew runs from @wachi35676) looks good; I did not find other problems in the diff. Happy to look again once it is rebased.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5660241900 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10861#pullrequestreview-5660241900). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-26T23:01:50Z. **Review:** CHANGES_REQUESTED --- This conflicts with `main` in code, not only in docs, so it needs a rebase from you before it can go further: - `core/relinker/relinker/src/guest/GuestModuleBuilder.cpp:397` and `core/relinker/relinker/src/pipeline/RelinkerPipeline.cpp:387`: `main` now has the relative jump table masking (`RelativeJumpTables.cpp`, `unwindRanges`, `scanCode` masked with `0x90`, `hasEhFrame`/`sceImage` split) in the same blocks where this PR adds `hasCodeTail` and the tail scan. Please combine them so the masked buffer is what the syscall scan and the new referenced-code scan both see, and rerun `sce_referenced_code_*` plus the jump-table tests on the result. - `docs/dev/debt/relinker.md`: `main` has an entry saying code after the last unwind function or PLT is not analyzed ("a TLS access in it is not rewritten ... a function symbol or init/fini array entry pointing into it fails the conversion"). This PR changes exactly that, so that entry has to be rewritten to what remains true after the change, next to the `RelativeJumpTables` entry (keep both). - #10792 overlaps in `ISyscallScanner.hpp` and `SyscallScanner.cpp` (as @MarcZX10 found with `git merge-tree`). Agree the order with its author and put it in `Depends on` in the checklist (currently `none`); after the rebase, rerun the guest routing and scanner tests on the composed result. The rest (CI on the relinker matrix, the negative control and the homebrew runs from @wachi35676) looks good; I did not find other problems in the diff. Happy to look again once it is rebased.
MarcZX10 commented 2026-11-17 09:43:29 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-17T09:43:29Z.

Review: COMMENTED


Reviewed — no blocking findings

Nothing blocks this; the points below are optional.

What I ran

  • Head reviewed: ef92693f7218066d9eb983d1c4bb4171994daaba. No merged-preview check against main.
  • Read the run folder: description.md, commits.md, manifest.json, files.json and all of diff.patch (2,515 lines, 30 files).
  • Three reader lookups at head, to confirm the lines cited below:
python3 repo_read.py search "addStrongRoot(entry)" core/relinker/relinker/src/analysis/CodeInstructionCollector.cpp
python3 repo_read.py search "lies inside a data table" core/relinker/relinker/src/analysis/CodeInstructionCollector.cpp
python3 repo_read.py search "sce-entry-after-code" core/relinker/relinker/tests/test_sce_code_extent.py
  • No build, no CTest, no Python test was run in this review.

Results

Check Result Note
Full suite 281/281 (author) not run Author-reported; not reproduced here
Build and CTest on head not run No build in this review
Diff read, all reviewed files passed Hunks only; full file text not opened
Head lookups for cited lines passed Three identifiers located at head

Findings

Blocking

None.

Non-blocking

  • Accepted input now refused, not called out. core/relinker/relinker/tests/test_sce_code_extent.py:249 changes the sce-entry-after-code case for the Windows and macOS targets. The call previously expected a successful conversion and now expects Unsupported Windows/macOS guest TLS instruction (helper at test_sce_code_extent.py:167-168). The description does not mention this narrowing. Fix: state it in the description or in the debt file.
  • "Retain the tested refusal" understates the change. core/relinker/relinker/src/analysis/CodeInstructionCollector.cpp:303 makes addStrongRoot throw for any strong root inside a recognized data table. core/relinker/relinker/src/analysis/CodeInstructionCollector.cpp:421 routes the ELF entry point through it. Before, addRoot silently ignored such roots. ConversionTests.cpp covers entry, DT_INIT and DT_FINI, so the behaviour is tested. The description (description.md:5) should say these roots were previously ignored and are now refused.

Not verified

  • Author-reported results (281/281 relinker suite, 19/19 focused selection, check_conventions.py, overlap scan) were not reproduced.
  • Native Windows execution, console behaviour of the routed pathconf stub (the 13-byte stub's ret is replaced by a jump into libkernel pathconf), and the claim that routing preserves the stub's semantics. Not measured.
  • Python test helpers imported from sibling test modules (pe_bytes_at, elf_bytes_at, elf_loads, guest_fixture, main_fixture, and the linux= keyword on no_tail_fixture) were not checked at head.
  • GuestModuleBuilder.cpp masks relative jump tables only inside the code range before FindSceCodeEnd. Tail bytes stay unmasked in scanBytes. Whether ScanReferencedTailForSyscalls can decode table bytes as code was not traced.
  • Cost: ValidateSyscallRoutes and ScanReferencedTailForSyscalls each rerun the full CodeInstructionCollector analysis. Not measured.
  • Prerequisite #10792 is described as open and must land first. Not checked on GitHub. Hosted checks and collaborator re-review are pending per the description.
  • Ruling sections outside the three requested were not read.

Files: the 30 files in files.json reviewed were read through their diff hunks. No full file text was read. files.json lists no excluded files; the rule patterns are *lock*, *.min.*, dist/*, build/*, *.svg.

Sources

To get this to a good state

Nothing is required. The points under Findings are optional.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5936123401 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10861#pullrequestreview-5936123401). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-17T09:43:29Z. **Review:** COMMENTED --- # Reviewed — no blocking findings Nothing blocks this; the points below are optional. ## What I ran - Head reviewed: `ef92693f7218066d9eb983d1c4bb4171994daaba`. No merged-preview check against main. - Read the run folder: `description.md`, `commits.md`, `manifest.json`, `files.json` and all of `diff.patch` (2,515 lines, 30 files). - Three reader lookups at head, to confirm the lines cited below: ```text python3 repo_read.py search "addStrongRoot(entry)" core/relinker/relinker/src/analysis/CodeInstructionCollector.cpp python3 repo_read.py search "lies inside a data table" core/relinker/relinker/src/analysis/CodeInstructionCollector.cpp python3 repo_read.py search "sce-entry-after-code" core/relinker/relinker/tests/test_sce_code_extent.py ``` - No build, no CTest, no Python test was run in this review. ## Results | Check | Result | Note | | --- | --- | --- | | Full suite 281/281 (author) | not run | Author-reported; not reproduced here | | Build and CTest on head | not run | No build in this review | | Diff read, all reviewed files | passed | Hunks only; full file text not opened | | Head lookups for cited lines | passed | Three identifiers located at head | ## Findings ### Blocking None. ### Non-blocking - **Accepted input now refused, not called out.** `core/relinker/relinker/tests/test_sce_code_extent.py:249` changes the `sce-entry-after-code` case for the Windows and macOS targets. The call previously expected a successful conversion and now expects `Unsupported Windows/macOS guest TLS instruction` (helper at `test_sce_code_extent.py:167-168`). The description does not mention this narrowing. Fix: state it in the description or in the debt file. - **"Retain the tested refusal" understates the change.** `core/relinker/relinker/src/analysis/CodeInstructionCollector.cpp:303` makes `addStrongRoot` throw for any strong root inside a recognized data table. `core/relinker/relinker/src/analysis/CodeInstructionCollector.cpp:421` routes the ELF entry point through it. Before, `addRoot` silently ignored such roots. `ConversionTests.cpp` covers entry, `DT_INIT` and `DT_FINI`, so the behaviour is tested. The description (`description.md:5`) should say these roots were previously ignored and are now refused. ## Not verified - Author-reported results (281/281 relinker suite, 19/19 focused selection, `check_conventions.py`, overlap scan) were not reproduced. - Native Windows execution, console behaviour of the routed pathconf stub (the 13-byte stub's `ret` is replaced by a jump into libkernel `pathconf`), and the claim that routing preserves the stub's semantics. Not measured. - Python test helpers imported from sibling test modules (`pe_bytes_at`, `elf_bytes_at`, `elf_loads`, `guest_fixture`, `main_fixture`, and the `linux=` keyword on `no_tail_fixture`) were not checked at head. - `GuestModuleBuilder.cpp` masks relative jump tables only inside the code range before `FindSceCodeEnd`. Tail bytes stay unmasked in `scanBytes`. Whether `ScanReferencedTailForSyscalls` can decode table bytes as code was not traced. - Cost: `ValidateSyscallRoutes` and `ScanReferencedTailForSyscalls` each rerun the full `CodeInstructionCollector` analysis. Not measured. - Prerequisite #10792 is described as open and must land first. Not checked on GitHub. Hosted checks and collaborator re-review are pending per the description. - Ruling sections outside the three requested were not read. Files: the 30 files in `files.json` `reviewed` were read through their diff hunks. No full file text was read. `files.json` lists no excluded files; the rule patterns are `*lock*`, `*.min.*`, `dist/*`, `build/*`, `*.svg`. ## Sources - https://github.com/boykopovar/AnyPS5/blob/ef92693f7218066d9eb983d1c4bb4171994daaba/core/relinker/relinker/src/analysis/CodeInstructionCollector.cpp#L303 - https://github.com/boykopovar/AnyPS5/blob/ef92693f7218066d9eb983d1c4bb4171994daaba/core/relinker/relinker/src/analysis/CodeInstructionCollector.cpp#L421 - https://github.com/boykopovar/AnyPS5/blob/ef92693f7218066d9eb983d1c4bb4171994daaba/core/relinker/relinker/tests/test_sce_code_extent.py#L248 ## To get this to a good state Nothing is required. The points under Findings are optional.
ligmaSec commented 2026-12-03 12:10:06 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T12:10:06Z.

Review: COMMENTED


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.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6169499178 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10861#pullrequestreview-6169499178). Originally posted by [ligmaSec](https://github.com/ligmaSec) on 2026-12-03T12:10:06Z. **Review:** COMMENTED --- 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.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/10861:upstream-pr/10861'
git switch 'upstream-pr/10861'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/10861'
git switch 'upstream-pr/10861'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/10861'
git switch 'upstream-pr/10861'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/10861'
git switch 'main'
git merge --squash 'upstream-pr/10861'
git switch 'main'
git merge --ff-only 'upstream-pr/10861'
git switch 'main'
git merge 'upstream-pr/10861'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!10861
No description provided.