fix(relinker): skip backup copies of modules without a SONAME #20281
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/20281"
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 RiverWhy on 2026-11-14T23:34:56Z.
What
The relinker skips a dumper's backup copy (
libX.prx.esbak,libX.prxbak) only when it and the module whose name it extends have the same non-empty SONAME. Modules without aDT_SONAMEnever matched, so their backups were converted as extra modules. On Stray (PPSA02100) the backups oflibc,libSceFaceandlibSceFaceTrackerwere skipped, but those oflibSceJobManager,libScePfsandlibSceNpCppWebApi, which have no SONAME, became*.prx.esbak.guest.prxfiles and were audited a second time bytools/audit_dump.py.RemoveBackupCopies: when either file has a SONAME, the rule is unchanged. When neither has one, the copy is a backup when both export the same, non-empty list of module names (0x6100000d/0x61000043, already read asGuestImage::ModuleNames). Two modules without a SONAME or module names are never matched.BackupCopy {Copy, Kept, Match}, and both callers (CLINativeModules.cpp,Conversion.cpp) print(same SONAME as ...)or(same module names as ...).docs/user/USAGE.mddescribes the fallback.relinker_conversion_tests: the fixture can declare a module name; new cases cover a backup without a SONAME (skipped, Windows and Linux targets), one with other module names and one with none (both kept).Tested
Linux Mint 22.3:
relinker_conversion_testspasses; without the change it fails with "A backup copy without a SONAME was converted".ctest --test-dir build/core/relinker: 258 tests passed.sce_module/as dumped: before, 9 converted modules including 3 backups; after, all 6 backups skipped (3 by SONAME, 3 by module names) and the 6 modules converted.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)Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-15T00:28:21Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
054e14f3da:tools/check_conventions.pypassed;git diff --checkclean.relinker_conversion_testsbuilt cleanly.relinker_conversion):core/relinker/cli/src/NativeModules.cpp,core/relinker/relinker/include/relinker/guest/GuestImage.hpp,core/relinker/relinker/src/guest/GuestModuleBuilder.cpp,core/relinker/relinker/src/pipeline/Conversion.cppreverted tomainand the new tests kept, the suite fails: Restoring the change makes it pass again.Generated withfooter from the description; the AI-assisted checkbox can stay.Looks Good To Me