feat(relinker): emit per-NID call hook table #17557
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/17557"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-08T22:09:11Z.
What
The relinker writes a per-NID hook table next to its registry:
<stem>.hooks.json, with one row per NID and library, the hook index, the import offsets and the merged call sites of that NID. A row is marked resolved only when all of its imports resolved. Written for executables and for modules; overwrite checks and the dry-run plan are updated.Nothing reads the file yet: no loader installs a wrapper per NID and no title calls through the table. The loader step is a follow-up and is recorded in the relinker debt file.
Stacked on the PR 3 branch (
feat/debug-command-channel); this branch contains its commits. One docs commit was cherry-picked from it, with the same patch content.Tested
Linux, Debian kernel 6.1.0-54-amd64, Intel Xeon E5-1620 v2. Host archive build, focused tests only, no game and no PS5 hardware.
Command:
Output:
The per-file SYNTAX stage reports one missing generated header (
RelinkerRevision.hpp); BUILD-EXIT is 0.Overlap: pr_overlap fails closed on shared files (libc build list, the libc debt file, the environment reference). Across the 109 open PRs it flags for this series, none adds a line using the debugger or hook-table identifiers (DebugNid, NidStop, NidBreakpoint, ANYPS5_DEBUG, command parsing, WriteHookTable, hooks.json, debug_nids, breakpoint). No open PR implements the same functions.
Not verified:
ANYPS5_RELINKER_ONLY=ON: the runner configures the full tree, so the relinker-only build was not run through it.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Summary by CodeRabbit
--registryoption now produces a hook-table JSON file alongside registry and dependency reports for executables and converted modules.Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-11-30T01:27:44Z.
Review: COMMENTED
Actionable comments posted: 4
Architecture findings (2)
Advisory architecture findings (2)
5d0fcb87-2b2d-4d55-9285-779d8711a612Reviewing files that changed from the base of the PR and between
9415030dfeand7ef1382ead.core/libs/prx/libc/CMakeLists.txtcore/libs/prx/libc/include/DebugNidBreakpoints.hppcore/libs/prx/libc/include/DebugNidCommands.hppcore/libs/prx/libc/include/DebugNidStops.hppcore/libs/prx/libc/src/DebugNidBreakpoints.cppcore/libs/prx/libc/src/DebugNidCommands.cppcore/libs/prx/libc/src/DebugNidStops.cppcore/libs/tests/GuestDebugNidBreakpoints.cppcore/libs/tests/GuestDebugNidCommands.cppcore/libs/tests/GuestDebugNidStops.cppcore/relinker/CMakeLists.txtcore/relinker/cli/src/CliArgs.cppcore/relinker/main.cppcore/relinker/relinker/include/relinker/domain/ICallRegistryWriter.hppcore/relinker/relinker/include/relinker/output/CallRegistryWriter.hppcore/relinker/relinker/src/output/CallRegistryWriter.cppcore/relinker/relinker/tests/CallRegistryWriterTests.cppcore/relinker/relinker/tests/test_dry_run.pycore/relinker/relinker/tests/test_hook_table.pycore/relinker/relinker/tests/test_output_collisions.pycore/relinker/relinker/tests/test_secondary_output_collisions.pydocs/dev/ENVIRONMENT.mddocs/dev/debt/libc.mddocs/dev/debt/relinker.mddocs/user/USAGE.mdIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T11:58:09Z.
Review: COMMENTED
Built this head with
ANYPS5_RELINKER_ONLY=ONand ran thehook_tableCTest on Linux. It passed the generated table checks. The guest debugger fixtures are outside this run.AI-assisted: yes.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.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.