fix(relinker): preserve weak imports in guest module registries #6240

Merged
ArjenS-LA merged 2 commits from upstream-pr/6240 into main 2026-10-18 22:06:31 +00:00
ArjenS-LA commented 2026-10-15 06:41:12 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ArjenS-LA on 2026-10-15T06:41:12Z.


What

Guest-module registries dropped the ELF weak binding even though executable registries already preserved it. Carry the binding into each relocation record and emit "weak": true for weak imports. Strong records retain their existing shape. This corrects diagnostic metadata; it does not change guest runtime resolution.

Tested

Windows 11 x64 (build 26200), WinLibs MinGW-w64 GCC 15.2.0 r7, CMake 4.3.1, Ninja 1.13.2, Python 3.13.7. Baseline: d92a8dad390af1807cc91622b924252141816a5a. Branch: fix/guest-registry-weak-imports. Commit: 96f506f8707ce1cd3cb4beebd56de44227f16990. Committed-object conventions check passed.

The modified test_guest_registry.py fails on unchanged main because the weak field is absent, and passes fixed for Linux and Windows output, including GLOB_DAT/JUMP_SLOT records and strong imports. The full relinker CTest directory passed 126 tests with one long_paths skip. After preserving the old strong-record shape, the affected guest_registry, call_registry and relinker_conversion checks passed again, and the real homebrew registry comparison was rerun.

cmake -S . -B build-relinker -G Ninja -DCMAKE_BUILD_TYPE=Release -DANYPS5_RELINKER_ONLY=ON -DBUILD_TESTING=ON -DPython3_EXECUTABLE=$python
cmake --build build-relinker --parallel 8
ctest --test-dir build-relinker -N
ctest --test-dir build-relinker/core/relinker --output-on-failure -j 4

input_magic and other Python-backed tests were registered. Native Linux/macOS and full-library tests were not run locally.

Documentation follow-up: 00c704697b00e28bf8ed8b84b379cf2e4fb6da19 moves the weak-import paragraph below the class table without changing its wording. Windows x64 content checks and git diff --check pass; python tools/check_conventions.py --base origin/main passes on this commit. Runtime regression testing is not applicable to this paragraph relocation; the behavioral results above remain tied to 96f506f8707ce1cd3cb4beebd56de44227f16990.

Homebrew evidence

Converted the real Mari0 bundle with baseline and fixed relinkers using --windows --registry --trap-sdk-syscall-stubs --module-dir .. Both used a separate, otherwise byte-identical copy with an added empty sce_module directory; this comparison does not depend on the explicit-directory fix. Both conversions exit 0.

Read the shipped libOSMesa.so.8 dynamic symbol table as the binding oracle. The baseline module registry omits weak metadata; the fixed registry correctly marks all ten weak-import relocation records, including kernel_mprotect, __dlopen, __dlsym, __dladdr, __dlclose, __dlerror and the four ZSTD_trace_* imports. All other registry fields remain identical, and strong records retain their old shape. This proves a diagnostic metadata correction, not improved module loading.

Package: Mari0 1.6.2 from websrv v0.34. Original layout and input hashes were checked before and after conversion; all inputs remained unchanged.

Input SHA-256
Mari0.zip e0331ed5a22e7fe72843d268cd2c8b297d761a75b7c83d828f5cc58a82a72ce3
love.elf 54bcc91670fd759bbd3488284dce351b6421cb83016e9ad8da6b5186da067a39
libOSMesa.so.8 128d2ab20b980b96decb1f20a9ed57d10cc922605259666b63efa52963920f0a

No generated homebrew executable was run. No game startup, gameplay, GPU, commercial-title, or physical-PS5 result is claimed. Synthetic regression tests additionally execute their existing small Windows fixtures; that is separate from homebrew conversion evidence.

Baseline relinker SHA-256: a249e5a38abe9f338f09d6ea09182b5a39cd156dada6771984b85e315fda67c5. Tested fixed relinker SHA-256: 8b405bc0bb19048234375d53cad08db350828f2b14432e40ba6ac57736e2f3a8.

Local logs, exact argv, per-file hashes, source patches, before/after failures and JSON results: C:/Users/arjen/AppData/Local/Temp/anyps5-three-homebrew-20261014 (homebrew-report.json, regression logs and CTest logs). The commands and decisive results are included above so this report does not depend on access to that local folder.

Open PR comparison

