Skip to content

fix(relinker): load a libSceSsl2 dependency as libSceSsl - #26765

Open
nikmparis217-ux wants to merge 1 commit into
boykopovar:mainfrom
nikmparis217-ux:fix/relinker-libscessl2-alias
Open

nikmparis217-ux wants to merge 1 commit into
boykopovar:mainfrom
nikmparis217-ux:fix/relinker-libscessl2-alias

Conversation

@nikmparis217-ux

Copy link
Copy Markdown
Contributor

What

The PS4 version of Gran Turismo 7 (CUSA24767 01.71) needs libSceSsl2.prx and imports 13 sceSsl* functions from module libSceSsl. AnyPS5 has no libSceSsl2 library, so on main the needed library has no file and the 13 imports have no provider: tools/import_audit.py counts all 13 as absent.

On the console the two modules use the same names. In PS4 firmware 13.52, libSceSsl2.sprx names both its module and its export library libSceSsl and exports 57 symbols, among them all 13 that this title imports. That firmware's libSceSsl.sprx has the same names and 208 symbols. AnyPS5's libSceSsl exports all 13.

A libSceSsl2 dependency, with any module suffix, is now loaded as libSceSsl.prx, and imports from module libSceSsl match a libSceSsl2 dependency. This works like the existing libSceGnmDriver_padebug alias in NeededLibraryName and ImportModule. tools/import_audit.py applies the same alias. The debt entry records that the names come from the dynamic tables of the two modules, not from running them, and that no PS5 module of that name was read.

Tested

Windows 11, WinLibs GCC 16.2.0, Release, relinker-only build (ANYPS5_RELINKER_ONLY=ON, BUILD_TESTING=ON) on main 31088e9.

  • New cases: ImportModuleTests.cpp (NeededLibraryName of libSceSsl2.prx and libSceSsl2.sprx; ImportModule with libSceSsl2.prx alone and next to libSceSsl.prx), test_linux_named_imports.py (the converted image needs libSceSsl.prx), test_windows_import_modules.py (the libSceGnmDriver_padebug case also runs for libSceSsl2.prx and libSceSsl2.sprx) and tools/tests/test_import_audit.py (--strict-providers finds libSceSsl.prx for a libSceSsl2 dependency, from a PE and from an ELF provider). With main's ImportModule.hpp and import_audit.py these four tests (import_module, windows_import_modules, linux_named_imports, import_audit) fail. With the change they pass.
  • Full relinker-only ctest -j 8: 1,135 of 1,142 pass. The 5 select_tests (select_tests and four select_tests_* classes) fail on this machine with FileExistsError while tools/tests/test_select_tests.py makes its temporary link folder, as they did without this change. test_registration and configure_seed_round_trips reached the 120 s limit in the parallel run and pass when run alone (23 s and 17 s).
  • tools/import_audit.py on the import registries of CUSA24767 01.71 eboot.bin and its modules (my own dump), against libraries built from main ef7dc44 with local changes that do not touch libSceSsl: with main's audit 13 imports are absent (all from libSceSsl.prx, under the needed library libSceSsl2.prx); with this branch none.
  • Eight OpenOrbis homebrew programs of my own, converted for Linux, Windows and macOS with main and with this branch: all 24 outputs are byte-identical (gpu_reader stops the same way with both, on a syscall in its own code).
  • tools/check_conventions.py --base origin/main passes.
  • Open PRs 25281, 22252 and 16538 change tools/import_audit.py (25281 also tools/tests/test_import_audit.py); a three-way merge of those files with this branch is clean. Open PRs 13486 and 13472 change ImportModule.hpp (13472 also ImportModuleTests.cpp) and already have one conflict with main in each of those files; with this branch they have the same number of conflicts, which then also hold the new libSceSsl lines. tools/pr_overlap.py was not run, as gh is not signed in on this machine.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt and the licence notice of code adapted from upstream (see AGENTS.md)
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: CUSA24767 (no Game bring-up discussion yet)
  • GPUs tested: n/a
  • AI-assisted: yes (Claude Code)

@github-actions github-actions Bot added relinker docs unblocks title Names a title ID on the Unblocks line labels Nov 24, 2026

@catminou4 catminou4 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed locally (Ubuntu 22.04, GCC 11.4, relinker-only build -DANYPS5_RELINKER_ONLY=ON -DBUILD_TESTING=ON).

  • ctest -R '^(import_audit|import_module|linux_named_imports|windows_named_imports|linux_guest_named_imports|windows_import_modules)$': 6/6 pass on the PR head.

  • Control: restored core/relinker/domain/include/domain/ImportModule.hpp and tools/import_audit.py from origin/main, rebuilt: import_module, import_audit, linux_named_imports and windows_import_modules all fail (new checks 95-98, test_ssl2_dependency_uses_libscessl, the ssl2 case and the libSceSsl2.* alias cases). Restoring the PR sources makes them pass again, so the tests isolate the alias.

  • The alias follows the existing libSceGnmDriver_padebug pattern in all three places (NeededLibraryName, the ImportModule lookup, import_audit); check 98 confirms an exact libSceSsl.prx dependency still wins over the alias when both are present.

  • I could not check the 13.52 module tables myself; the debt fragment states that the equivalence is read from dynamic tables, not run, which is the right caveat.

  • tools/pr_overlap.py --branch pr-26765: no confirmed overlap; it fails closed on 6 old PRs (#13472, #13473, #13475, #13477, #13482, #13486) that touch ImportModule.hpp and ImportModuleTests.cpp but no longer merge cleanly with main, so they could not be compared.

Verdict: mergeable.

@github-actions

Copy link
Copy Markdown

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.

Pull request Shared files not compared
PR 13472 core/relinker/domain/include/domain/ImportModule.hpp
core/relinker/relinker/tests/ImportModuleTests.cpp
PR 13473 core/relinker/domain/include/domain/ImportModule.hpp
core/relinker/relinker/tests/ImportModuleTests.cpp
PR 13475 core/relinker/domain/include/domain/ImportModule.hpp
core/relinker/relinker/tests/ImportModuleTests.cpp
PR 13477 core/relinker/domain/include/domain/ImportModule.hpp
core/relinker/relinker/tests/ImportModuleTests.cpp
PR 13482 core/relinker/domain/include/domain/ImportModule.hpp
core/relinker/relinker/tests/ImportModuleTests.cpp
PR 13486 core/relinker/domain/include/domain/ImportModule.hpp
core/relinker/relinker/tests/ImportModuleTests.cpp

@nikmparis217-ux
nikmparis217-ux force-pushed the fix/relinker-libscessl2-alias branch from c3fed27 to 6449754 Compare November 25, 2026 05:17

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed — looks good

The reviewed change consistently maps libSceSsl2 dependencies to libSceSsl and includes targeted regression cases; no blocking defect was found in the code read.

What I ran

No build or tests were run in this review. I read the prepared diff and all seven changed files included in the review bundle at head 64497547d6808bf35f6b46044ee8fc5c015aeae2.

Results

Check Result Note
Changed code review passed All changed files read
Build and tests not run Results in the description are author-reported

Findings

Blocking

None.

Non-blocking

None.

Not verified

No tests were run independently. Hardware and console behavior were not verified. The author-reported test results and firmware dynamic-table inspection were not independently confirmed.

To get this to a good state

Nothing is required.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs relinker unblocks title Names a title ID on the Unblocks line

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants