test(relinker): audit eh_frame FDE displacement arithmetic and address bounds #17473

Closed
slopgobblercobbler wants to merge 1 commit from upstream-pr/17473 into main
slopgobblercobbler commented 2026-11-08 20:00:14 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by slopgobblercobbler on 2026-11-08T20:00:14Z.


What

Adds standalone guest unit tests in core/relinker/relinker/tests/GuestRelinkerEhFrameFde.cpp auditing DWARF .eh_frame FDE record initial_location displacement arithmetic and address range overflow limits.

Tested

Verified locally with guest_relinker_ehframe_fde test suite and tools/check_conventions.py.

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
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5214634570 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/17473). Originally posted by [slopgobblercobbler](https://github.com/slopgobblercobbler) on 2026-11-08T20:00:14Z. --- ### What Adds standalone guest unit tests in `core/relinker/relinker/tests/GuestRelinkerEhFrameFde.cpp` auditing DWARF `.eh_frame` FDE record initial_location displacement arithmetic and address range overflow limits. ### Tested Verified locally with `guest_relinker_ehframe_fde` test suite and `tools/check_conventions.py`. ### 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] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
gabichuuuuu commented 2026-11-08 21:47:32 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by gabichuuuuu on 2026-11-08T21:47:32Z.

Review: COMMENTED


Windows check of head 0b92ecb6ff against main 095ff72367. Setup: Windows 11, WinLibs GCC 15.2 r7 (x86_64-ucrt-posix-seh, the CI toolchain), Release, BUILD_TESTING=ON.

CMake configuration fails. core/relinker/CMakeLists.txt registers relinker/tests/GuestRelinkerEhFrameAug.cpp, which isn't in this branch (it's #17451's test), so configuring gives Cannot find source file and No SOURCES given to target: guest_relinker_ehframe_aug_tests.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5819806249 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/17473#pullrequestreview-5819806249). Originally posted by [gabichuuuuu](https://github.com/gabichuuuuu) on 2026-11-08T21:47:32Z. **Review:** COMMENTED --- Windows check of head `0b92ecb6ff` against `main` `095ff72367`. Setup: Windows 11, WinLibs GCC 15.2 r7 (`x86_64-ucrt-posix-seh`, the CI toolchain), Release, `BUILD_TESTING=ON`. **CMake configuration fails.** `core/relinker/CMakeLists.txt` registers `relinker/tests/GuestRelinkerEhFrameAug.cpp`, which isn't in this branch (it's #17451's test), so configuring gives `Cannot find source file` and `No SOURCES given to target: guest_relinker_ehframe_aug_tests`.
MarcZX10 commented 2026-11-21 04:57:19 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-21T04:57:19Z.

Review: COMMENTED


Reviewed — comments

The new test target is registered outside the BUILD_TESTING guard, which can break configurations that disable testing.

What I ran

Reviewed head fb99e55188a2db6592fea4368e6eaa7f8f7e80cc using repo_read.py. I did not run build or test commands. The author reports running guest_relinker_ehframe_fde and tools/check_conventions.py; those results were not independently verified.

Results

Check Result Note
Source review passed Reviewed both changed files
Build and tests not run Author-reported results only

Findings

Blocking

None.

Non-blocking

  • core/relinker/CMakeLists.txt:1334 adds both test executables after the if(BUILD_TESTING) block closes at line 1332. This registers test targets even when BUILD_TESTING is off, despite the surrounding test setup being conditional. Move these additions inside the guard (or add a new if(BUILD_TESTING) around them).

Not verified

No build, test, or convention check was run. The changed files core/relinker/CMakeLists.txt and core/relinker/relinker/tests/GuestRelinkerEhFrameFde.cpp were read. The supplied review manifest marks both changed files as included; no excluded changed files were listed. The separate excluded-files listing was unavailable through the reader.

To get this to a good state

Nothing is required. Optional: place the new test registrations under BUILD_TESTING.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6002945041 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/17473#pullrequestreview-6002945041). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-21T04:57:19Z. **Review:** COMMENTED --- # Reviewed — comments The new test target is registered outside the `BUILD_TESTING` guard, which can break configurations that disable testing. ## What I ran Reviewed head `fb99e55188a2db6592fea4368e6eaa7f8f7e80cc` using `repo_read.py`. I did not run build or test commands. The author reports running `guest_relinker_ehframe_fde` and `tools/check_conventions.py`; those results were not independently verified. ## Results | Check | Result | Note | |---|---|---| | Source review | passed | Reviewed both changed files | | Build and tests | not run | Author-reported results only | ## Findings ### Blocking None. ### Non-blocking - `core/relinker/CMakeLists.txt:1334` adds both test executables after the `if(BUILD_TESTING)` block closes at line 1332. This registers test targets even when `BUILD_TESTING` is off, despite the surrounding test setup being conditional. Move these additions inside the guard (or add a new `if(BUILD_TESTING)` around them). ## Not verified No build, test, or convention check was run. The changed files `core/relinker/CMakeLists.txt` and `core/relinker/relinker/tests/GuestRelinkerEhFrameFde.cpp` were read. The supplied review manifest marks both changed files as included; no excluded changed files were listed. The separate excluded-files listing was unavailable through the reader. ## To get this to a good state Nothing is required. Optional: place the new test registrations under `BUILD_TESTING`.

Pull request closed

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!17473
No description provided.