Complete paginated inventory: 544 open PRs; main d92a8dad390af1807cc91622b924252141816a5a. Complete changed-file lists and tree-only merge previews used that main as the explicit common base. This change merges with main and both other proposed changes. 21 relevant comparisons merge cleanly; 23 remain inconclusive because the other PR already conflicts with main. No conflict-free claim is made for those PRs.

Exact compared heads and shared-file results
PR Head Shared paths Result
#6239 f9f6872b8d293ee0353e2f2dd95c49840da209ad docs/user/USAGE.md clean
#6231 1800d3892bec857b254ca8c55e912e325e1c6711 docs/user/USAGE.md clean
#6190 09afe38730d7b9d40d57b8aa9e13777012d170a3 docs/user/USAGE.md clean
#6171 657f16ea286035a8615e2d56614a354cd4559e31 docs/user/USAGE.md clean
#6111 c690012ce1b6f73ab985c061509e7cbfb41127c2 docs/user/USAGE.md clean
#6106 78b906fb67a8edff3969f60d26ced129f981139e core/relinker/relinker/src/guest/GuestModuleBuilder.cpp clean
#6012 62022e9362a27432e007cea132ecd9ca0909bb2b docs/user/USAGE.md clean
#5994 8997cac1b840998182bfc6afc32f70c91f5f3d56 core/relinker/relinker/src/guest/GuestModuleBuilder.cpp clean
#5962 1f98703dd07a6257c84ea485594d92f5a8e84fba docs/user/USAGE.md clean
#5925 3339ddd3af77cfc336148966657c0d14e87b6ae1 docs/user/USAGE.md inconclusive: existing main conflicts
#5875 569ff84ea2589a9c886dca37b5c9ddcea70049bd docs/user/USAGE.md inconclusive: existing main conflicts
#5835 e4036135ed0823b866969e6e7e688712b0f57fcc docs/user/USAGE.md clean
#5784 9acd5dcc07d8149020bf50fbd5e09f7633a2613f docs/user/USAGE.md clean
#5695 acc228ab4a54fbdc0c816c22b52b82968e42649b docs/user/USAGE.md clean
#5681 0b10e2467adb8f780005793b04be71fce4ce36b3 core/relinker/relinker/src/guest/GuestModuleBuilder.cpp clean
#5598 48685f40e1ff769f4fbbe46d63d0170fcbf680ee core/relinker/relinker/src/guest/GuestModuleBuilder.cpp, core/relinker/relinker/tests/test_guest_registry.py clean
#5582 2d14128a29ec22d25e0cb308777dd46894a73170 docs/user/USAGE.md clean
#5559 a38314933da4209c8ee36faafa3e7c6a8f7976ea core/relinker/relinker/src/guest/GuestModuleBuilder.cpp clean
#5390 d4fa8367daa0fd826853f440d23c3a604af43449 docs/user/USAGE.md inconclusive: existing main conflicts
#5021 01f2073d06385ca2adb537d4996ad61e8255bd2e docs/user/USAGE.md inconclusive: existing main conflicts
#4891 ab0e383aca0fd9c8d873293ec0ffa170d750baa4 docs/user/USAGE.md inconclusive: existing main conflicts
#4855 82de94cbedc5461de6af731b2a5a9838aca66e48 docs/user/USAGE.md clean
#4847 b05e5cf8ecf4f410750c38a6f281f273babb816d docs/user/USAGE.md clean
#4813 2d6b8ef4341e21d78686bfba9da9a5c6bb14d629 docs/user/USAGE.md inconclusive: existing main conflicts
#4760 1263d7065489fd6b7a15ebbecb1fcf0ee72d21f9 docs/user/USAGE.md inconclusive: existing main conflicts
#4749 07713af3078fcb4e24a15c96bf15c3df4e2b071a docs/user/USAGE.md inconclusive: existing main conflicts
#4740 beb1ba79f2b3a2fc3882bf9d65553e4e754fc03d docs/user/USAGE.md inconclusive: existing main conflicts
#4718 e4b37aa2e22c15e0e07341a7d8c18100cbae55c2 docs/user/USAGE.md inconclusive: existing main conflicts
#4599 8c49e6d6960021ef72e1382d78b9b83914cc7f31 docs/user/USAGE.md inconclusive: existing main conflicts
#4566 16b602cbfb29dcf3fc89b4ed67f228d65a27b20b docs/user/USAGE.md inconclusive: existing main conflicts
#4523 66c8f11a47d64c2db6f514e409e94e91f5ac5309 docs/user/USAGE.md inconclusive: existing main conflicts
#4522 92b12559c64489b556179b651ab4d966c29314ec docs/user/USAGE.md inconclusive: existing main conflicts
#4521 67f9e72d1c663dbc8811cdb6c85753844be02381 docs/user/USAGE.md inconclusive: existing main conflicts
#4520 b339b4f6ca25b1b274555394e73a26f8c8d98347 docs/user/USAGE.md inconclusive: existing main conflicts
#4424 b447062d71dc1748d60edfdc0ec437aa597a5b7d docs/user/USAGE.md inconclusive: existing main conflicts
#4423 bad53434ecca2bf92ee67c43952598c6a108941e docs/user/USAGE.md inconclusive: existing main conflicts
#4422 f9b136024e27d1463a70edee4952553628e5f289 docs/user/USAGE.md inconclusive: existing main conflicts
#4397 5e296b79d94a6312c385890352d7f76e9a0d4380 docs/user/USAGE.md inconclusive: existing main conflicts
#4396 eb34b754de4b65b11c1f7d9beafe58a0d057c45d docs/user/USAGE.md inconclusive: existing main conflicts
#4156 a6cb0cb5f277da258a661bb11792e04941f4c790 docs/user/USAGE.md inconclusive: existing main conflicts
#3998 48bc3322b68ee855d9188f4eefd701e8007dd21b docs/user/USAGE.md clean
#3994 2636a486c2f71d880b69cadb706eac719f9cc670 docs/user/USAGE.md clean
#3891 67f94df827623df9210738a5ba3275b9a59f1c8b docs/user/USAGE.md inconclusive: existing main conflicts
#3786 7b75adc8685edbffaa771e0d436543eaae694b8f docs/user/USAGE.md clean

