feat(relinker): route ps5-payload-dev pathconf stub to libkernel export #10792

Merged
SushiBirb merged 7 commits from upstream-pr/10792 into main 2026-11-26 07:02:18 +00:00
SushiBirb commented 2026-10-25 01:00:02 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by SushiBirb on 2026-10-25T01:00:02Z.


What

Route ps5-payload-dev SDK numbered syscall stub 191 (pathconf) to the imported libkernel pathconf export (oc98+zOImus) across both the main executable and bundled guest modules.

ps5-payload-dev compiles libc++ syscall stubs with raw syscall instructions (48 C7 C0 BF 00 00 00 49 89 CA 0F 05 C3, 13 bytes) rather than delegating to libkernel wrappers. Homebrew binaries like Apotris and their bundled modules import pathconf from libkernel (via oc98+zOImus / pathconf), but the relinker rejected the raw stub.

When pathconf is imported, the relinker rewrites the 13-byte stub into an indirect tail jump (FF 25 <disp32> followed by 7 NOPs) directly referencing pathconfs GOT relocation address in RelinkerPipeline and GuestModuleBuilder. This does not require --trap-sdk-syscall-stubs. If pathconf is not imported, the stub is trapped as UD2 if --trap-sdk-syscall-stubs is passed, or refused if omitted. Other unrouted syscall numbers (such as 9) remain refused.

Tested

