Repository navigation
fix(relinker): start on Windows without a missing library nothing imports from - #3129
Conversation
…orts from The Windows startup stub stopped at the first DT_NEEDED library it could not load, even when no import is searched in that library. Titles list libraries they import nothing from (Road of Death needs libSceXml.prx, Resident Evil 4 needs Party.prx), so they stopped with GetLastError 126 before running. A host library that no import's search list contains is now skipped with a message when it is not found; its handle stays null and is never read. Missing libraries that something imports from, other load errors and guest modules still stop the start.
…clare An import whose module matches no needed library has no library name, and the Windows startup stub counted it against every library, so a missing library with nothing imported from it was still never skipped. Every such import in the executables of Record of Lodoss War, Resident Evil 4, PRAGMATA and Returnal declares a module that exists under another file name (libSceJson for libSceJson2.prx, for example), and none declares libSceXml or Party. The relinker now keeps the declared module names of those imports, for the executable and each guest module, and the stub counts a host library as imported from when its name up to the first dot matches one of them, ignoring case. A module declared as libGuest still keeps a missing libGuest.xyz required, as guest_module_identity checks. Imports without a module ID declare nothing and count against no library. The rule and the title data are from xXPBSXx.
Dextroid17
left a comment
There was a problem hiding this comment.
The distinction this draws is the whole change, and it is drawn correctly: a library that nothing imports from is skipped with a message, while a missing library something does import from, any other load error, and guest modules all still stop the start. Widening the skip as far as the symptom would have turned a hard failure into a silent one, and the second half — imports whose module matches no needed library keeping their declared name, so each counts only against the library it declares — is what stops that from becoming a loophole.
The titles are named, which is the bar this tree asks for, and the two cases read differently for a reason: libSceXml.prx and Party.prx are carried dependencies the title never calls into, which is exactly the shape the fix is for.
One thing checked, because it is the failure mode of this change. The skipped-library line is emitted unconditionally — only the path echo beside it sits behind --windows-diagnostics — so a plain --windows run says which library was skipped and why. That is the right default: the alternative is a start that succeeds while a library quietly did not load, with nothing on screen to say so.
And closing the issue it fixes, with the Party.prx case named, is the right way to write the description — a reader can check both titles against their own copies.
Written with AI assistance.
|
Please leave the needed libraries nothing imports from out of the start-up load list, instead of continuing after |
… start-up load list Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Done in the latest commit: the start-up stub no longer loads needed libraries that no import is searched in, so there is no 🤖 Addressed by Claude Code |
|
Windows run of the current head (
Two small things from reading the latest commit:
|
|
A library that an import is still searched in has to stay in the load list. At 7755e1d it doesn't when the import has no matching library: An executable needing Please fix that and add the case to |
|
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.
|
|
Checked the diff, relinker build and ctest (94/94) on current main, and the Windows relinker job ( |
|
FYI for the authors of this change (@Silverash-i8, @CnRJay): the last commit here ( AI-assisted (Claude Code). |
Will investigate. Thanks |
PPSA19546 (Cookie Clicker) and PPSA34959 (The King is Watching) list libSceXml.prx among their needed libraries but import nothing from it. AnyPS5 builds no such library, so on Linux the dynamic loader stops both before they run: ./eboot.elf: error while loading shared libraries: libSceXml.prx: cannot open shared object file: No such file or directory On Windows the start-up stub has skipped a missing library that nothing imports from since #3129; the Linux loader resolves DT_NEEDED itself and cannot skip one. libSceXml now exists with no exports, like libSceAgcVsh and libSceAudio, so it loads on both. A title that imports from it still stops at the missing import. Both titles now load and stop at their next missing import: setSpecialFloatFormatType (PPSA19546, #3575) and sceHttpsFreeCaList (PPSA34959, #3497).
What
The Windows start-up stub stops with error 126 at the first needed library it cannot load, even when the title imports nothing from it. Road of Death and Record of Lodoss War list
libSceXml.prx; Resident Evil 4 listsParty.prx. A host library that no import is searched in is now skipped with a message when it is not found. A missing library something imports from, other load errors and guest modules still stop the start.Imports whose module matches no needed library keep their declared module name, so they count only against the library they declare. A module declared as
libGueststill keeps a missinglibGuest.xyzrequired.Closes #2591. Fixes the
Party.prxstop in #2776 (the title then stops atsetSpecialFloatFormatType, tracked there).Carried from Silverash-i8's fork branch
fix/windows-start-without-unused-library(two commits, original authorship kept); the unnamed-import rule is from xXPBSXx.Tested
Windows 11, MinGW-w64 GCC, relinker-only build (
ANYPS5_RELINKER_ONLY=ON):ctest99/99, includingwindows_import_modulesandguest_module_identity.tools/check_conventions.py --base upstream/mainpasses. Not run on a title by me; xXPBSXx reported on #2591 that Record of Lodoss War (PPSA05347) and Resident Evil 4 (PPSA07411) pass the missing-library stop with these commits (...\libs\libSceXml.prx -> not found; nothing is imported from it, continuing without it), and that PRAGMATA and Returnal are unchanged.Checklist
main; no other open PR implements the same functions.mdfiles or images added to the repository🤖 Generated with Claude Code