feat(relinker): support packed ELF64 relative relocations #11463

Merged
Mherberts merged 4 commits from upstream-pr/11463 into main 2026-10-28 04:50:41 +00:00
Mherberts commented 2026-10-26 14:41:22 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Mherberts on 2026-10-26T14:41:22Z.


What

An ELF64 x86-64 executable or bundled module containing DT_RELR currently fails conversion. Add decoding of DT_RELR / DT_RELRSZ / DT_RELRENT according to gABI 6.2, Relative Relocation Table.

Expand address entries and 63-bit bitmap windows into ordinary R_X86_64_RELATIVE relocations, taking implicit addends from file data or zero-filled load memory. Executables and bundled modules then use the existing Linux, Windows and macOS relocation writers. The relative-relocation index also consumes RELR so reachability analysis retains its pointer targets; guest lifecycle arrays see the normalized relocations before initializer validation.

Validate complete metadata, entry/table sizes, file and memory bounds, ambiguous mappings, bitmap address overflow and overlapping storage. Cross-segment storage units and relocation composition remain rejected and are recorded in docs/dev/debt/relinker.md.

Tested

Windows x64, build 26200; WinLibs GCC 15.2.0 r7; Ninja, Release, ANYPS5_RELINKER_ONLY=ON, BUILD_TESTING=ON, Python 3.13. Current head 7c90e64474ec7d3ebc6d143f06f6e2ad3b04a726 is rebased onto upstream main 2ee8e9751a06bd4cb7edb8d17f433d56a39a7025. The previous refreshed head was fabd547a2df833e1bc71e145ea6a656918d18d68. Initial feature validation was at fad2ff38efac4c7f098a31b7ce1ef5bbbe1266ef on 3ead2d7251, followed by the Linux fixture fix eb2dd32a51588d2b36285169182b556512d2f047; results on those heads are identified below.

  • On current head 7c90e64474, the complete relinker-only build passes. 10/10 focused CTests pass in 36.32 s: relr_relocations, dynamic_segment, none_relocations, guest_none_relocations, optional_plt, optional_rela, relr_conversion, guest_relr_conversion, elf_header, strict_nid_filter.

  • Coordination with #11979: moved the two RELR conversion-test registrations beside optional_rela, away from its windows_process_parameters insertion after elf_header. Test commands and timeouts are unchanged. git range-diff shows the three previous commits preserved exactly through the rebase, plus this CMake-only move.

  • Integration proof: git merge-tree --write-tree HEAD refs/pr/11979 and its reverse both exit 0 against #11979 head 0cb4dde2eec3249a9b96f86e602d3262d853095a, producing the same tree d9c9c37da88b72b568b548e05eae7142b4dba0cd. That tree retains each of relr_relocations, relr_conversion, guest_relr_conversion and windows_process_parameters exactly once, with their test sources present. No landing-order dependency remains between these two PRs.

  • Current registration audits pass: all 40 native test executables and all 203 Python test scripts have a CTest/workflow entry. Conventions against upstream/main and git diff --check pass. The required check against the fork's older origin/main completes with 0 errors and 43 upstream debt warnings.

  • Current overlap recheck used the official branch checker through the public-API adapter with 1,315 open PRs. Only this PR's own previous remote head is reported, on its four new RELR files; #11979 is no longer reported. The base-conflicting shared files in #5021, #6713 and #10861 were manually inspected: their changes concern other test registrations, TLS debt and syscall/code-extent analysis, not the relocated RELR registration or decoder.

  • At fabd547a2d, the complete relinker-only build passes. Five focused CTests pass in 8.03 s: relr_relocations, optional_rela, relr_conversion, guest_relr_conversion and strict_nid_filter.

  • Linux CI correction at eb2dd32: the original synthetic entries returned into EntryStubBuilder's intentional UD2, causing the two SIGILL failures. Linux fixtures now call the original entry, compare its expected result (42/11), and reach INT3 only on success; a mismatch reaches UD2. Native assertions require SIGTRAP on x86-64 and use the existing core-dump guard. The five focused tests pass locally (6.91 s), and the new Ubuntu relinker job passes. The original Ubuntu job passed 314/316 tests, failing only those two runtime assertions.

  • At fad2ff3, 88/88 related CTests passed in 85.69 s: ctest --test-dir build-verify -R '(relr|rela|relocation|guest|tls|optional_plt|dynamic_segment|linux_fixed_base|windows_gui|strict_nid_filter)' --output-on-failure --parallel 2. This includes the existing imports, TLS, module lifecycle and reachability coverage. The complete CTest suite was not run.

  • New native tests exercise every bitmap bit, chained/empty windows, independent address entries, implicit and partially zero-filled addends, bounds, invalid metadata, overlaps and overflow. They also verify the relative-relocation index.

  • The two new conversion tests cover 103 conversions/rejections across Linux fixed-address ELF, Linux PIE, PE and Mach-O, for executables and bundled modules. They inspect the exact normalized Linux relocation sets and counts, absence of RELR tags, and load-page congruence. Nine successful cases execute on Windows; module fixtures require a relocated function pointer and an initializer's state change to return the expected result. Cases include mixed RELA/RELR, BSS and partial-file words, even unaligned slots, empty tables and malformed inputs.

  • Negative control: built an isolated, clean git archive snapshot of main 3ead2d7251 with the same GCC 15.2.0 and Release relinker-only configuration. The same conversion tests fail there with DT_RELR relocations are not supported for executables and Unsupported dynamic tag 35 for modules; the feature build passes.

  • At fabd547a2d, python tools/check_conventions.py --base upstream/main, python tools/check_test_registration.py build-verify and git diff --check pass. The required conventions comparison against the fork's older origin/main also completes with zero errors and 32 debt-length warnings in already-merged upstream content.

  • At fabd547a2d, overlap recheck: the official tools/pr_overlap.py branch comparison used the public-API adapter and a fresh inventory of 1,339 open PRs. Its only confirmed entry is this PR's own previous remote head, matched on the four new RELR files. The base-conflicting warnings #5021, #6713, #10479 and #10861 were manually checked: their shared changes concern other test registrations, TLS notes, software interrupt tables and code-boundary scanning. The include-only collision with #11525 was removed by moving the RELR include away from the header it removes; git merge-tree --write-tree HEAD refs/pr/11525 returns success. No dependency on those PRs.