Linux (Arch Linux x86_64). Built Ninja relinker targets and ran complete test suite:

  • Unit test syscall_scanner_tests checking numbered stub detection, trap fallback, and rejection without import.
  • Integration test test_guest_syscall_route.py checking Linux ELF, Windows PE, and macOS Mach-O outputs across both the main executable and bundled guest modules (sce_module/*.prx), verifying the 13-byte FF 25 tail jump rewrite, displacement calculations, unimported error/trap handling, and that a game patch overlapping the routed stub is rejected (with a control patch past the stub still routing).
  • Full test suite: 265/265 ctest tests passed.
  • python3 tools/check_conventions.py --base origin/main passed cleanly.

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 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: #10479, #9549 (agreed merge order #10479 → #9549 → #10792 → #10861)
  • Fixes: Fixes #10219
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5000629989 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10792). Originally posted by [SushiBirb](https://github.com/SushiBirb) on 2026-10-25T01:00:02Z. --- ### What Route ps5-payload-dev SDK numbered syscall stub 191 (`pathconf`) to the imported libkernel `pathconf` export (`oc98+zOImus`) across both the main executable and bundled guest modules. ps5-payload-dev compiles libc++ syscall stubs with raw syscall instructions (`48 C7 C0 BF 00 00 00 49 89 CA 0F 05 C3`, 13 bytes) rather than delegating to libkernel wrappers. Homebrew binaries like Apotris and their bundled modules import `pathconf` from libkernel (via `oc98+zOImus` / `pathconf`), but the relinker rejected the raw stub. When `pathconf` is imported, the relinker rewrites the 13-byte stub into an indirect tail jump (`FF 25 <disp32>` followed by 7 NOPs) directly referencing `pathconf`s GOT relocation address in `RelinkerPipeline` and `GuestModuleBuilder`. This does not require `--trap-sdk-syscall-stubs`. If `pathconf` is not imported, the stub is trapped as `UD2` if `--trap-sdk-syscall-stubs` is passed, or refused if omitted. Other unrouted syscall numbers (such as 9) remain refused. ### Tested Linux (Arch Linux x86_64). Built Ninja relinker targets and ran complete test suite: - Unit test `syscall_scanner_tests` checking numbered stub detection, trap fallback, and rejection without import. - Integration test `test_guest_syscall_route.py` checking Linux ELF, Windows PE, and macOS Mach-O outputs across both the main executable and bundled guest modules (`sce_module/*.prx`), verifying the 13-byte `FF 25` tail jump rewrite, displacement calculations, unimported error/trap handling, and that a game patch overlapping the routed stub is rejected (with a control patch past the stub still routing). - Full test suite: 265/265 ctest tests passed. - `python3 tools/check_conventions.py --base origin/main` passed cleanly. ### Checklist - [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 - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library technical 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: #10479, #9549 (agreed merge order #10479 → #9549 → #10792 → #10861) - [x] Fixes: Fixes #10219 - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
MarcZX10 commented 2026-10-25 01:09:54 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-25T01:09:54Z.

Review: DISMISSED


The main-executable route is covered, but the same scanner is also used for every bundled guest module in GuestModuleBuilder::Build (around the ScanCodeSectionForSyscalls loop). That caller does not pass a routedStubs output vector and only applies returned trap offsets. Consequently, an exact syscall-191 SDK stub in a bundled PRX still reaches the forbidden-syscall path when trapping is disabled, or is replaced with UD2 when trapping is enabled, even if the module imports pathconf. The new route is therefore not applied consistently to all executable code processed by the relinker. Please route this case in guest modules too, using the module's matching pathconf import/relocation, and add an integration regression with the stub in a bundled module; alternatively, document and substantiate that ps5-payload-dev can emit this stub only in the main executable and narrow the PR's stated scope.

Validation on this exact head: relinker-only Release build completed with GCC 12.2; guest_syscall_route and syscall_scanner passed 2/2. git diff --check and tools/check_conventions.py pass. A complete local CTest run completed 262/265: pr_overlap_encoding failed because the build directory was outside the Git worktree; masked_store_lowering and amd64_only_converter terminated with SIGILL on this host. I did not verify those three failures against base. The two tests directly covering the new main-executable path passed. Hosted conventions, intake and labels checks pass; no hosted product test result was present when I checked.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5640886892 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10792#pullrequestreview-5640886892). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-25T01:09:54Z. **Review:** DISMISSED --- The main-executable route is covered, but the same scanner is also used for every bundled guest module in `GuestModuleBuilder::Build` (around the `ScanCodeSectionForSyscalls` loop). That caller does not pass a `routedStubs` output vector and only applies returned trap offsets. Consequently, an exact syscall-191 SDK stub in a bundled PRX still reaches the forbidden-syscall path when trapping is disabled, or is replaced with `UD2` when trapping is enabled, even if the module imports `pathconf`. The new route is therefore not applied consistently to all executable code processed by the relinker. Please route this case in guest modules too, using the module's matching `pathconf` import/relocation, and add an integration regression with the stub in a bundled module; alternatively, document and substantiate that ps5-payload-dev can emit this stub only in the main executable and narrow the PR's stated scope. Validation on this exact head: relinker-only Release build completed with GCC 12.2; `guest_syscall_route` and `syscall_scanner` passed 2/2. `git diff --check` and `tools/check_conventions.py` pass. A complete local CTest run completed 262/265: `pr_overlap_encoding` failed because the build directory was outside the Git worktree; `masked_store_lowering` and `amd64_only_converter` terminated with `SIGILL` on this host. I did not verify those three failures against base. The two tests directly covering the new main-executable path passed. Hosted conventions, intake and labels checks pass; no hosted product test result was present when I checked.
MarcZX10 commented 2026-10-25 01:57:36 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-25T01:57:36Z.

Review: COMMENTED


Thanks for adding bundled-module routing and the cross-target integration fixtures. I rechecked the exact updated head 124980967196c7af6b53b76a5030298b05d61856: GuestModuleBuilder::Build now passes routed stubs to the module path, resolves the imported pathconf relocation, applies the indirect tail jump, and has no-import failure/trap cases. This addresses my earlier review finding, so I am withdrawing that request for changes. Local validation: tools/check_conventions.py and git diff --check pass, and the new Python test compiles with py_compile. I could not configure the focused CMake build from core/relinker alone because its CMake file expects project-level add_test_executable; I did not run the integration executable locally. Please keep the new fixture’s import/relocation layouts aligned with any parser changes.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5641031575 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10792#pullrequestreview-5641031575). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-25T01:57:36Z. **Review:** COMMENTED --- Thanks for adding bundled-module routing and the cross-target integration fixtures. I rechecked the exact updated head `124980967196c7af6b53b76a5030298b05d61856`: `GuestModuleBuilder::Build` now passes routed stubs to the module path, resolves the imported `pathconf` relocation, applies the indirect tail jump, and has no-import failure/trap cases. This addresses my earlier review finding, so I am withdrawing that request for changes. Local validation: `tools/check_conventions.py` and `git diff --check` pass, and the new Python test compiles with `py_compile`. I could not configure the focused CMake build from `core/relinker` alone because its CMake file expects project-level `add_test_executable`; I did not run the integration executable locally. Please keep the new fixture’s import/relocation layouts aligned with any parser changes.
MarcZX10 commented 2026-10-25 03:04:29 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-25T03:04:29Z.

Review: DISMISSED


The updated head fixes my earlier guest-module routing finding: the author added the import lookup, rewrite, trap/refusal cases and cross-format integration fixture. I have not independently run the updated integration executable; the 265/265 result is author-reported. One repository-rule blocker remains: the overlap check marks this PR and open #9549 and #10479 on the same SyscallScanner.cpp lines, while all three current checklists say Depends on: none. CONTRIBUTING.md requires the authors to agree on merge order and record it with Depends on. Please coordinate with both authors and update the affected checklist lines. Current visible checks are conventions and labels pass; the build/test workflow has no current product result. I have not modified or rebased your branch.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5641274227 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10792#pullrequestreview-5641274227). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-25T03:04:29Z. **Review:** DISMISSED --- The updated head fixes my earlier guest-module routing finding: the author added the import lookup, rewrite, trap/refusal cases and cross-format integration fixture. I have not independently run the updated integration executable; the 265/265 result is author-reported. One repository-rule blocker remains: the overlap check marks this PR and open #9549 and #10479 on the same `SyscallScanner.cpp` lines, while all three current checklists say `Depends on: none`. CONTRIBUTING.md requires the authors to agree on merge order and record it with `Depends on`. Please coordinate with both authors and update the affected checklist lines. Current visible checks are conventions and labels pass; the build/test workflow has no current product result. I have not modified or rebased your branch.
MarcZX10 commented 2026-11-01 03:15:28 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-01T03:15:28Z.

Review: CHANGES_REQUESTED


Reviewed — changes requested

The exact current head still routes through arbitrary matching pathconf relocation slots, which can make the new indirect jump load a non-function address or a truncated value.

What I ran

Reviewed head 37d8c7579ffaa58669ee7fb829e1aa38fc0b54fe. PR base is 1526c6aeaeee69361a2e89ab8bdabd68d0d707be; the current main tip was dc9dc7eaaeaf99b1c491d426e68bb999def3da16, and the PR merge preview against that tip was clean. Environment: Debian 12 x86_64, Python 3.11.2, GCC 12.2.0. No build or C++ tests were run.

git diff --check 1526c6aeaeee69361a2e89ab8bdabd68d0d707be...37d8c7579ffaa58669ee7fb829e1aa38fc0b54fe
python3 tools/check_conventions.py --base dc9dc7eaaeaf99b1c491d426e68bb999def3da16 --head 37d8c7579ffaa58669ee7fb829e1aa38fc0b54fe --title 'feat(relinker): route ps5-payload-dev pathconf stub to libkernel export' --body /tmp/anyps5-pr-precheck-10792/pr-body.md
python3 tools/check_test_registration.py --scripts
python3 tools/pr_stack_check.py 10792 --repo boykopovar/AnyPS5 --output-dir /tmp/anyps5-pr-precheck-10792/stack

Results

Check Result
git diff --check Passed
Conventions and PR template Passed
Test script registration Passed (235 scripts)
Current-main merge preview Clean
Declared dependency stack #10479 → #9549 → #10792; #9549 currently conflicts with main, and current dependency heads are not included in dependent heads
Test-quality heuristic Not executable: the precheck's fetched head worktree did not contain the local-only tools/pr_test_quality.py helper
Hosted checks on this head Conventions and labels passed; no product build/test check was present
Command output
$ git diff --check 1526c6aeaeee69361a2e89ab8bdabd68d0d707be...37d8c7579ffaa58669ee7fb829e1aa38fc0b54fe
[no output; exit status 0]
$ python3 tools/check_conventions.py --base dc9dc7eaaeaf99b1c491d426e68bb999def3da16 --head 37d8c7579ffaa58669ee7fb829e1aa38fc0b54fe --title 'feat(relinker): route ps5-payload-dev pathconf stub to libkernel export' --body /tmp/anyps5-pr-precheck-10792/pr-body.md
All conventions checks passed.
$ python3 tools/check_test_registration.py --scripts
235 test script(s), each run by an add_test or a workflow
$ python3 tools/pr_stack_check.py 10792 --repo boykopovar/AnyPS5 --output-dir /tmp/anyps5-pr-precheck-10792/stack
/tmp/anyps5-pr-precheck-10792/stack/stack-report.md
/tmp/anyps5-pr-precheck-10792/stack/stack-report.json
$ python3 /tmp/anyps5-pr-precheck-10792/head-37d8c7579ffa-e74e76d4/tools/pr_test_quality.py --root /tmp/anyps5-pr-precheck-10792/head-37d8c7579ffa-e74e76d4 --json core/relinker/CMakeLists.txt core/relinker/relinker/include/relinker/domain/ISyscallScanner.hpp core/relinker/relinker/src/analysis/SyscallScanner.cpp core/relinker/relinker/src/guest/GuestModuleBuilder.cpp core/relinker/relinker/src/pipeline/RelinkerPipeline.cpp core/relinker/relinker/tests/SyscallScannerTests.cpp core/relinker/relinker/tests/test_guest_syscall_route.py docs/dev/debt/relinker.md docs/user/USAGE.md
/usr/bin/python3: can't open file '/tmp/anyps5-pr-precheck-10792/head-37d8c7579ffa-e74e76d4/tools/pr_test_quality.py': [Errno 2] No such file or directory

Negative control

Assertion Change to code under test Did the test fail?
A route is refused unless its slot is a safe full-width function-address relocation No mutation performed Not exercised; exact-head build/test binaries were not available and I did not build

Findings

Blocking

  • The route accepts relocation types that do not safely represent a full-width function pointer. FindPathconfImport prefers R_X86_64_JUMP_SLOT but falls back to any matching NidReference; FindGuestPathconfImportAddress similarly falls back to any matching nonzero relocation type. Both then emit FF 25 to load 8 bytes from that relocation address as a function pointer. For example, an R_X86_64_64 slot contains S + A, so a nonzero addend routes to an interior address; narrower relocation slots are not valid 8-byte function-pointer slots. The fixtures only exercise zero-addend JUMP_SLOT. Please restrict both paths to relocation kinds and symbol forms that are verified to provide a full-width function pointer (and reject unsupported matches), then add main-executable and guest-module regressions for unsupported relocation types and a nonzero R_X86_64_64 addend.

Non-blocking

  • The declared stack correctly lists #10479 and #9549. The current stack report says #9549 conflicts with main; resolve the dependency stack before landing, then refresh the overlap/dependency check. This is not the basis for the change request.

Sources

Not verified

  • No local build, C++ unit tests, or guest-route integration executable was run. The author reports 265/265 tests on Linux; I did not independently reproduce that result.
  • No Windows, macOS, PS5, or runtime behavior was verified.

To get this to a good state

Restrict the route selectors to safe function-pointer relocations and add the two regression cases above in both executable and guest-module coverage. I will rerun the same checks on the updated head.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5726213663 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10792#pullrequestreview-5726213663). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-01T03:15:28Z. **Review:** CHANGES_REQUESTED --- # Reviewed — changes requested The exact current head still routes through arbitrary matching `pathconf` relocation slots, which can make the new indirect jump load a non-function address or a truncated value. ## What I ran Reviewed head `37d8c7579ffaa58669ee7fb829e1aa38fc0b54fe`. PR base is `1526c6aeaeee69361a2e89ab8bdabd68d0d707be`; the current `main` tip was `dc9dc7eaaeaf99b1c491d426e68bb999def3da16`, and the PR merge preview against that tip was clean. Environment: Debian 12 x86_64, Python 3.11.2, GCC 12.2.0. No build or C++ tests were run. ```sh git diff --check 1526c6aeaeee69361a2e89ab8bdabd68d0d707be...37d8c7579ffaa58669ee7fb829e1aa38fc0b54fe python3 tools/check_conventions.py --base dc9dc7eaaeaf99b1c491d426e68bb999def3da16 --head 37d8c7579ffaa58669ee7fb829e1aa38fc0b54fe --title 'feat(relinker): route ps5-payload-dev pathconf stub to libkernel export' --body /tmp/anyps5-pr-precheck-10792/pr-body.md python3 tools/check_test_registration.py --scripts python3 tools/pr_stack_check.py 10792 --repo boykopovar/AnyPS5 --output-dir /tmp/anyps5-pr-precheck-10792/stack ``` ## Results | Check | Result | |---|---| | `git diff --check` | Passed | | Conventions and PR template | Passed | | Test script registration | Passed (235 scripts) | | Current-main merge preview | Clean | | Declared dependency stack | #10479 → #9549 → #10792; #9549 currently conflicts with `main`, and current dependency heads are not included in dependent heads | | Test-quality heuristic | Not executable: the precheck's fetched head worktree did not contain the local-only `tools/pr_test_quality.py` helper | | Hosted checks on this head | Conventions and labels passed; no product build/test check was present | <details><summary>Command output</summary> ```text $ git diff --check 1526c6aeaeee69361a2e89ab8bdabd68d0d707be...37d8c7579ffaa58669ee7fb829e1aa38fc0b54fe [no output; exit status 0] $ python3 tools/check_conventions.py --base dc9dc7eaaeaf99b1c491d426e68bb999def3da16 --head 37d8c7579ffaa58669ee7fb829e1aa38fc0b54fe --title 'feat(relinker): route ps5-payload-dev pathconf stub to libkernel export' --body /tmp/anyps5-pr-precheck-10792/pr-body.md All conventions checks passed. $ python3 tools/check_test_registration.py --scripts 235 test script(s), each run by an add_test or a workflow $ python3 tools/pr_stack_check.py 10792 --repo boykopovar/AnyPS5 --output-dir /tmp/anyps5-pr-precheck-10792/stack /tmp/anyps5-pr-precheck-10792/stack/stack-report.md /tmp/anyps5-pr-precheck-10792/stack/stack-report.json $ python3 /tmp/anyps5-pr-precheck-10792/head-37d8c7579ffa-e74e76d4/tools/pr_test_quality.py --root /tmp/anyps5-pr-precheck-10792/head-37d8c7579ffa-e74e76d4 --json core/relinker/CMakeLists.txt core/relinker/relinker/include/relinker/domain/ISyscallScanner.hpp core/relinker/relinker/src/analysis/SyscallScanner.cpp core/relinker/relinker/src/guest/GuestModuleBuilder.cpp core/relinker/relinker/src/pipeline/RelinkerPipeline.cpp core/relinker/relinker/tests/SyscallScannerTests.cpp core/relinker/relinker/tests/test_guest_syscall_route.py docs/dev/debt/relinker.md docs/user/USAGE.md /usr/bin/python3: can't open file '/tmp/anyps5-pr-precheck-10792/head-37d8c7579ffa-e74e76d4/tools/pr_test_quality.py': [Errno 2] No such file or directory ``` </details> ## Negative control | Assertion | Change to code under test | Did the test fail? | |---|---|---| | A route is refused unless its slot is a safe full-width function-address relocation | No mutation performed | Not exercised; exact-head build/test binaries were not available and I did not build | ## Findings ### Blocking - **The route accepts relocation types that do not safely represent a full-width function pointer.** `FindPathconfImport` prefers `R_X86_64_JUMP_SLOT` but falls back to any matching `NidReference`; `FindGuestPathconfImportAddress` similarly falls back to any matching nonzero relocation type. Both then emit `FF 25` to load 8 bytes from that relocation address as a function pointer. For example, an `R_X86_64_64` slot contains `S + A`, so a nonzero addend routes to an interior address; narrower relocation slots are not valid 8-byte function-pointer slots. The fixtures only exercise zero-addend `JUMP_SLOT`. Please restrict both paths to relocation kinds and symbol forms that are verified to provide a full-width function pointer (and reject unsupported matches), then add main-executable and guest-module regressions for unsupported relocation types and a nonzero `R_X86_64_64` addend. ### Non-blocking - The declared stack correctly lists `#10479` and `#9549`. The current stack report says #9549 conflicts with `main`; resolve the dependency stack before landing, then refresh the overlap/dependency check. This is not the basis for the change request. ## Sources - [Current PR implementation: RelinkerPipeline.cpp at reviewed head](https://github.com/boykopovar/AnyPS5/blob/37d8c7579ffaa58669ee7fb829e1aa38fc0b54fe/core/relinker/relinker/src/pipeline/RelinkerPipeline.cpp#L31-L52) - [Current PR route patch at reviewed head](https://github.com/boykopovar/AnyPS5/blob/37d8c7579ffaa58669ee7fb829e1aa38fc0b54fe/core/relinker/relinker/src/pipeline/RelinkerPipeline.cpp#L499-L524) - [Current guest-module lookup and route at reviewed head](https://github.com/boykopovar/AnyPS5/blob/37d8c7579ffaa58669ee7fb829e1aa38fc0b54fe/core/relinker/relinker/src/guest/GuestModuleBuilder.cpp#L27-L55) - [x86-64 psABI relocation calculations at pinned commit](https://gitlab.com/x86-psABIs/x86-64-ABI/-/blob/e1ce098331da5dbd66e1ffc74162380bcc213236/x86-64-ABI/object-files.tex#L452-458) ## Not verified - No local build, C++ unit tests, or guest-route integration executable was run. The author reports 265/265 tests on Linux; I did not independently reproduce that result. - No Windows, macOS, PS5, or runtime behavior was verified. ## To get this to a good state Restrict the route selectors to safe function-pointer relocations and add the two regression cases above in both executable and guest-module coverage. I will rerun the same checks on the updated head.
MarcZX10 commented 2026-11-14 08:06:22 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-14T08:06:22Z.

Review: COMMENTED


Reviewed — no blocking findings

Nothing blocks this change; the points below are optional.

What I ran

Reviewed head 4030a8bc8c599211fc906d87e2fd20b86f289be3 using the prepared diff and pinned reader. No commands or tests were run.

Results

Check Result Note
Diff review passed Routing and trap paths inspected
Test suite not run Author reports 265/265 CTest tests passed

Findings

Blocking

None.

Non-blocking

None.

Not verified

The full contents and added lines of the changed files were not all read, so this review is incomplete. Excluded by the prepared review folder: none. Read: review/description.md, review/commits.md, review/manifest.json, review/diff.patch, review/README.md; inspected diff portions for the scanner, main pipeline, guest module builder, tests, and documentation. The remaining test diff and full changed file texts were not read. Reported build, test, and convention checks were supplied by the author and not run here.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5902990045 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10792#pullrequestreview-5902990045). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-14T08:06:22Z. **Review:** COMMENTED --- # Reviewed — no blocking findings Nothing blocks this change; the points below are optional. ## What I ran Reviewed head `4030a8bc8c599211fc906d87e2fd20b86f289be3` using the prepared diff and pinned reader. No commands or tests were run. ## Results | Check | Result | Note | |---|---|---| | Diff review | passed | Routing and trap paths inspected | | Test suite | not run | Author reports 265/265 CTest tests passed | ## Findings ### Blocking None. ### Non-blocking None. ## Not verified The full contents and added lines of the changed files were not all read, so this review is incomplete. Excluded by the prepared review folder: none. Read: `review/description.md`, `review/commits.md`, `review/manifest.json`, `review/diff.patch`, `review/README.md`; inspected diff portions for the scanner, main pipeline, guest module builder, tests, and documentation. The remaining test diff and full changed file texts were not read. Reported build, test, and convention checks were supplied by the author and not run here. ## To get this to a good state Nothing is required.
MarcZX10 commented 2026-11-16 06:31:36 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-16T06:31:36Z.

Review: COMMENTED


Reviewed — no blocking findings

The routing implementation and its changed documentation/tests were reviewed at head 2ec85f2191dc45d352c9f22a54c391af513fb836; the diff shows no verified blocking defect, but I could not run checks here.

What I ran

No commands were run; the review interface provides read-only access to the prepared review materials and repository reader. The author reports 265/265 ctest tests passed and the conventions check passed; these results were not independently verified.

Results

Check Result Note
Prepared diff review passed All nine changed files were represented in the diff.
Test suite and conventions not run Results are author-reported only.

Findings

Blocking

None.

Non-blocking

None.

Not verified

Build, test suite, conventions check, and runtime behavior were not run. The changed files reviewed were core/relinker/CMakeLists.txt, core/relinker/relinker/include/relinker/domain/ISyscallScanner.hpp, core/relinker/relinker/src/analysis/SyscallScanner.cpp, core/relinker/relinker/src/guest/GuestModuleBuilder.cpp, core/relinker/relinker/src/pipeline/RelinkerPipeline.cpp, core/relinker/relinker/tests/SyscallScannerTests.cpp, core/relinker/relinker/tests/test_guest_syscall_route.py, docs/dev/debt/relinker.md, and docs/user/USAGE.md. No changed file was excluded from the prepared diff.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5915886794 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10792#pullrequestreview-5915886794). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-16T06:31:36Z. **Review:** COMMENTED --- # Reviewed — no blocking findings The routing implementation and its changed documentation/tests were reviewed at head `2ec85f2191dc45d352c9f22a54c391af513fb836`; the diff shows no verified blocking defect, but I could not run checks here. ## What I ran No commands were run; the review interface provides read-only access to the prepared review materials and repository reader. The author reports 265/265 ctest tests passed and the conventions check passed; these results were not independently verified. ## Results | Check | Result | Note | |---|---|---| | Prepared diff review | passed | All nine changed files were represented in the diff. | | Test suite and conventions | not run | Results are author-reported only. | ## Findings ### Blocking None. ### Non-blocking None. ## Not verified Build, test suite, conventions check, and runtime behavior were not run. The changed files reviewed were `core/relinker/CMakeLists.txt`, `core/relinker/relinker/include/relinker/domain/ISyscallScanner.hpp`, `core/relinker/relinker/src/analysis/SyscallScanner.cpp`, `core/relinker/relinker/src/guest/GuestModuleBuilder.cpp`, `core/relinker/relinker/src/pipeline/RelinkerPipeline.cpp`, `core/relinker/relinker/tests/SyscallScannerTests.cpp`, `core/relinker/relinker/tests/test_guest_syscall_route.py`, `docs/dev/debt/relinker.md`, and `docs/user/USAGE.md`. No changed file was excluded from the prepared diff. ## To get this to a good state Nothing is required.
catminou4 commented 2026-11-25 06:20:25 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by catminou4 on 2026-11-25T06:20:25Z.

Review: COMMENTED


Reviewed the merge of this branch into current main (3cab484efb) on Linux x86_64, relinker-only Release build (GCC).

  • ctest -R syscall (7 tests, including the new guest_syscall_route and the extended syscall_scanner) passes.
  • Full relinker-only ctest -j8: 1116/1117 pass. The one failure, tools_headers_manifest (test_hash_rejects_changes_that_preserve_file_size_and_mtime), is in tools/, which this PR does not touch.
  • The routing is generic: FreeBSD syscall 191 is pathconf, not a title-specific value. The 13-byte stub becomes jmp [rip+disp32] through the import's GOT slot plus 7 NOPs, with JUMP_SLOT preferred over GLOB_DAT/R_X86_64_64. Without an import it traps under --trap-sdk-syscall-stubs and fails with a clear message otherwise. Other numbers are still refused.

Points to address:

  • RelinkerPipeline.cpp now also mirrors ordinary UD2 syscall traps into textSection for index == 0. That changes the existing trap path, outside the pathconf routing. Split it out, or name and test it in the PR body.
  • The main-executable route skips the GamePatch::CheckOverlaps call that the guest-module path does, so a game patch over the stub is not detected there.
  • FindPathconfImport and FindGuestPathconfImportAddress duplicate the name/NID matching (pathconf, oc98+zOImus, pathconf_nid_postfix). One shared helper would keep them in sync.

Builds and its tests pass. Mergeable once the unrelated textSection trap change is split out or justified.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6052755628 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10792#pullrequestreview-6052755628). Originally posted by [catminou4](https://github.com/catminou4) on 2026-11-25T06:20:25Z. **Review:** COMMENTED --- Reviewed the merge of this branch into current `main` (3cab484efb) on Linux x86_64, relinker-only Release build (GCC). - `ctest -R syscall` (7 tests, including the new `guest_syscall_route` and the extended `syscall_scanner`) passes. - Full relinker-only `ctest -j8`: 1116/1117 pass. The one failure, `tools_headers_manifest` (`test_hash_rejects_changes_that_preserve_file_size_and_mtime`), is in `tools/`, which this PR does not touch. - The routing is generic: FreeBSD syscall 191 is `pathconf`, not a title-specific value. The 13-byte stub becomes `jmp [rip+disp32]` through the import's GOT slot plus 7 NOPs, with JUMP_SLOT preferred over GLOB_DAT/R_X86_64_64. Without an import it traps under `--trap-sdk-syscall-stubs` and fails with a clear message otherwise. Other numbers are still refused. Points to address: - `RelinkerPipeline.cpp` now also mirrors ordinary `UD2` syscall traps into `textSection` for `index == 0`. That changes the existing trap path, outside the pathconf routing. Split it out, or name and test it in the PR body. - The main-executable route skips the `GamePatch::CheckOverlaps` call that the guest-module path does, so a game patch over the stub is not detected there. - `FindPathconfImport` and `FindGuestPathconfImportAddress` duplicate the name/NID matching (`pathconf`, `oc98+zOImus`, `pathconf_nid_postfix`). One shared helper would keep them in sync. Builds and its tests pass. Mergeable once the unrelated `textSection` trap change is split out or justified.
MarcZX10 commented 2026-11-25 16:30:21 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-25T16:30:21Z.

Review: APPROVED


Reviewed — looks good

Nothing blocks this change; the implementation and included tests support the stated routing behavior, though I did not run the checks.

What I ran

Read the prepared diff and targeted source at head beb57b2878ccfb3d89b5bc4cff25fcf656f3bba7. No build or tests were run. Commands: none.

Results

Check Result Note
Diff and source review passed Routing paths and scanner inspected
Build and test suite not run Results in the PR description are author-reported
Negative control not run No executable test mutation was run

Findings

Blocking

None.

Non-blocking

None.

Not verified

No build, tests, convention check, physical console run, or generated binary behavior was verified in this review. I read all changed files listed in the manifest: core/relinker/CMakeLists.txt, core/relinker/relinker/include/relinker/analysis/PathconfImport.hpp, core/relinker/relinker/include/relinker/domain/ISyscallScanner.hpp, core/relinker/relinker/src/analysis/SyscallScanner.cpp, core/relinker/relinker/src/guest/GuestModuleBuilder.cpp, core/relinker/relinker/src/pipeline/RelinkerPipeline.cpp, core/relinker/relinker/tests/SyscallScannerTests.cpp, core/relinker/relinker/tests/test_guest_syscall_route.py, docs/dev/debt/relinker.md, and docs/user/USAGE.md. No changed files were excluded by the manifest.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6061194280 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10792#pullrequestreview-6061194280). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-25T16:30:21Z. **Review:** APPROVED --- # Reviewed — looks good Nothing blocks this change; the implementation and included tests support the stated routing behavior, though I did not run the checks. ## What I ran Read the prepared diff and targeted source at head `beb57b2878ccfb3d89b5bc4cff25fcf656f3bba7`. No build or tests were run. Commands: none. ## Results | Check | Result | Note | |---|---|---| | Diff and source review | passed | Routing paths and scanner inspected | | Build and test suite | not run | Results in the PR description are author-reported | | Negative control | not run | No executable test mutation was run | ## Findings ### Blocking None. ### Non-blocking None. ## Not verified No build, tests, convention check, physical console run, or generated binary behavior was verified in this review. I read all changed files listed in the manifest: `core/relinker/CMakeLists.txt`, `core/relinker/relinker/include/relinker/analysis/PathconfImport.hpp`, `core/relinker/relinker/include/relinker/domain/ISyscallScanner.hpp`, `core/relinker/relinker/src/analysis/SyscallScanner.cpp`, `core/relinker/relinker/src/guest/GuestModuleBuilder.cpp`, `core/relinker/relinker/src/pipeline/RelinkerPipeline.cpp`, `core/relinker/relinker/tests/SyscallScannerTests.cpp`, `core/relinker/relinker/tests/test_guest_syscall_route.py`, `docs/dev/debt/relinker.md`, and `docs/user/USAGE.md`. No changed files were excluded by the manifest. ## To get this to a good state Nothing is required.
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!10792
No description provided.