feat(relinker): write a registry for each converted bundled module #1462
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1462"
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 abderahmane-ai on 2026-10-08T08:02:49Z.
What
relinker --registryonly described the imports of the executable, so a title whose own modules import system functions (PSN.prx,libc.prxand others) could not be audited completely. With--registrythe relinker now also writes<output-stem>.<module>.registry.jsonfor every converted bundled module.An entry is written for each relocation, in
DT_RELAandDT_JMPREL, against an undefined symbol that no other bundled module exports. That is the testGuestModuleBuilderalready uses to decide that a dependency is satisfied by a sibling. Entries carrynid,libraryandtargetOffset; the symbol has lost its#suffix by the time the module is read, so the NID is the bare 11 characters. The executable's registry is unchanged. The import audit from #1461 accepts these files as they are, and its docs are updated for them.The first commit of this branch is #1461; the second is this change.
Tested
core/relinker/relinker/tests/test_guest_registry.py(registered in CTest asguest_registry), for Linux and Windows output: two modules where one is provided by its sibling, both relocation tables, the same module importing the sibling's function once the sibling is removed, and no registry file without--registry.DT_JMPRELignored, wrong target offset); the test caught all three.python3 tools/check_conventions.py --base origin/mainpasses. A trial merge with #1454, the other open relinker PR, is clean.The code, tests and docs were written with AI assistance. I read every line and ran the checks above.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-08T14:31:12Z.
Rebased onto current
main: #1461 landed, so its commit dropped out and one commit remains. Checked on Linux: build + full ctest green (464/464);guest_registryfails with the non-test changes reverted; the diff matches the description (relocations inDT_RELAandDT_JMPRELagainst symbols no other bundled module exports; executable registry unchanged); module registries are accepted bytools/import_audit.pyas is. Merging once CI is green on the rebased head.Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-08T14:32:35Z.
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
main)core/relinker/relinker/src/guest/GuestModuleBuilder.cppL184-185core/relinker/CMakeLists.txtL230