Repository navigation
feat(relinker): write a registry for each converted bundled module - #1462
Merged
Merged
Conversation
This was referenced Oct 8, 2026
9 tasks done
9 tasks done
9 tasks done
9 tasks done
adriadam10
force-pushed
the
feat/module-registry
branch
from
October 8, 2026 14:31
8e5055c to
20e15db
Compare
Collaborator
|
Rebased onto current |
|
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.
|
9 tasks done
This was referenced Oct 8, 2026
9 tasks done
--registry only described the imports of the executable, so a title whose own modules import system functions (PSN.prx, libc.prx and others) could not be audited completely. With --registry the relinker now also writes <output-stem>.<module>.registry.json for every converted guest module. An entry is written for each relocation against an undefined symbol that no other bundled module exports, the same test the module builder uses to decide that a dependency is satisfied by a sibling. Entries carry nid, library and targetOffset; the symbol name no longer has the # suffix by the time the module is read, so the NID is the bare 11 characters. The executable's registry is unchanged. The test converts two modules where one is provided by its sibling, for Linux and Windows output, covers the DT_RELA and DT_JMPREL tables, checks that the same module imports the sibling's function once the sibling is absent, and that nothing is written without --registry. Registered in CTest as guest_registry.
adriadam10
force-pushed
the
feat/module-registry
branch
from
October 9, 2026 20:44
20e15db to
bd750b5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 fix(relinker): resolve internal libc imports from guest libc #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)