Repository navigation
fix(relinker): skip a dumper's backup copy of a module beside the module - #7380
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
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.
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
|
Independent boundary check of exact head The stock
Creation order is permuted wherever there is more than one file. Every original executable/module hash remains unchanged through all controls. To check that these assertions discriminate the guards, I rebuilt only the changed CLI source against the otherwise identical tree:
The isolated source was restored afterward and is clean. These are Linux-host conversion/output checks, including PE generation, not Windows-host execution, actual title relinks, or the web converter path. |
What
Some dumpers leave decrypted ELF copies next to each module, for example
libX.prx.esbakandlibX.prxbakbeside an ELFlibX.prx.ReadModulestakes every ELF file in a module directory, so each copy is converted as another module with the same SONAME, and the conversion stops inGuestModuleBuilder:Reports:
.prx,.prx.esbak,.prxbak); 29 files had to be moved out before the conversion ran.libc.prxconverts as an ELF module andlibc.prx.esbakbeside it stops the conversion the same way.After reading the modules,
ReadModulesnow skips a module as a backup copy when both of these hold:It prints which file it kept:
On
main, two modules with the same SONAME always stop the conversion with the error above, so this only changes layouts that fail today. Other cases are unchanged:libfoo.so.1andlibfoo.so.10, have different SONAMEs and are both converted..esbakbeside a SELF.prx(Demon's Souls Demon's Souls PPSA01342 v1.04 undefined symbol: GtuZGmN-tKw #1946/Demons Souls v1.04 PPSA01342 Segfault upon running linked elf #1973, the web converter's test from a227719) is still the module that gets relinked.Not covered:
demo/web/archive.mjs,core/relinker/wasm/Bindings.cpp) passes its modules toGuestModuleBuilderwithoutReadModules, so it still stops on these layouts. Its test needs the wasm build, which I can't run here; it can follow in its own PR.libX.prxwith two ELF backups,libX.prx.esbakandlibX.prxbak, still stops: neither backup's name extends the other's. No report shows that layout.Overlap: #6231 rewrites the same line of
docs/user/USAGE.md(the module directory rules), so whichever of the two lands second has to merge the sentences.Tested
Windows 11 26200, WinLibs GCC 15.2.0 r7, Release,
BUILD_TESTING=ON:guest_module_directorieshas three new cases, each run for the Linux and Windows targets:libSceFace.prx,libSceFace.prx.esbakandlibSceFace.prxbak, all ELF with SONAMElibSceFace.prx: one output,libSceFace.prx.guest.prx, and one skip line for each copy. Onmainthis case exits 2 withFAIL: Ambiguous guest dependency name: libSceFace.prx.libfoo.so.1andlibfoo.so.10, each with its own SONAME: both convert and nothing is skipped, as onmain.libSceFace.prxwith an ELFlibSceFace.prx.esbak:libSceFace.prx.esbak.guest.prx, no skip line, as onmain.guest_module_directories,guest_module_dir,guest_module_identity,guest_needed_modules,guest_needed_nested_modules,input_preservation,windows_import_modules,relinker_executablesand the rest) pass.ctest --parallel 4 --timeout 120onmain1e2d9b369with this change: 1462 tests. The only failures are three AMD GPU tests that also fail without it on this machine:agc_driver_lds_mixed_width_atomics(fix(shader): release the LDS lock with an exchange and drop fences inside it #6976),agc_driver_lds_lock_budget(AGC: AMD device-backed LDS lock-budget case returns half of expected sum #7344) andagc_driver_layered_volume_vertex_no_gpl(AMD Windows: identical AGC executables invert GPL pass/fail results after relocation #4768).relinkerjob ran the same tests on ubuntu-latest (g++), macos-latest (clang++, arm64 and x86_64), windows-latest (g++) and with ASan, and passed.python tools/check_conventions.py --base origin/mainwith this title and body passes.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