Windows: since #3129 a library an unmatched import is searched in is not loaded (Middle Ages Ping Pong PPSA28319 stops on sceAppContentAddcontMount); fix branch ready #3369
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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 DavidSamir on 2026-10-11T09:15:43Z.
Since #3129 (merge
bbb941964), a Windows executable no longer loads a host library that one of its imports is still searched in, when that import matched no library by module name. The import is then reported as unresolved although the library that exports it is inlibs. This is the case @oneandonlydean described in review before the merge; it is onmainnow.Title. Middle Ages Ping Pong (PPSA28319, Unity, MIT, from the homebrew catalog) stops at start-up on
mainfd50c632a:VANhIWcqYakissceAppContentAddcontMount. The list has 36 entries andlibSceAppContent.prxis not among them, although it is inlibsand exports the function. With the relinker ofmain0e90079f(before #3129) the same title started, loaded its Unity level and stopped later atmultisampling or coverage conversion is unsupported.Cause. The executable needs
libSceAppContent.prx, but its import module for that library is namedlibSceAppContentUtil:Its eight
...#X#Ximports (sceAppContentInitialize,sceAppContentAddcontMount,sceAppContentAddcontUnmount,sceAppContentAppParamGetInt,sceAppContentTemporaryDataMount2,sceAppContentTemporaryDataFormat,sceAppContentTemporaryDataGetAvailableSpaceKb,sceAppContentDownloadDataGetAvailableSpaceKb) therefore match no needed library, get an emptyLibrary, and are searched in every library, as before.WindowsEntryStubBuilder.cppkeeps a host library on the load list only when an import with a matched library is searched in it, or when its name equals an unmatched module name up to the first dot.libSceAppContentis notlibSceAppContentUtil, so the library is left out, together withlibSceAudio3d.prxandlibSceRazorCpu.prx.The same happens without any guest module: an executable that needs host
a.prxand importsshared, orshared#A#Bwith modulelibSceJson, exits 11 before #3129 and stops with an empty "Searched libraries" list onmain. #3356 reports the same stop for Road of Death (PPSA07286,libSceJson2.prxnot in the searched libraries), and the closed #3344 for Pinball FX (PPSA08755, modulelibSceJson, librarylibSceJson2.prx). I don't have either title; in the fixture, modulelibSceJsonwith a library of another name is one of the new cases.Fix, ready to cherry-pick.
DavidSamir:fix/relinker-windows-load-searched-libraries(a0e026b99, one commit onmainfd50c632a, eight files, +45/-9). I can't open it as a PR because of the intake check.The load list is still decided when relinking; nothing is retried or skipped at run time, and a library on the list that cannot be loaded still stops the start with error 126.
missing-unused-dependencycases of #3129), or when the unmatched module names a needed library up to the first dot (libSceAjmandlibSceAjm.native.prx).skippedModuleis removed; it has been unused since7755e1d05.Limit: when the rule keeps every library, a needed library that is missing and unused stops the start again, as it did before #3129. A title that has both an import like the ones above and such a library would need the import matched to its library by another key (the executable's import library name is
libSceAppContent, which the relinker does not read); that is not part of this change. I could not check Record of Lodoss War, Road of Death or Resident Evil 4, the titles #3129 was written for.windows_import_modulesgains nine cases whose provider is a host library inlibswith no guest module: a matched import,shared,shared#A#Bwith modulelibSceJson, the provider as second needed library behindlibFooUtil.prx, modulelibFooUtilfor neededlibFoo.prx(the shape of the title), a matched import with a missing unused library, moduleafora.native.prxwith a missing unused library (still skipped), and the two unmatched imports with a missing unused library (stop withFailed to load module: ...unused.prx).Checked on Windows (a0e026b99 on
mainfd50c632a, Windows 11 10.0.26300, WinLibs GCC 15.2.0 r7, Release):mainand the new cases kept,windows_import_modulesfails at thesharedcase with the empty "Searched libraries" output above. Run one by one against the relinker ofmain05c870cc0, six of the nine cases fail (the three with a matched import or module pass). With the fixwindows_import_modulesandguest_module_identitypass 5/5 (--repeat until-fail:5).mainfd50c632aand with the branch, same libraries (built frommaina258e5e3e):mainstops after 3 s with the output above; the branch starts, opens its Unity data files and stops after 7 s withread-write alias of shared guest memory 0x2144c0000+0x1040000: the range is not one contiguous run of views of a section. I have not looked into that later stop. With--windows-diagnostics(measured on the previous base,a4b0b16bb) the branch prints 39Loading PRXlines against 36:libSceAppContent.prx,libSceAudio3d.prxandlibSceRazorCpu.prxare added.--windows-diagnosticsby the relinker ofmaina4b0b16bband by the branch on that base (the same change before the rebase) and run for 5 s: 41 print the sameLoading PRXlist and the same first stop. For PSBox Cloud Gaming (PPSA99810) the executable frommainprinted onelibSceAgc.prx -> FAILEDin that batch; three reruns of both executables gave the same 19 libraries and the same stop. I did not find out why that one load failed.ANYPS5_RELINKER_ONLY=ON):ctest105/105.check_conventions.py --base origin/mainpasses;pr_overlap.py --branchreports no overlap with open pull requests.main05c870cc0),ctest --parallel 4, 801 tests: seven GPU tests fail on this machine (RTX 3070, driver 610.60):agc_driver_bda_device,agc_driver_f32_compare_constantandagc_driver_flat_apertures_0,_2,_3,_4,_5. Their executables are built only from sources outsidecore/relinker, which is all this branch changes; I did not rerun them on a build of plainmain.Checked on Linux (same commit, WSL2 Ubuntu 24.04, GCC 13.3.0, Release, relinker-only build):
ctest110/110. The new cases relink there; they only run on Windows.Not checked on a console, on macOS, or with a commercial title.
AI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by DavidSamir on 2026-10-11T09:16:04Z.
#3365 was opened on the same stop while I was writing this up, so the two overlap in
WindowsEntryStubBuilder.cppandtest_windows_import_modules.py. Its Planet Coaster import,99b82IKXpH4, issceAppContentAppParamGetInt, one of the eightlibSceAppContentUtilimports listed above.The difference between the two, for whoever reviews:
If #3365 is the one that goes in, the nine host-library cases in this branch's
windows_import_moduleschange still apply to it, except the last two, which expectFailed to load module: ...unused.prx.AI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by orishamir on 2026-10-11T12:49:12Z.
@DavidSamir, on
mainthis is fixed by #3365 (merged 09:40Z). Middle Ages Ping Pong (catalog zip, sha256 checked) on Windows 11 + RTX 4080,main8b679d8d, relinked with--windows --windows-diagnostics --registry --module-dir Media/Modules --module-dir Media/Plugins:main: loadslibSceAppContent.prx, opens its Unity data (level0,sharedassets0.*,resources.assets) and stops after 15 s withpresentation failed: multisampling or coverage conversion is unsupported (register 0x2f8 = 0x00108001), the later stop of your pre-#3129 run.mainwith onlyWindowsEntryStubBuilder.cppreverted to before #3365:FAIL: unresolved ELF import VANhIWcqYakafter 3 s,libSceAppContent.prxnot among the searched libraries, as in your report.@xXPBSXx's #3367 is the same import and the same unnamed-module shape; a Hotline Miami run on
mainwould confirm it there (I can't run that one). Without the two--module-diroptions the title stops earlier atFailed to load module ...Il2cppUserAssemblies.prx(126), the stop recorded for it under #2942; that one is a relink step, not a blocker.AI-assisted: yes (Claude Code Opus 5.5 xhigh)
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-11T21:16:43Z.
Fixed by #3365, as the run on main
8b679d8dabove shows.