Source comparisons: #5598 includes declared host imports, #6106/#5559 change dependency selection, #5994 changes syscall scanning, and #5681 validates bounds. None preserves weak registry bindings. Emitting the extra field only for weak imports retains the strong-record shape expected by #5598; combined runtime behavior was not tested.

Checklist

  • Based on current main; no other open PR implements the same fix (overlapping changes listed above)
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw; no silent stubs added
  • No notes, investigation files or images added to the repository
  • No new third-party code
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Unblocks: none (conversion/diagnostic evidence only)
  • GPUs tested: n/a
  • AI-assisted: yes (Codex)
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4869314395 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6240). Originally posted by [ArjenS-LA](https://github.com/ArjenS-LA) on 2026-10-15T06:41:12Z. --- ### What Guest-module registries dropped the ELF weak binding even though executable registries already preserved it. Carry the binding into each relocation record and emit `"weak": true` for weak imports. Strong records retain their existing shape. This corrects diagnostic metadata; it does not change guest runtime resolution. ### Tested Windows 11 x64 (build 26200), WinLibs MinGW-w64 GCC 15.2.0 r7, CMake 4.3.1, Ninja 1.13.2, Python 3.13.7. Baseline: `d92a8dad390af1807cc91622b924252141816a5a`. Branch: `fix/guest-registry-weak-imports`. Commit: `96f506f8707ce1cd3cb4beebd56de44227f16990`. Committed-object conventions check passed. The modified `test_guest_registry.py` fails on unchanged main because the weak field is absent, and passes fixed for Linux and Windows output, including GLOB_DAT/JUMP_SLOT records and strong imports. The full relinker CTest directory passed 126 tests with one `long_paths` skip. After preserving the old strong-record shape, the affected `guest_registry`, `call_registry` and `relinker_conversion` checks passed again, and the real homebrew registry comparison was rerun. ```powershell cmake -S . -B build-relinker -G Ninja -DCMAKE_BUILD_TYPE=Release -DANYPS5_RELINKER_ONLY=ON -DBUILD_TESTING=ON -DPython3_EXECUTABLE=$python cmake --build build-relinker --parallel 8 ctest --test-dir build-relinker -N ctest --test-dir build-relinker/core/relinker --output-on-failure -j 4 ``` `input_magic` and other Python-backed tests were registered. Native Linux/macOS and full-library tests were not run locally. Documentation follow-up: `00c704697b00e28bf8ed8b84b379cf2e4fb6da19` moves the weak-import paragraph below the class table without changing its wording. Windows x64 content checks and `git diff --check` pass; `python tools/check_conventions.py --base origin/main` passes on this commit. Runtime regression testing is not applicable to this paragraph relocation; the behavioral results above remain tied to `96f506f8707ce1cd3cb4beebd56de44227f16990`. #### Homebrew evidence Converted the real Mari0 bundle with baseline and fixed relinkers using `--windows --registry --trap-sdk-syscall-stubs --module-dir .`. Both used a separate, otherwise byte-identical copy with an added empty `sce_module` directory; this comparison does not depend on the explicit-directory fix. Both conversions exit 0. Read the shipped `libOSMesa.so.8` dynamic symbol table as the binding oracle. The baseline module registry omits weak metadata; the fixed registry correctly marks all ten weak-import relocation records, including `kernel_mprotect`, `__dlopen`, `__dlsym`, `__dladdr`, `__dlclose`, `__dlerror` and the four `ZSTD_trace_*` imports. All other registry fields remain identical, and strong records retain their old shape. This proves a diagnostic metadata correction, not improved module loading. Package: [Mari0 1.6.2 from websrv v0.34](https://github.com/ps5-payload-dev/websrv/releases/download/v0.34/Mari0.zip). Original layout and input hashes were checked before and after conversion; all inputs remained unchanged. | Input | SHA-256 | |---|---| | Mari0.zip | `e0331ed5a22e7fe72843d268cd2c8b297d761a75b7c83d828f5cc58a82a72ce3` | | love.elf | `54bcc91670fd759bbd3488284dce351b6421cb83016e9ad8da6b5186da067a39` | | libOSMesa.so.8 | `128d2ab20b980b96decb1f20a9ed57d10cc922605259666b63efa52963920f0a` | No generated homebrew executable was run. No game startup, gameplay, GPU, commercial-title, or physical-PS5 result is claimed. Synthetic regression tests additionally execute their existing small Windows fixtures; that is separate from homebrew conversion evidence. Baseline relinker SHA-256: `a249e5a38abe9f338f09d6ea09182b5a39cd156dada6771984b85e315fda67c5`. Tested fixed relinker SHA-256: `8b405bc0bb19048234375d53cad08db350828f2b14432e40ba6ac57736e2f3a8`. Local logs, exact argv, per-file hashes, source patches, before/after failures and JSON results: `C:/Users/arjen/AppData/Local/Temp/anyps5-three-homebrew-20261014` (`homebrew-report.json`, regression logs and CTest logs). The commands and decisive results are included above so this report does not depend on access to that local folder. #### Open PR comparison Complete paginated inventory: 544 open PRs; main `d92a8dad390af1807cc91622b924252141816a5a`. Complete changed-file lists and tree-only merge previews used that main as the explicit common base. This change merges with main and both other proposed changes. 21 relevant comparisons merge cleanly; 23 remain inconclusive because the other PR already conflicts with main. No conflict-free claim is made for those PRs. <details> <summary>Exact compared heads and shared-file results</summary> | PR | Head | Shared paths | Result | |---|---|---|---| | #6239 | `f9f6872b8d293ee0353e2f2dd95c49840da209ad` | `docs/user/USAGE.md` | clean | | #6231 | `1800d3892bec857b254ca8c55e912e325e1c6711` | `docs/user/USAGE.md` | clean | | #6190 | `09afe38730d7b9d40d57b8aa9e13777012d170a3` | `docs/user/USAGE.md` | clean | | #6171 | `657f16ea286035a8615e2d56614a354cd4559e31` | `docs/user/USAGE.md` | clean | | #6111 | `c690012ce1b6f73ab985c061509e7cbfb41127c2` | `docs/user/USAGE.md` | clean | | #6106 | `78b906fb67a8edff3969f60d26ced129f981139e` | `core/relinker/relinker/src/guest/GuestModuleBuilder.cpp` | clean | | #6012 | `62022e9362a27432e007cea132ecd9ca0909bb2b` | `docs/user/USAGE.md` | clean | | #5994 | `8997cac1b840998182bfc6afc32f70c91f5f3d56` | `core/relinker/relinker/src/guest/GuestModuleBuilder.cpp` | clean | | #5962 | `1f98703dd07a6257c84ea485594d92f5a8e84fba` | `docs/user/USAGE.md` | clean | | #5925 | `3339ddd3af77cfc336148966657c0d14e87b6ae1` | `docs/user/USAGE.md` | inconclusive: existing main conflicts | | #5875 | `569ff84ea2589a9c886dca37b5c9ddcea70049bd` | `docs/user/USAGE.md` | inconclusive: existing main conflicts | | #5835 | `e4036135ed0823b866969e6e7e688712b0f57fcc` | `docs/user/USAGE.md` | clean | | #5784 | `9acd5dcc07d8149020bf50fbd5e09f7633a2613f` | `docs/user/USAGE.md` | clean | | #5695 | `acc228ab4a54fbdc0c816c22b52b82968e42649b` | `docs/user/USAGE.md` | clean | | #5681 | `0b10e2467adb8f780005793b04be71fce4ce36b3` | `core/relinker/relinker/src/guest/GuestModuleBuilder.cpp` | clean | | #5598 | `48685f40e1ff769f4fbbe46d63d0170fcbf680ee` | `core/relinker/relinker/src/guest/GuestModuleBuilder.cpp`, `core/relinker/relinker/tests/test_guest_registry.py` | clean | | #5582 | `2d14128a29ec22d25e0cb308777dd46894a73170` | `docs/user/USAGE.md` | clean | | #5559 | `a38314933da4209c8ee36faafa3e7c6a8f7976ea` | `core/relinker/relinker/src/guest/GuestModuleBuilder.cpp` | clean | | #5390 | `d4fa8367daa0fd826853f440d23c3a604af43449` | `docs/user/USAGE.md` | inconclusive: existing main conflicts | | #5021 | `01f2073d06385ca2adb537d4996ad61e8255bd2e` | `docs/user/USAGE.md` | inconclusive: existing main conflicts | | #4891 | `ab0e383aca0fd9c8d873293ec0ffa170d750baa4` | `docs/user/USAGE.md` | inconclusive: existing main conflicts | | #4855 | `82de94cbedc5461de6af731b2a5a9838aca66e48` | `docs/user/USAGE.md` | clean | | #4847 | `b05e5cf8ecf4f410750c38a6f281f273babb816d` | `docs/user/USAGE.md` | clean | | #4813 | `2d6b8ef4341e21d78686bfba9da9a5c6bb14d629` | `docs/user/USAGE.md` | inconclusive: existing main conflicts | | #4760 | `1263d7065489fd6b7a15ebbecb1fcf0ee72d21f9` | `docs/user/USAGE.md` | inconclusive: existing main conflicts | | #4749 | `07713af3078fcb4e24a15c96bf15c3df4e2b071a` | `docs/user/USAGE.md` | inconclusive: existing main conflicts | | #4740 | `beb1ba79f2b3a2fc3882bf9d65553e4e754fc03d` | `docs/user/USAGE.md` | inconclusive: existing main conflicts | | #4718 | `e4b37aa2e22c15e0e07341a7d8c18100cbae55c2` | `docs/user/USAGE.md` | inconclusive: existing main conflicts | | #4599 | `8c49e6d6960021ef72e1382d78b9b83914cc7f31` | `docs/user/USAGE.md` | inconclusive: existing main conflicts | | #4566 | `16b602cbfb29dcf3fc89b4ed67f228d65a27b20b` | `docs/user/USAGE.md` | inconclusive: existing main conflicts | | #4523 | `66c8f11a47d64c2db6f514e409e94e91f5ac5309` | `docs/user/USAGE.md` | inconclusive: existing main conflicts | | #4522 | `92b12559c64489b556179b651ab4d966c29314ec` | `docs/user/USAGE.md` | inconclusive: existing main conflicts | | #4521 | `67f9e72d1c663dbc8811cdb6c85753844be02381` | `docs/user/USAGE.md` | inconclusive: existing main conflicts | | #4520 | `b339b4f6ca25b1b274555394e73a26f8c8d98347` | `docs/user/USAGE.md` | inconclusive: existing main conflicts | | #4424 | `b447062d71dc1748d60edfdc0ec437aa597a5b7d` | `docs/user/USAGE.md` | inconclusive: existing main conflicts | | #4423 | `bad53434ecca2bf92ee67c43952598c6a108941e` | `docs/user/USAGE.md` | inconclusive: existing main conflicts | | #4422 | `f9b136024e27d1463a70edee4952553628e5f289` | `docs/user/USAGE.md` | inconclusive: existing main conflicts | | #4397 | `5e296b79d94a6312c385890352d7f76e9a0d4380` | `docs/user/USAGE.md` | inconclusive: existing main conflicts | | #4396 | `eb34b754de4b65b11c1f7d9beafe58a0d057c45d` | `docs/user/USAGE.md` | inconclusive: existing main conflicts | | #4156 | `a6cb0cb5f277da258a661bb11792e04941f4c790` | `docs/user/USAGE.md` | inconclusive: existing main conflicts | | #3998 | `48bc3322b68ee855d9188f4eefd701e8007dd21b` | `docs/user/USAGE.md` | clean | | #3994 | `2636a486c2f71d880b69cadb706eac719f9cc670` | `docs/user/USAGE.md` | clean | | #3891 | `67f94df827623df9210738a5ba3275b9a59f1c8b` | `docs/user/USAGE.md` | inconclusive: existing main conflicts | | #3786 | `7b75adc8685edbffaa771e0d436543eaae694b8f` | `docs/user/USAGE.md` | clean | </details> Source comparisons: #5598 includes declared host imports, #6106/#5559 change dependency selection, #5994 changes syscall scanning, and #5681 validates bounds. None preserves weak registry bindings. Emitting the extra field only for weak imports retains the strong-record shape expected by #5598; combined runtime behavior was not tested. ### Checklist - [x] Based on current `main`; no other open PR implements the same fix (overlapping changes listed above) - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except technical debt - [x] Unimplemented paths throw; no silent stubs added - [x] No notes, investigation files or images added to the repository - [x] No new third-party code - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Unblocks: none (conversion/diagnostic evidence only) - [x] GPUs tested: n/a - [x] AI-assisted: yes (Codex)
screamm commented 2026-10-15 09:16:17 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by screamm on 2026-10-15T09:16:17Z.


Cross-check on Windows: #6240 head 96f506f87 on main d92a8dad3 (fast-forward, no conflict).

Host: Windows 11 Pro 26220, Ryzen 7 5700X, RTX 4070 (driver 596.21), WinLibs MinGW-w64 GCC 15.2.0 r7, Ninja, Release.

  • Build: full build and libs both succeed, with no new warnings.
  • Tests: ctest --test-dir build/core/relinker --repeat until-fail:3 passes all 127 relinker tests 3/3, 381 of 381 runs. That includes guest_registry, call_registry, relinker_conversion, weak_imports and guest_module_dir(ectories). long_paths runs and passes on this host.
  • Negative control: the PR's test_guest_registry.py against main's relinker fails:
    AssertionError: ('linux', [{'nid': 'CCCCCCCCCCC', 'library': '', 'targetOffset': '0x2388'}, {'nid': 'CCCCCCCCCCC', 'library': '', 'targetOffset': '0x2390'}])
    
  • Suite, ctest -j8 --timeout 120 -E '^agc_driver_|^video_out_flip': 814 tests, and 813 pass, including the 2 skipped.
    • hardware_oracle_compare hit its own 20 s timeout under load.
    • It passes alone in 11.07 s. It is a tools/hw-oracle script that this PR does not touch.
  • Checks: check_conventions.py and git diff --check are clean.

All 51 local catalog ELFs, relinked with main's and with this PR's relinker. Each title used its usual flags:

  • always --windows --registry unused-filter=0;
  • --trap-sdk-syscall-stubs for 8 titles and --windows-fixed-base 0x400000 for 3;
  • --module-dir for PPSA28319 and PPSA99995, and --executable picker/picker.bin for PPSA99169.

main's relinker is deterministic here: relinking 4 titles a second time gave identical bytes.

  • Exit codes: 50 titles exit 0 with both relinkers. PPSA99995 exits 2 with both, on the same Wine ntdll.prx TLS refusal (#6102). Without --module-dir, its outputs are identical.
  • Identical outputs: 47 titles give byte-identical output trees.
  • 4 titles differ, each in one file only, app.libc.prx.guest.prx.registry.json, where two records gain "weak": true. Every app.exe, .prx, app.registry.json and .needed.json is identical.
Title libc.prx build Records that gain "weak": true
PPSA28319 Middle Ages Ping Pong 83ae42e8... kbw4UHHSYy0 (__pthread_cxa_finalize, libkernel.prx), 2 relocations
PPSA99109 Prospero Explorer 933e7f29... same
PPSA99110 Prospero Multi Tools 933e7f29... same
PPSA99920 Prospero Vibrate 933e7f29... same

The 51 titles ship four libc.prx builds. I read each module's own dynamic symbol table with a separate parser, not the relinker:

  • In the two builds above, kbw4UHHSYy0#A#B is STB_WEAK.
  • In the other two builds, which 47 titles use, it is GLOBAL.
  • Over all 53 module registries the PR wrote (50 × libc.prx, plus PPSA28319's Il2CppUserAssemblies.prx, PS5Util.prx and lib_burst_generated.prx), the 8 records marked weak are exactly the 8 STB_WEAK imports. No weak import is unmarked, and no strong one is marked.

tools/import_audit.py prints the same report for the old and new registries of these four titles. __pthread_cxa_finalize is implemented, so Current stop is none either way.

The four titles that differ, 60 s each with the display on. Each was run once with each relinker's output and main's libraries:

Title main relinker this PR
Prospero Vibrate (PPSA99920) running at 60 s, 612 frames running at 60 s, 629 frames
Prospero Multi Tools (PPSA99110) running at 60 s, 530 frames running at 60 s, 580 frames
Prospero Explorer (PPSA99109) running at 60 s, 662 frames running at 60 s, 612 frames
Middle Ages Ping Pong (PPSA28319) running at 60 s, 3487 frames running at 60 s, 3661 frames

No run has a stop line. The executables are byte-identical and nothing in core/libs reads *.registry.json, so this matches the PR's statement that runtime resolution does not change.

One doc nit: in docs/user/USAGE.md the new paragraph sits between "…every reference lands in exactly one class:" and the class table it introduces. Below the table would read better.

Verdict: confirmed, diagnostic metadata only. On the local catalog, the change marks exactly the STB_WEAK imports of the module registries and changes nothing else.

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6188695011 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6240#issuecomment-6188695011). Originally posted by [screamm](https://github.com/screamm) on 2026-10-15T09:16:17Z. --- **Cross-check on Windows: #6240 head `96f506f87` on `main` `d92a8dad3` (fast-forward, no conflict).** Host: Windows 11 Pro 26220, Ryzen 7 5700X, RTX 4070 (driver 596.21), WinLibs MinGW-w64 GCC 15.2.0 r7, Ninja, Release. - **Build:** full build and `libs` both succeed, with no new warnings. - **Tests:** `ctest --test-dir build/core/relinker --repeat until-fail:3` passes all 127 relinker tests 3/3, 381 of 381 runs. That includes `guest_registry`, `call_registry`, `relinker_conversion`, `weak_imports` and `guest_module_dir(ectories)`. `long_paths` runs and passes on this host. - **Negative control:** the PR's `test_guest_registry.py` against `main`'s relinker fails: ``` AssertionError: ('linux', [{'nid': 'CCCCCCCCCCC', 'library': '', 'targetOffset': '0x2388'}, {'nid': 'CCCCCCCCCCC', 'library': '', 'targetOffset': '0x2390'}]) ``` - **Suite, `ctest -j8 --timeout 120 -E '^agc_driver_|^video_out_flip'`:** 814 tests, and 813 pass, including the 2 skipped. - `hardware_oracle_compare` hit its own 20 s timeout under load. - It passes alone in 11.07 s. It is a `tools/hw-oracle` script that this PR does not touch. - **Checks:** `check_conventions.py` and `git diff --check` are clean. **All 51 local catalog ELFs, relinked with `main`'s and with this PR's relinker.** Each title used its usual flags: - always `--windows --registry unused-filter=0`; - `--trap-sdk-syscall-stubs` for 8 titles and `--windows-fixed-base 0x400000` for 3; - `--module-dir` for PPSA28319 and PPSA99995, and `--executable picker/picker.bin` for PPSA99169. `main`'s relinker is deterministic here: relinking 4 titles a second time gave identical bytes. - **Exit codes:** 50 titles exit 0 with both relinkers. PPSA99995 exits 2 with both, on the same Wine `ntdll.prx` TLS refusal (#6102). Without `--module-dir`, its outputs are identical. - **Identical outputs:** 47 titles give byte-identical output trees. - **4 titles differ, each in one file only**, `app.libc.prx.guest.prx.registry.json`, where two records gain `"weak": true`. Every `app.exe`, `.prx`, `app.registry.json` and `.needed.json` is identical. | Title | `libc.prx` build | Records that gain `"weak": true` | |---|---|---| | PPSA28319 Middle Ages Ping Pong | `83ae42e8...` | `kbw4UHHSYy0` (`__pthread_cxa_finalize`, libkernel.prx), 2 relocations | | PPSA99109 Prospero Explorer | `933e7f29...` | same | | PPSA99110 Prospero Multi Tools | `933e7f29...` | same | | PPSA99920 Prospero Vibrate | `933e7f29...` | same | The 51 titles ship four `libc.prx` builds. I read each module's own dynamic symbol table with a separate parser, not the relinker: - In the two builds above, `kbw4UHHSYy0#A#B` is `STB_WEAK`. - In the other two builds, which 47 titles use, it is `GLOBAL`. - Over all 53 module registries the PR wrote (50 × `libc.prx`, plus PPSA28319's `Il2CppUserAssemblies.prx`, `PS5Util.prx` and `lib_burst_generated.prx`), the 8 records marked weak are exactly the 8 `STB_WEAK` imports. No weak import is unmarked, and no strong one is marked. `tools/import_audit.py` prints the same report for the old and new registries of these four titles. `__pthread_cxa_finalize` is implemented, so `Current stop` is `none` either way. **The four titles that differ, 60 s each with the display on.** Each was run once with each relinker's output and `main`'s libraries: | Title | `main` relinker | this PR | |---|---|---| | Prospero Vibrate (PPSA99920) | running at 60 s, 612 frames | running at 60 s, 629 frames | | Prospero Multi Tools (PPSA99110) | running at 60 s, 530 frames | running at 60 s, 580 frames | | Prospero Explorer (PPSA99109) | running at 60 s, 662 frames | running at 60 s, 612 frames | | Middle Ages Ping Pong (PPSA28319) | running at 60 s, 3487 frames | running at 60 s, 3661 frames | No run has a stop line. The executables are byte-identical and nothing in `core/libs` reads `*.registry.json`, so this matches the PR's statement that runtime resolution does not change. One doc nit: in `docs/user/USAGE.md` the new paragraph sits between "…every reference lands in exactly one class:" and the class table it introduces. Below the table would read better. Verdict: confirmed, diagnostic metadata only. On the local catalog, the change marks exactly the `STB_WEAK` imports of the module registries and changes nothing else. AI-assisted (Claude Code).
ArjenS-LA commented 2026-10-15 11:45:12 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ArjenS-LA on 2026-10-15T11:45:12Z.


Moved the weak-import paragraph below the class table in 00c704697b00e28bf8ed8b84b379cf2e4fb6da19, preserving its wording. On Windows x64, verified that the table immediately follows its introduction, all original lines are preserved, git diff --check passes, and the committed-object conventions check passes. This is a documentation-only follow-up; runtime regression testing is not applicable and the existing behavior-test results remain tied to 96f506f8707ce1cd3cb4beebd56de44227f16990.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6191270153 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6240#issuecomment-6191270153). Originally posted by [ArjenS-LA](https://github.com/ArjenS-LA) on 2026-10-15T11:45:12Z. --- Moved the weak-import paragraph below the class table in `00c704697b00e28bf8ed8b84b379cf2e4fb6da19`, preserving its wording. On Windows x64, verified that the table immediately follows its introduction, all original lines are preserved, `git diff --check` passes, and the committed-object conventions check passes. This is a documentation-only follow-up; runtime regression testing is not applicable and the existing behavior-test results remain tied to `96f506f8707ce1cd3cb4beebd56de44227f16990`.
github-actions[bot] commented 2026-10-15 12:17:19 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-15T12:17:19Z.


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.

Pull request Shared files not compared
PR 2780 core/relinker/relinker/src/guest/GuestModuleBuilder.cpp
PR 3998 docs/user/USAGE.md
PR 4891 docs/user/USAGE.md
PR 5021 docs/user/USAGE.md
PR 5925 docs/user/USAGE.md
PR 6788 docs/user/USAGE.md
PR 6946 docs/user/USAGE.md
PR 6947 docs/user/USAGE.md
PR 6977 core/relinker/relinker/src/guest/GuestModuleBuilder.cpp
PR 7642 docs/user/USAGE.md
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6191844049 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6240#issuecomment-6191844049). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-15T12:17:19Z. --- <!-- pr-overlap --> 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. | Pull request | Shared files not compared | |---|---| | [PR 2780](https://www.github.com/boykopovar/AnyPS5/pull/2780) | `core/relinker/relinker/src/guest/GuestModuleBuilder.cpp` | | [PR 3998](https://www.github.com/boykopovar/AnyPS5/pull/3998) | `docs/user/USAGE.md` | | [PR 4891](https://www.github.com/boykopovar/AnyPS5/pull/4891) | `docs/user/USAGE.md` | | [PR 5021](https://www.github.com/boykopovar/AnyPS5/pull/5021) | `docs/user/USAGE.md` | | [PR 5925](https://www.github.com/boykopovar/AnyPS5/pull/5925) | `docs/user/USAGE.md` | | [PR 6788](https://www.github.com/boykopovar/AnyPS5/pull/6788) | `docs/user/USAGE.md` | | [PR 6946](https://www.github.com/boykopovar/AnyPS5/pull/6946) | `docs/user/USAGE.md` | | [PR 6947](https://www.github.com/boykopovar/AnyPS5/pull/6947) | `docs/user/USAGE.md` | | [PR 6977](https://www.github.com/boykopovar/AnyPS5/pull/6977) | `core/relinker/relinker/src/guest/GuestModuleBuilder.cpp` | | [PR 7642](https://www.github.com/boykopovar/AnyPS5/pull/7642) | `docs/user/USAGE.md` |
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!6240
No description provided.