refactor(relinker): remove functions nothing calls #6325

Merged
amirerfantim merged 1 commit from upstream-pr/6325 into main 2026-10-18 23:17:31 +00:00
amirerfantim commented 2026-10-15 11:47:41 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by amirerfantim on 2026-10-15T11:47:41Z.


What

Removes relinker functions that nothing in the repository calls:

  • GuestImageReader::ReadModuleNames: its only caller was removed in 41126bfa5.
  • EmitShiftImm and ElfReader::ReadSection (and its IElfReader declaration). ElfReader::GetFileSize has no caller on main either, but #6314 adds one, so it stays.
  • ValidationPolicy::ValidateNidBelongsToLibrary, ValidateSceStructureSize, ValidateDynamicFieldInterpretable and ValidateNoSyscallInstructions (and their IValidationPolicy declarations).
  • ValidationPolicy::ValidateSyscallAbsence, which is empty, and its call.
  • ValidationPolicy::RegisterLibraryImport and _importedLibraries: the set is read only by ValidateNidBelongsToLibrary. ValidateRelocationTypeSupported already fills the supported relocation types when the set is empty, so it behaves the same without the registration.

No behaviour changes. 11 files, 175 lines removed, none added.

Tested

macOS 27.0 (Apple Silicon), Apple clang 21.0.0, Release relinker-only build.

  • grep -rnw over core and tools finds no remaining reference to any removed name. ValidationPolicy and ElfReader are the only implementations of IValidationPolicy and IElfReader.
  • A coverage build (-fprofile-instr-generate) of the relinker-only tests on main executed none of the removed functions.
  • Clean build with no warnings; all 163 relinker-only CTest tests pass.
  • python3 tools/check_conventions.py --base origin/main passes.

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
  • 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
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes (Claude Code, Opus 5.5)

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4872743343 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6325). Originally posted by [amirerfantim](https://github.com/amirerfantim) on 2026-10-15T11:47:41Z. --- ### What Removes relinker functions that nothing in the repository calls: - `GuestImageReader::ReadModuleNames`: its only caller was removed in 41126bfa5. - `EmitShiftImm` and `ElfReader::ReadSection` (and its `IElfReader` declaration). `ElfReader::GetFileSize` has no caller on `main` either, but #6314 adds one, so it stays. - `ValidationPolicy::ValidateNidBelongsToLibrary`, `ValidateSceStructureSize`, `ValidateDynamicFieldInterpretable` and `ValidateNoSyscallInstructions` (and their `IValidationPolicy` declarations). - `ValidationPolicy::ValidateSyscallAbsence`, which is empty, and its call. - `ValidationPolicy::RegisterLibraryImport` and `_importedLibraries`: the set is read only by `ValidateNidBelongsToLibrary`. `ValidateRelocationTypeSupported` already fills the supported relocation types when the set is empty, so it behaves the same without the registration. No behaviour changes. 11 files, 175 lines removed, none added. ### Tested macOS 27.0 (Apple Silicon), Apple clang 21.0.0, Release relinker-only build. - `grep -rnw` over `core` and `tools` finds no remaining reference to any removed name. `ValidationPolicy` and `ElfReader` are the only implementations of `IValidationPolicy` and `IElfReader`. - A coverage build (`-fprofile-instr-generate`) of the relinker-only tests on `main` executed none of the removed functions. - Clean build with no warnings; all 163 relinker-only CTest tests pass. - `python3 tools/check_conventions.py --base origin/main` passes. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes (Claude Code, Opus 5.5) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
amirerfantim commented 2026-10-15 13:05:09 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by amirerfantim on 2026-10-15T13:05:09Z.


Checked #6112 manually against this PR:

  • In GuestImage.hpp, #6112 adds a field to struct GuestImage (around line 47); this PR removes the ReadModuleNames declaration (line 60).
  • In GuestImageReader.cpp, #6112 changes GuestImageReader::Read (around line 357); this PR removes ReadModuleNames (lines 15-89).
  • Merging both PRs gives no conflict in these two files. #6112's conflicts with main are only in core/relinker/CMakeLists.txt and docs/dev/debt/relinker.md, which this PR does not change.
  • #6112 adds no use of any function this PR removes.

No overlap.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6192753806 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6325#issuecomment-6192753806). Originally posted by [amirerfantim](https://github.com/amirerfantim) on 2026-10-15T13:05:09Z. --- Checked #6112 manually against this PR: - In `GuestImage.hpp`, #6112 adds a field to `struct GuestImage` (around line 47); this PR removes the `ReadModuleNames` declaration (line 60). - In `GuestImageReader.cpp`, #6112 changes `GuestImageReader::Read` (around line 357); this PR removes `ReadModuleNames` (lines 15-89). - Merging both PRs gives no conflict in these two files. #6112's conflicts with `main` are only in `core/relinker/CMakeLists.txt` and `docs/dev/debt/relinker.md`, which this PR does not change. - #6112 adds no use of any function this PR removes. No overlap.
github-actions[bot] commented 2026-10-17 23:38:35 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-17T23:38:35Z.


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 6977 core/relinker/relinker/include/relinker/guest/GuestImage.hpp
core/relinker/relinker/src/guest/GuestImageReader.cpp
core/relinker/relinker/src/pipeline/RelinkerPipeline.cpp
PR 7450 core/relinker/relinker/include/relinker/guest/GuestImage.hpp
core/relinker/relinker/src/guest/GuestImageReader.cpp
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6243186163 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6325#issuecomment-6243186163). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-17T23:38:35Z. --- <!-- pr-overlap --> 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 6977](https://www.github.com/boykopovar/AnyPS5/pull/6977) | `core/relinker/relinker/include/relinker/guest/GuestImage.hpp`<br>`core/relinker/relinker/src/guest/GuestImageReader.cpp`<br>`core/relinker/relinker/src/pipeline/RelinkerPipeline.cpp` | | [PR 7450](https://www.github.com/boykopovar/AnyPS5/pull/7450) | `core/relinker/relinker/include/relinker/guest/GuestImage.hpp`<br>`core/relinker/relinker/src/guest/GuestImageReader.cpp` |
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!6325
No description provided.