fix(relinker): match needed module names that differ only in the extension #1830
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1830"
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 tv7 on 2026-10-08T20:45:41Z.
What
Fixes items 1 and 5 of #1794 (traced in this comment).
A title's executable can name a bundled module differently from the file it ships. Dying Light 2 (PPSA02262) needs
EOSSDK-PS5-Shipping.debug_prxand shipsEOSSDK-PS5-Shipping.prxbeside the executable. Needed names were matched by exact filename, so the relinker skipped the module without an error, and start-up stopped withFailed to load module: ...\libs\EOSSDK-PS5-Shipping.debug_prx. Renaming the file is not a workaround. The title later callssceKernelLoadStartModule("/app0//EOSSDK-PS5-Shipping.prx"), anddlopenlooks forapp0/EOSSDK-PS5-Shipping.prx.guest.prx. That load fails withENOENT, so the title's EOS lobby backend fails andCGame::InitializeassertsNet_StartUp failed.GuestModuleBuildernow resolves a needed name that no file has exactly to a module whose name differs only in its.prx,.sprxor.debug_prxextension. This applies both in the module directories and in the search under the input. The output keeps the shipped file name (EOSSDK-PS5-Shipping.prx.guest.prx), so run-time loads by that name find it. The needed name is added as another name of that guest module, so the executable binds to it instead of asking for a host library. An exact filename still wins. Two candidates for one needed name are ambiguous, as for exact names.Tested
Windows 11, MinGW GCC 15.2.0, RTX 3070:
guest_needed_moduleshas new cases. An executable needsneeded.debug_prxwhileneeded.prxis shipped, once inMedia/Modulesand once insce_module/, on both the Linux and the Windows output. The guest output isneeded.prx.guest.prx, the Linux executable'sDT_NEEDEDis that path and no hostneeded.debug_prx, and the Windows output runs and returns 42.needed.prxandneeded.sprxside by side are reported as ambiguous. Without the change the new cases fail; with it they pass.ctest: 479/479 pass.python tools/check_conventions.py --base origin/mainpasses.EOSSDK-PS5-Shipping.prx.guest.prxis produced, and with the title's logging enabled it reports[Lobby.Backend.Eos] > [StartUp] okand[Lobby] > [Initialize] all backends are up.Net_StartUppasses. The title then stops in EOS'sRtcNetworkThread, which is the socket descriptor /fd_setquestion raised in #1794 and is not part of this PR. Other #1794 items were worked around locally for this run.Linux output is covered by the test; I did not run a title 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 Rohan03x on 2026-10-09T15:05:30Z.
Tested on Windows with a second title that hits the same failure as #1794 item 1.
Setup: Windows 11 22621, GCC 15.2.0 UCRT Release, this PR (cb571d30) merged onto main
d70b8998. Title: Palworld (PPSA23126, v01.102.999).Case: the eboot's
DT_NEEDEDhasEOSSDK-PS5-Shipping.debug_prx; the dump ships the module asprx/eossdk-ps5-shipping.prx(noDT_SONAME). The name differs in the extension and in case.Result: with this PR the relinked
app.exeis byte-identical to main's and still listslibs\EOSSDK-PS5-Shipping.debug_prx, so the app stops at start withFailed to load module, error 126.ModuleStem(path.filename().string()) == stemcompareseossdk-ps5-shippingwithEOSSDK-PS5-Shipping, so no alias is recorded. Relinker tests pass 36/36 with the PR.Local variant: folding ASCII case in
ModuleStemwhenwindowsis true (like the existing Windows-only filename fold) removes the slot, and the relinked app then gets past module loading on this host (it stops later on an unrelated missing import). Folding alone madewindows_import_modulesfail withAmbiguous guest dependency name: Party.prx, so an exact name has to win over a folded stem match in the alias loop. With that, 36/36 plus a newFoo-Bar.debug_prx/foo-bar.prxcase. I can share the diff (+26 −7) if useful.Limits: one title; the run only shows that module loading passes, not that the title boots. Dying Light 2 not tested. AI-assisted: yes.
Imported from boykopovar/AnyPS5. Originally posted by tv7 on 2026-10-09T21:29:54Z.
@Rohan03x thanks for the Palworld run and the diagnosis. I took your approach into the PR (
0745d803e, credited in the commit) rather than asking for the diff:ModuleStemfolds ASCII case, soEOSSDK-PS5-Shipping.debug_prxmatcheseossdk-ps5-shipping.prx.findGuestfold handles it), and the alias loop skips names already inguestNames. That is what keepswindows_import_modules(Party.prx) passing.guest_needed_modulesgets a Windows case forFoo-Bar.debug_prxvsprx/foo-bar.prxthat runs the relinked exe. It fails on the previous head withFailed to load module ... Foo-Bar.debug_prx, error 126 (same as your report), and passes now.Also rebased onto current main (no conflicts). Full build + ctest 516/516 on Windows (GCC 15.2 UCRT);
check_conventions.pypasses. If you can rerun Palworld on this head, that would confirm it on a real title.Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-09T22:05:58Z.
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.cppL75-76, L81-84