feat(relinker): report every unresolved ELF import before failing on Windows #5406
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/5406"
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 tibzejoker on 2026-10-13T19:03:27Z.
What
On Windows, a converted title that imports functions no library provides used to stop at the first one. Each run printed a single line:
Listing every missing function took one run per function: implement or declare it, convert again, and see the next one.
The startup stub now goes through all imports before failing:
FAIL: unresolved ELF import ...line. The stub then counts it and moves on to the next import, without writing that import's slot.STATUS_ENTRYPOINT_NOT_FOUND(0xc0000139), as before.Each line keeps its exact format, so tools and issue reports that match
FAIL: unresolved ELF importstill work.Unchanged:
--lazy-binding, which still defers each unresolved import to a stub that fails when it is called;The only extra cost is a counter increment per unresolved import and one test after the import loop.
Tested
Windows 11, MinGW-w64 GCC 15.2.0 (WinLibs r7), Release, on
main18c438b10.windows_import_modules: the test fixture can now carry several imports. A new case converts an executable that imports froma.prx:absent(not exported);shared(exported);missing(not exported).The test runs the converted executable and checks three things:
FAIL: unresolved ELF import absent from a.prxandFAIL: unresolved ELF import missing from a.prx, in that order;On
mainit fails: only theabsentline is printed. With the change it passes.All relinker tests that run on Windows (90 of the 100 in
core/relinker/CMakeLists.txt) pass, including the existing single-import failures (missing-symbol,wrong-provider,missing-symbol-gui),weak_imports, and the tests that convert with--lazy-binding(windows_fixed_base,windows_trace_imports).tools/check_conventions.py --base upstream/mainpasses.Not tested with a game.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
https://claude.ai/code/session_01V1W4jdNSKTV7xwuS6xQPJV
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-14T11:41:16Z.
Checked the stub change (counter after each unresolved import, single failure after the import loop; weak and
--lazy-bindingpaths untouched) and the newmissing-symbolscase, which fails onmainas described.mainmovedexecutable()intoguest_import_fixtures.py, so I rebased and moved theextra_symbolsextension there; relinker build and tests are green on Linux (128/128 in scope), and the Windows build will run before merging.Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-14T11:44:21Z.
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/elfpatcher/src/windows/WindowsEntryStubBuilder.cppL594core/relinker/relinker/tests/test_windows_import_modules.pyL395