Linux and macOS artifacts were converted and inspected on Windows; native execution on those hosts, commercial titles and GPUs were not tested locally.

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:5019341393 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11463). Originally posted by [Mherberts](https://github.com/Mherberts) on 2026-10-26T14:41:22Z. --- ### What An ELF64 x86-64 executable or bundled module containing `DT_RELR` currently fails conversion. Add decoding of `DT_RELR` / `DT_RELRSZ` / `DT_RELRENT` according to [gABI 6.2, Relative Relocation Table](https://gabi.xinuos.com/elf/06-reloc.html#relative-relocation-table). Expand address entries and 63-bit bitmap windows into ordinary `R_X86_64_RELATIVE` relocations, taking implicit addends from file data or zero-filled load memory. Executables and bundled modules then use the existing Linux, Windows and macOS relocation writers. The relative-relocation index also consumes RELR so reachability analysis retains its pointer targets; guest lifecycle arrays see the normalized relocations before initializer validation. Validate complete metadata, entry/table sizes, file and memory bounds, ambiguous mappings, bitmap address overflow and overlapping storage. Cross-segment storage units and relocation composition remain rejected and are recorded in `docs/dev/debt/relinker.md`. ### Tested <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> Windows x64, build 26200; WinLibs GCC 15.2.0 r7; Ninja, Release, `ANYPS5_RELINKER_ONLY=ON`, `BUILD_TESTING=ON`, Python 3.13. Current head `7c90e64474ec7d3ebc6d143f06f6e2ad3b04a726` is rebased onto upstream `main` `2ee8e9751a06bd4cb7edb8d17f433d56a39a7025`. The previous refreshed head was `fabd547a2df833e1bc71e145ea6a656918d18d68`. Initial feature validation was at `fad2ff38efac4c7f098a31b7ce1ef5bbbe1266ef` on `3ead2d7251`, followed by the Linux fixture fix `eb2dd32a51588d2b36285169182b556512d2f047`; results on those heads are identified below. - On current head `7c90e64474`, the complete relinker-only build passes. **10/10 focused CTests pass in 36.32 s:** `relr_relocations`, `dynamic_segment`, `none_relocations`, `guest_none_relocations`, `optional_plt`, `optional_rela`, `relr_conversion`, `guest_relr_conversion`, `elf_header`, `strict_nid_filter`. - Coordination with #11979: moved the two RELR conversion-test registrations beside `optional_rela`, away from its `windows_process_parameters` insertion after `elf_header`. Test commands and timeouts are unchanged. `git range-diff` shows the three previous commits preserved exactly through the rebase, plus this CMake-only move. - Integration proof: `git merge-tree --write-tree HEAD refs/pr/11979` and its reverse both exit 0 against #11979 head `0cb4dde2eec3249a9b96f86e602d3262d853095a`, producing the same tree `d9c9c37da88b72b568b548e05eae7142b4dba0cd`. That tree retains each of `relr_relocations`, `relr_conversion`, `guest_relr_conversion` and `windows_process_parameters` exactly once, with their test sources present. No landing-order dependency remains between these two PRs. - Current registration audits pass: all 40 native test executables and all 203 Python test scripts have a CTest/workflow entry. Conventions against `upstream/main` and `git diff --check` pass. The required check against the fork's older `origin/main` completes with 0 errors and 43 upstream debt warnings. - Current overlap recheck used the official branch checker through the public-API adapter with 1,315 open PRs. Only this PR's own previous remote head is reported, on its four new RELR files; #11979 is no longer reported. The base-conflicting shared files in #5021, #6713 and #10861 were manually inspected: their changes concern other test registrations, TLS debt and syscall/code-extent analysis, not the relocated RELR registration or decoder. - At `fabd547a2d`, the complete relinker-only build passes. Five focused CTests pass in 8.03 s: `relr_relocations`, `optional_rela`, `relr_conversion`, `guest_relr_conversion` and `strict_nid_filter`. - Linux CI correction at `eb2dd32`: the original synthetic entries returned into `EntryStubBuilder`'s intentional `UD2`, causing the two `SIGILL` failures. Linux fixtures now call the original entry, compare its expected result (42/11), and reach `INT3` only on success; a mismatch reaches `UD2`. Native assertions require `SIGTRAP` on x86-64 and use the existing core-dump guard. The five focused tests pass locally (6.91 s), and the [new Ubuntu relinker job](https://github.com/boykopovar/AnyPS5/actions/runs/40345897734/job/121653258921?pr=11463) passes. The [original Ubuntu job](https://github.com/boykopovar/AnyPS5/actions/runs/40341968431/job/121638834364?pr=11463) passed 314/316 tests, failing only those two runtime assertions. - At `fad2ff3`, 88/88 related CTests passed in 85.69 s: `ctest --test-dir build-verify -R '(relr|rela|relocation|guest|tls|optional_plt|dynamic_segment|linux_fixed_base|windows_gui|strict_nid_filter)' --output-on-failure --parallel 2`. This includes the existing imports, TLS, module lifecycle and reachability coverage. The complete CTest suite was not run. - New native tests exercise every bitmap bit, chained/empty windows, independent address entries, implicit and partially zero-filled addends, bounds, invalid metadata, overlaps and overflow. They also verify the relative-relocation index. - The two new conversion tests cover 103 conversions/rejections across Linux fixed-address ELF, Linux PIE, PE and Mach-O, for executables and bundled modules. They inspect the exact normalized Linux relocation sets and counts, absence of RELR tags, and load-page congruence. Nine successful cases execute on Windows; module fixtures require a relocated function pointer and an initializer's state change to return the expected result. Cases include mixed RELA/RELR, BSS and partial-file words, even unaligned slots, empty tables and malformed inputs. - Negative control: built an isolated, clean `git archive` snapshot of `main` `3ead2d7251` with the same GCC 15.2.0 and Release relinker-only configuration. The same conversion tests fail there with `DT_RELR relocations are not supported` for executables and `Unsupported dynamic tag 35` for modules; the feature build passes. - At `fabd547a2d`, `python tools/check_conventions.py --base upstream/main`, `python tools/check_test_registration.py build-verify` and `git diff --check` pass. The required conventions comparison against the fork's older `origin/main` also completes with zero errors and 32 debt-length warnings in already-merged upstream content. - At `fabd547a2d`, overlap recheck: the official `tools/pr_overlap.py` branch comparison used the public-API adapter and a fresh inventory of 1,339 open PRs. Its only confirmed entry is this PR's own previous remote head, matched on the four new RELR files. The base-conflicting warnings #5021, #6713, #10479 and #10861 were manually checked: their shared changes concern other test registrations, TLS notes, software interrupt tables and code-boundary scanning. The include-only collision with #11525 was removed by moving the RELR include away from the header it removes; `git merge-tree --write-tree HEAD refs/pr/11525` returns success. No dependency on those PRs. Linux and macOS artifacts were converted and inspected on Windows; native execution on those hosts, commercial titles and GPUs were not tested locally. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [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 <!-- #PR, or none --> - [x] Fixes: none <!-- issue it closes as Fixes #N, or none --> - [x] Unblocks: none <!-- title ID and Game bring-up discussion, e.g. PPSA01325 #3232, or none --> - [x] GPUs tested: n/a <!-- for AGC, shader recompiler or VideoOut changes: vendor, model, driver and OS of each GPU the GPU tests ran on; otherwise n/a --> - [x] AI-assisted: yes <!-- yes / no -->
MarcZX10 commented 2026-10-26 14:57:07 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-26T14:57:07Z.

Review: CHANGES_REQUESTED


The current Ubuntu relinker job has two reproducible failures on this head. Internal ctest changing into directory: /marc/AnyPS5/build-relinker builds successfully, but both and fail at on the / case: execution returns (SIGILL) instead of the fixture's expected 42/11. The preceding output-format and relocation-set assertions pass, so this is specifically the generated Linux executable's runtime behavior. Windows relinker and ASan pass; macOS jobs are still queued. Please reproduce and correct the Linux execution failure (or establish that the runner/test setup is at fault with evidence) before merge, then rerun the focused conversion tests.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5654073855 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11463#pullrequestreview-5654073855). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-26T14:57:07Z. **Review:** CHANGES_REQUESTED --- The current Ubuntu relinker job has two reproducible failures on this head. Internal ctest changing into directory: /marc/AnyPS5/build-relinker builds successfully, but both and fail at on the / case: execution returns (SIGILL) instead of the fixture's expected 42/11. The preceding output-format and relocation-set assertions pass, so this is specifically the generated Linux executable's runtime behavior. Windows relinker and ASan pass; macOS jobs are still queued. Please reproduce and correct the Linux execution failure (or establish that the runner/test setup is at fault with evidence) before merge, then rerun the focused conversion tests.
MarcZX10 commented 2026-10-26 14:57:12 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-26T14:57:12Z.

Review: CHANGES_REQUESTED


The current Ubuntu relinker job has two failures on this head. Its log shows that the relinker builds successfully, but both relr_conversion and guest_relr_conversion fail at test_relr_relocations.py:129 on the addresses / linux case: execution returns -4 (SIGILL) instead of the fixture's expected 42/11. The preceding output-format and relocation-set assertions pass, so this is specifically the generated Linux executable's runtime behavior.

The Windows relinker and ASan jobs pass; macOS jobs are still queued. Please reproduce and correct the Linux execution failure, or establish with evidence that the runner/test setup is at fault, before merge; then rerun the focused conversion tests.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5654075448 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11463#pullrequestreview-5654075448). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-26T14:57:12Z. **Review:** CHANGES_REQUESTED --- The current Ubuntu relinker job has two failures on this head. Its log shows that the relinker builds successfully, but both `relr_conversion` and `guest_relr_conversion` fail at `test_relr_relocations.py:129` on the `addresses` / `linux` case: execution returns `-4` (SIGILL) instead of the fixture's expected 42/11. The preceding output-format and relocation-set assertions pass, so this is specifically the generated Linux executable's runtime behavior. The Windows relinker and ASan jobs pass; macOS jobs are still queued. Please reproduce and correct the Linux execution failure, or establish with evidence that the runner/test setup is at fault, before merge; then rerun the focused conversion tests.
MarcZX10 commented 2026-10-26 15:12:33 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-26T15:12:33Z.

Review: CHANGES_REQUESTED


I reviewed the updated head eb2dd32a51588d2b36285169182b556512d2f047. The Linux fixture now validates the generated entry's result before reaching the relinker's intentional return trap; I rebuilt the relinker locally and both relr_conversion and guest_relr_conversion pass. Current checks also pass for git diff --check, conventions, and a clean merge-tree preview against main.

The updated hosted run 40345897734 has Ubuntu and ASan passing; Windows is running and both macOS jobs are queued. The original Linux failure is resolved by the fixture correction, not a change to RELR conversion logic.

One repository rule remains: this branch's merge base is 3ead2d725174, while current main is 7903201bb426. I found no intervening changes under the touched relinker paths, and the merge preview is clean, but CONTRIBUTING requires branches to stay current with main. Please sync the branch before merge. I am requesting changes only for that branch-freshness requirement; the prior Linux runtime finding is withdrawn.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5654324718 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11463#pullrequestreview-5654324718). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-26T15:12:33Z. **Review:** CHANGES_REQUESTED --- I reviewed the updated head `eb2dd32a51588d2b36285169182b556512d2f047`. The Linux fixture now validates the generated entry's result before reaching the relinker's intentional return trap; I rebuilt the relinker locally and both `relr_conversion` and `guest_relr_conversion` pass. Current checks also pass for `git diff --check`, conventions, and a clean merge-tree preview against `main`. The updated hosted run `40345897734` has Ubuntu and ASan passing; Windows is running and both macOS jobs are queued. The original Linux failure is resolved by the fixture correction, not a change to RELR conversion logic. One repository rule remains: this branch's merge base is `3ead2d725174`, while current `main` is `7903201bb426`. I found no intervening changes under the touched relinker paths, and the merge preview is clean, but CONTRIBUTING requires branches to stay current with `main`. Please sync the branch before merge. I am requesting changes only for that branch-freshness requirement; the prior Linux runtime finding is withdrawn.
THEMANnt commented 2026-10-26 15:42:54 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by THEMANnt on 2026-10-26T15:42:54Z.

Review: APPROVED


Reviewed eb2dd32a5158 against 2dbe9b99f577. No actionable findings.

The parser rejects incomplete metadata, invalid mappings, bitmap overflow and overlapping relocation storage before normalizing RELR into the existing RELA pipeline. Guest-image conversion and reachability indexing consume the decoded entries; fixtures check relocation output and guest initializer/input side effects.

Validation: The local Release relinker-only build passed (312 build steps); relr_relocations, relr_conversion, guest_relr_conversion and optional_rela passed (4/4), as did an independent PT_LOAD-end overflow check. Hosted relinker jobs merged the PR head into checkout 7903201bb426: Windows CTest 312/312, Ubuntu 316/316 and macOS 306/306 on both runners (0 failures; no skipped tests listed). Hosted ASAN passed 34/34 tls_function_coverage tests; it did not run RELR tests.

The local full CTest run did not complete: unrelated shader-cache tests failed while creating or using temporary CMake/Ninja builds. My cached-binary control was fixture-incompatible, so the author's pinned-base negative control remains unverified. Other hosted workflow jobs were skipped.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5654777307 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11463#pullrequestreview-5654777307). Originally posted by [THEMANnt](https://github.com/THEMANnt) on 2026-10-26T15:42:54Z. **Review:** APPROVED --- Reviewed `eb2dd32a5158` against `2dbe9b99f577`. No actionable findings. The parser rejects incomplete metadata, invalid mappings, bitmap overflow and overlapping relocation storage before normalizing RELR into the existing RELA pipeline. Guest-image conversion and reachability indexing consume the decoded entries; fixtures check relocation output and guest initializer/input side effects. **Validation:** The local Release relinker-only build passed (312 build steps); `relr_relocations`, `relr_conversion`, `guest_relr_conversion` and `optional_rela` passed (4/4), as did an independent PT_LOAD-end overflow check. Hosted relinker jobs merged the PR head into checkout `7903201bb426`: Windows CTest 312/312, Ubuntu 316/316 and macOS 306/306 on both runners (0 failures; no skipped tests listed). Hosted ASAN passed 34/34 `tls_function_coverage` tests; it did not run RELR tests. The local full CTest run did not complete: unrelated shader-cache tests failed while creating or using temporary CMake/Ninja builds. My cached-binary control was fixture-incompatible, so the author's pinned-base negative control remains unverified. Other hosted workflow jobs were skipped.
jotitadev commented 2026-10-27 01:27:19 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-27T01:27:19Z.

Review: COMMENTED


Ran on macOS: Apple M2 Max, macOS 27.2, Xcode 27 clang, relinker-only Release. Head fabd547a2d applied on current main cb45ae2ddf (clean merge). Two builds: arm64 native, and x86_64 under Rosetta with /usr/bin/python3 3.9.6. Full suite: arm64 312/312, Rosetta 310/310 (main: 309/309 and 307/307, plus the 3 new tests).

One addition from macOS. For --macos, test_relr_relocations.py checks only the Mach-O magic; it executes outputs only on Windows and Linux hosts. So I executed the macOS outputs:

  • Run. I converted the five positive executable cases (addresses, bitmap, mixed, zero-fill-addends, even-unaligned-slot) with --macos --skip-sce-module. I ran each Mach-O under Rosetta with stub x86_64 dylibs for libkernel.prx and libc.prx, where Aps5StartGuest_nid_no_patch calls the entry and exits with its return value (the START pattern of test_macos_trace_imports.py).
  • Result. All five exit 42, so the entry's jmp [0x800] reaches 0x210 through the RELR-relocated slot. The result is the same whether the relinker was built arm64 or x86_64.
  • On main, the same inputs fail with DT_RELR relocations are not supported.

If you want that covered by the test itself, the run fits under sys.platform == "darwin" the same way test_macos_trace_imports.py does it. That is optional and not a blocker.

Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5661204145 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11463#pullrequestreview-5661204145). Originally posted by [jotitadev](https://github.com/jotitadev) on 2026-10-27T01:27:19Z. **Review:** COMMENTED --- Ran on macOS: Apple M2 Max, macOS 27.2, Xcode 27 clang, relinker-only Release. Head `fabd547a2d` applied on current `main` `cb45ae2ddf` (clean merge). Two builds: arm64 native, and x86_64 under Rosetta with `/usr/bin/python3` 3.9.6. Full suite: arm64 312/312, Rosetta 310/310 (`main`: 309/309 and 307/307, plus the 3 new tests). One addition from macOS. For `--macos`, `test_relr_relocations.py` checks only the Mach-O magic; it executes outputs only on Windows and Linux hosts. So I executed the macOS outputs: - **Run.** I converted the five positive executable cases (`addresses`, `bitmap`, `mixed`, `zero-fill-addends`, `even-unaligned-slot`) with `--macos --skip-sce-module`. I ran each Mach-O under Rosetta with stub x86_64 dylibs for `libkernel.prx` and `libc.prx`, where `Aps5StartGuest_nid_no_patch` calls the entry and exits with its return value (the `START` pattern of `test_macos_trace_imports.py`). - **Result.** All five exit 42, so the entry's `jmp [0x800]` reaches 0x210 through the RELR-relocated slot. The result is the same whether the relinker was built arm64 or x86_64. - **On `main`,** the same inputs fail with `DT_RELR relocations are not supported`. If you want that covered by the test itself, the run fits under `sys.platform == "darwin"` the same way `test_macos_trace_imports.py` does it. That is optional and not a blocker. Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
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!11463
No description provided.