feat(relinker): relink needed modules outside the module directories #716
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/716"
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 merwie on 2026-10-05T17:53:20Z.
What
Unity titles keep modules the executable needs in
Media/Modules, outsidesce_module,sce_modulesandprx. PPSA12544 (Hollow Knight: Silksong) listsIl2cppUserAssemblies.prxandPS5Util.prxasDT_NEEDED; they were left as host libraries and startup failed withFailed to load module: ...\libs\Il2cppUserAssemblies.prx.DT_NEEDEDname of the executable that is not among the found modules (and not excluded) is searched for under the input directory, skipping the module directories. An ELF file with that name is relinked like the other guest modules; files with other magic are ignored; two ELF candidates areAmbiguous needed module.app0/Media/Modules/Il2cppUserAssemblies.prx.guest.prx) instead of only the last directory component; the LinuxDT_NEEDEDentries and the printed runtime layout use the same relative path. For modules insce_module/sce_modules/prxnothing changes.guest_needed_modules: an executable needingneeded.prxfound inMedia/Modules(with a non-ELF file of the same name elsewhere) relinks for Linux and Windows, the artifact lands inapp0/Media/Modules, the Linux executable needs$ORIGIN/app0/Media/Modules/needed.prx.guest.prx, the Windows executable runs; two candidates fail.Loading such a module through
sceKernelLoadStartModuleat run time is a separate pull request.Tested
Windows 11, WinLibs GCC 15.2.0 r7, Ryzen 7 9800X3D, Radeon RX 9070 XT.
ctest: 289/291 passed, includingguest_needed_modulesand the existing guest module tests.agc_driver_lds_atomics64andagc_driver_vopc_compare_tablefail on this machine onmainas well (Vulkan device tests).Media/Modulesleft in place (no copies insce_module), both modules are relinked toapp0/Media/Modulesand startup loads them.Not tested on Linux.
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)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by 011010 on 2026-10-06T15:33:29Z.
Independent verification, since the branch is relinker-only and builds anywhere.
Built the relinker standalone from
pr716on macOS 26.6.2 (arm64), Apple Clang 21, C++20, and ran the Python integration tests against that binary:test_guest_needed_modules.pypasses.To confirm the test exercises the new behaviour rather than passing vacuously, I ran the same test against
main(5895ea7): it fails withi.e. on
mainthe module outside the module directories is not relinked, which is exactly what this PR fixes. So the branch does what the description claims, and the test is meaningful.One note: the branch tree is based on an older
mainand carries 18 of the current 20 Python tests; a rebase would bring it current. GitHub reports it mergeable. I did not test a real Unity title (no dump here).Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-07T15:51:44Z.
Checked on Linux: build + full ctest green with this merged onto current main (398/398),
guest_needed_modulesfails with the relinker changes reverted, and on a real dump (Astro's Playroom) nothing outsidesce_moduleis picked up. Merging.Minor follow-up if you touch this again: the
DT_NEEDEDread loop inGuestModuleBuilder.cppnow exists twice in the same function (the new one and theaddHostone); one shared helper would keep the validation in one place.