fix(relinker): emit PT_GNU_RELRO for Linux output instead of leaving RELRO writable #10662

Merged
shurhundo merged 4 commits from upstream-pr/10662 into main 2026-11-04 17:35:24 +00:00
shurhundo commented 2026-10-24 15:51:56 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by shurhundo on 2026-10-24T15:51:56Z.


What

On Linux, a PT_SCE_RELRO segment from the original PS4/PS5 layout was never actually protected. If it overlapped an existing PT_LOAD it got dropped as SCE-specific debt, and if it didn't it got turned into a plain read-write PT_LOAD. Either way, nothing made that memory read-only after relocations ran, unlike FreeBSD's own rtld, which makes the equivalent PT_GNU_RELRO segment read-only once relocations finish.

ElfReader now retypes a covered PT_SCE_RELRO into PT_GNU_RELRO directly, and for an uncovered one it still synthesizes a PT_LOAD to map the memory but also adds a separate PT_GNU_RELRO entry over the same range. The rest of the pipeline (ProgramHeaderLayoutBuilder's write-coverage check, SegmentFilter) already knew how to handle PT_GNU_RELRO correctly, it just never received one from this path, so this is really finishing existing wiring rather than adding new logic.

A guest image with more than one PT_SCE_RELRO range now throws a clear error on Linux output instead of silently protecting only the last one, whether the ranges are disjoint, overlapping or identical: glibc's loader and LLD both track only one PT_GNU_RELRO segment per image, and combining overlapping or identical ranges into one isn't implemented either, since no observed title needs more than one range.

Windows and macOS don't have an OS-loader-level equivalent to PT_GNU_RELRO, and Linux output with --lazy-binding can't safely get it either without more work: the original DT_PLTGOT region stays writable there for the host loader's lazy PLT resolution, and whether that region overlaps a given title's PT_SCE_RELRO range isn't verified either way. docs/dev/debt/relinker.md now records this gap for all three; closing it means adding a VirtualProtect/mprotect call to the entry stub for Windows/macOS, and resolving the lazy-binding/RELRO interaction for Linux. Both are separate topics, left for follow-up PRs.

Tested

On this exact head:

  • WSL2 (Ubuntu 26.04), GCC 15.2.0: full relinker-only ctest suite, 540/540 pass (main has grown since this PR was first opened), including sce_relro, linux_load_bounds, program_layout_ranges and elf_reader_bounds run together, plus the new overlapping/identical multi-RELRO regressions.
  • Native Windows, WinLibs GCC 15.2.0-r7: relinker-only build succeeds clean; program_layout_ranges_tests (covers the multi-RELRO rejection, including the two new cases) passes directly. Native execution of several other test binaries on this machine is unreliable this session due to an escalating Application Control policy block that reproduces on an unmodified main build too, unrelated to this change.
  • python tools/check_conventions.py --base origin/main: passes
  • python tools/pr_overlap.py --branch fix/linux-relro-enforcement: flags the same pre-existing shared-line overlaps with other open PRs as before (an unmerged alignment-check stack in ElfReader.cpp, and incidental proximity in docs/dev/debt/relinker.md); none are duplicate implementations of this fix.

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: #10518
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4996844254 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10662). Originally posted by [shurhundo](https://github.com/shurhundo) on 2026-10-24T15:51:56Z. --- ### What On Linux, a `PT_SCE_RELRO` segment from the original PS4/PS5 layout was never actually protected. If it overlapped an existing `PT_LOAD` it got dropped as SCE-specific debt, and if it didn't it got turned into a plain read-write `PT_LOAD`. Either way, nothing made that memory read-only after relocations ran, unlike FreeBSD's own rtld, which makes the equivalent `PT_GNU_RELRO` segment read-only once relocations finish. `ElfReader` now retypes a covered `PT_SCE_RELRO` into `PT_GNU_RELRO` directly, and for an uncovered one it still synthesizes a `PT_LOAD` to map the memory but also adds a separate `PT_GNU_RELRO` entry over the same range. The rest of the pipeline (`ProgramHeaderLayoutBuilder`'s write-coverage check, `SegmentFilter`) already knew how to handle `PT_GNU_RELRO` correctly, it just never received one from this path, so this is really finishing existing wiring rather than adding new logic. A guest image with more than one `PT_SCE_RELRO` range now throws a clear error on Linux output instead of silently protecting only the last one, whether the ranges are disjoint, overlapping or identical: glibc's loader and LLD both track only one `PT_GNU_RELRO` segment per image, and combining overlapping or identical ranges into one isn't implemented either, since no observed title needs more than one range. Windows and macOS don't have an OS-loader-level equivalent to `PT_GNU_RELRO`, and Linux output with `--lazy-binding` can't safely get it either without more work: the original `DT_PLTGOT` region stays writable there for the host loader's lazy PLT resolution, and whether that region overlaps a given title's `PT_SCE_RELRO` range isn't verified either way. `docs/dev/debt/relinker.md` now records this gap for all three; closing it means adding a `VirtualProtect`/`mprotect` call to the entry stub for Windows/macOS, and resolving the lazy-binding/RELRO interaction for Linux. Both are separate topics, left for follow-up PRs. ### Tested On this exact head: - WSL2 (Ubuntu 26.04), GCC 15.2.0: full relinker-only `ctest` suite, 540/540 pass (main has grown since this PR was first opened), including `sce_relro`, `linux_load_bounds`, `program_layout_ranges` and `elf_reader_bounds` run together, plus the new overlapping/identical multi-RELRO regressions. - Native Windows, WinLibs GCC 15.2.0-r7: relinker-only build succeeds clean; `program_layout_ranges_tests` (covers the multi-RELRO rejection, including the two new cases) passes directly. Native execution of several other test binaries on this machine is unreliable this session due to an escalating Application Control policy block that reproduces on an unmodified `main` build too, unrelated to this change. - `python tools/check_conventions.py --base origin/main`: passes - `python tools/pr_overlap.py --branch fix/linux-relro-enforcement`: flags the same pre-existing shared-line overlaps with other open PRs as before (an unmerged alignment-check stack in `ElfReader.cpp`, and incidental proximity in `docs/dev/debt/relinker.md`); none are duplicate implementations of this fix. ### 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: #10518 - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
MarcZX10 commented 2026-10-24 21:50:41 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-24T21:50:41Z.

Review: CHANGES_REQUESTED


The exact-head tests pass locally, but there is a Linux loader compatibility blocker for multiple original RELRO ranges. I constructed a local fixture with two disjoint PT_SCE_RELRO headers and ran this PR’s relinker; the output contains two PT_GNU_RELRO headers. glibc currently stores only one l_relro_addr/l_relro_size while parsing these headers, so a later entry overwrites the earlier one and only one range is protected (see glibc dl-load.c). LLD also documents that current loaders only support one PT_GNU_RELRO header (LLD Writer.cpp). Please preserve all RELRO ranges in a form supported by the Linux loader (without widening across intervening writable data), or reject unsupported multi-range inputs clearly, and add a two-range regression. The current tests cover only one SCE RELRO header per output.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5640164911 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10662#pullrequestreview-5640164911). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-24T21:50:41Z. **Review:** CHANGES_REQUESTED --- The exact-head tests pass locally, but there is a Linux loader compatibility blocker for multiple original RELRO ranges. I constructed a local fixture with two disjoint `PT_SCE_RELRO` headers and ran this PR’s relinker; the output contains two `PT_GNU_RELRO` headers. glibc currently stores only one `l_relro_addr`/`l_relro_size` while parsing these headers, so a later entry overwrites the earlier one and only one range is protected (see [glibc dl-load.c](https://codebrowser.dev/glibc/glibc/elf/dl-load.c.html#1244)). LLD also documents that current loaders only support one `PT_GNU_RELRO` header ([LLD Writer.cpp](https://github.com/llvm/llvm-project/blob/main/lld/ELF/Writer.cpp)). Please preserve all RELRO ranges in a form supported by the Linux loader (without widening across intervening writable data), or reject unsupported multi-range inputs clearly, and add a two-range regression. The current tests cover only one SCE RELRO header per output.
MarcZX10 commented 2026-10-28 22:10:49 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-28T22:10:49Z.

Review: APPROVED


Reviewing exact head 23e0ad626a7e4a0146233bc7e14a6d0d92ed1aca.

What I ran

  • Inspected the RELRO conversion, one-range guard, layout and reader regressions, debt updates, review history, and current hosted checks.
  • Confirmed current main has not changed the touched ELF reader, layout builder, RELRO tests, or debt file since the PR's integration snapshot.
  • Hosted relinker checks pass on macOS arm64/x86_64, Linux, and Windows; ASan, conventions, labels, and eligibility pass.
  • I did not run a local build or tests.

Results

Check Result Evidence
PT_SCE_RELRO to PT_GNU_RELRO conversion Reviewed Exact PR diff
Disjoint-range handling Reviewed Explicit error instead of silently protecting only one range
Full relinker CTest Pass, author-reported 372/372 on WSL2, including RELRO and bounds suites
Native Windows relinker build Pass, author-reported Tests blocked by the same App Control policy failure on main
Hosted relinker platform matrix Pass macOS arm64/x86_64, Linux, Windows
Hosted ASan and policy checks Pass GitHub Actions
Local build and CTest Not run This review

Findings

Blocking

None.

Non-blocking

  • The change preserves mapping for uncovered SCE RELRO ranges while emitting a separate read-only GNU RELRO program header; covered ranges receive the protection header without replacing their load mapping. The layout builder rejects multiple disjoint GNU RELRO ranges rather than silently allowing the loader to protect only the last one.
  • Scope limitations are recorded: Windows, macOS, and Linux lazy-binding output still need a post-relocation protection mechanism. The PR does not claim to solve those paths.

Sources

Not verified

  • I did not run a local build, CTest, or a native Linux loader check.
  • The full suite and Windows policy comparison are author-reported; the hosted platform matrix passed.

To get this to a good state

No blocking issue remains in the reviewed head. Keep the documented unsupported output modes as follow-up work.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5690365808 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10662#pullrequestreview-5690365808). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-28T22:10:49Z. **Review:** APPROVED --- Reviewing exact head `23e0ad626a7e4a0146233bc7e14a6d0d92ed1aca`. ## What I ran - Inspected the RELRO conversion, one-range guard, layout and reader regressions, debt updates, review history, and current hosted checks. - Confirmed current main has not changed the touched ELF reader, layout builder, RELRO tests, or debt file since the PR's integration snapshot. - Hosted relinker checks pass on macOS arm64/x86_64, Linux, and Windows; ASan, conventions, labels, and eligibility pass. - I did not run a local build or tests. ## Results | Check | Result | Evidence | |---|---|---| | PT_SCE_RELRO to PT_GNU_RELRO conversion | Reviewed | Exact PR diff | | Disjoint-range handling | Reviewed | Explicit error instead of silently protecting only one range | | Full relinker CTest | Pass, author-reported | 372/372 on WSL2, including RELRO and bounds suites | | Native Windows relinker build | Pass, author-reported | Tests blocked by the same App Control policy failure on main | | Hosted relinker platform matrix | Pass | macOS arm64/x86_64, Linux, Windows | | Hosted ASan and policy checks | Pass | GitHub Actions | | Local build and CTest | Not run | This review | ## Findings ### Blocking None. ### Non-blocking - The change preserves mapping for uncovered SCE RELRO ranges while emitting a separate read-only GNU RELRO program header; covered ranges receive the protection header without replacing their load mapping. The layout builder rejects multiple disjoint GNU RELRO ranges rather than silently allowing the loader to protect only the last one. - Scope limitations are recorded: Windows, macOS, and Linux lazy-binding output still need a post-relocation protection mechanism. The PR does not claim to solve those paths. ## Sources - [Repository relinker build and test rules](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/BUILD.md) - [Current pull request and exact-head test report](https://github.com/boykopovar/AnyPS5/pull/10662) ## Not verified - I did not run a local build, CTest, or a native Linux loader check. - The full suite and Windows policy comparison are author-reported; the hosted platform matrix passed. ## To get this to a good state No blocking issue remains in the reviewed head. Keep the documented unsupported output modes as follow-up work.
MarcZX10 commented 2026-10-31 07:57:45 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-31T07:57:45Z.

Review: CHANGES_REQUESTED


Reviewed — changes requested

The current head merges cleanly into main, but it conflicts with open PR #10518 in ElfReader.cpp; their landing order must be agreed and recorded before this review can be cleared.

What I ran

Reviewed head 4d860f88820ce0dfb22eb4ad034d9ff84a5ed023 against base 828ac0b2ae74aac181ba128fb59b08a1534f2041; its merge preview with main is clean. Environment: Linux x86_64, kernel 6.1.0-54-amd64, Python 3.11.2, GCC 12.2.0. I did not build or run C++ tests locally.

python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 10662
git merge-tree --write-tree refs/review/pr-10662 refs/review/pr-10518

Results

Check Result
Diff and conventions Passed; precheck confirmed head/base stable.
Merge with current main Clean.
Pairwise merge with #10518 Conflict in core/relinker/relinker/src/parsing/ElfReader.cpp. #10518 adds PT_LOAD/PT_SCE_RELRO alignment validation in the same ReadProgramHeaders block where this PR adds RELRO conversion.
Author-reported tests The PR reports 372/372 relinker-only CTest cases passing on WSL2 at this head. Windows relinker tests reportedly hit the same Application Control error on this head and plain main; I did not reproduce either run.
Hosted CI Conventions, labels, eligibility, and ASan pass. Linux/Windows relinker jobs are in progress and macOS relinker jobs are queued; product Linux/Windows and specialized jobs are skipped.
Precheck helper Head/base remained stable. The optional test-quality helper could not start in the isolated checkout because the workspace-only script is absent there.
Unedited output from the pairwise merge preview
8e3599869f98a2e53edc4c1cd70c98105056fb1c
100644 82f5e304aea38efafe6edab2f6af5cac170240b2 1	core/relinker/relinker/src/parsing/ElfReader.cpp
100644 e28cc53e427e3feef287e17e55473ec42f627f3c 2	core/relinker/relinker/src/parsing/ElfReader.cpp
100644 f454b124cdada1582d5ee0d72f0cf1e9e5d6c4da 3	core/relinker/relinker/src/parsing/ElfReader.cpp

Auto-merging core/relinker/relinker/src/parsing/ElfReader.cpp
CONFLICT (content): Merge conflict in core/relinker/relinker/src/parsing/ElfReader.cpp
Auto-merging core/relinker/relinker/tests/ElfReaderBoundsTests.cpp

Negative control

Assertion Change to code under test Did the new test fail?
PT_SCE_RELRO is converted and protected in Linux output No local base build/control was run; the PR reports its full test suite on the changed head only Not exercised in this review.

Findings

Blocking

  1. Unresolved landing order with #10518. The PR body acknowledges the shared ElfReader.cpp alignment-check stack, but the checklist currently says Depends on: none and I found no agreement with #10518's author. The repository requires authors to agree which overlapping PR lands first and declare the dependency. Please coordinate that order, record it on the checklist, and rebase/resolve the resulting integration before asking for another review. If this PR must follow #10518, list Depends on: #10518; if it goes first, record the agreed order so #10518 can integrate it.
  2. The multiple-RELRO guard is broader than its documented limitation. _outputHeaders rejects every input with more than one PT_GNU_RELRO header, while the error, PR description, and debt entry describe only multiple disjoint ranges. Please either combine overlapping/identical ranges and reject only ranges with gaps, or update the error and debt entry to state that any multiple RELRO headers are unsupported, with a test for that broader rule.

Non-blocking

The reported Windows Application Control failures are not presented as regressions because the author says the same failures reproduce on plain main; Linux GPU/console behavior is not relevant to this relinker change.

Sources

Not verified

No local C++ build/CTest, Windows rerun, or console runtime test. The author-reported WSL2 test run was not independently reproduced; hosted Linux/Windows relinker jobs were still running and macOS relinker jobs were queued at the last snapshot; ASan passed.

To get this to a good state

Agree and record the order with #10518, resolve the shared-file integration, and align the multiple-RELRO guard's behavior with its documented scope. I will rerun the same relevant checks on the updated head.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5721897992 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10662#pullrequestreview-5721897992). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-31T07:57:45Z. **Review:** CHANGES_REQUESTED --- # Reviewed — changes requested The current head merges cleanly into `main`, but it conflicts with open PR #10518 in `ElfReader.cpp`; their landing order must be agreed and recorded before this review can be cleared. ## What I ran Reviewed head `4d860f88820ce0dfb22eb4ad034d9ff84a5ed023` against base `828ac0b2ae74aac181ba128fb59b08a1534f2041`; its merge preview with `main` is clean. Environment: Linux x86_64, kernel 6.1.0-54-amd64, Python 3.11.2, GCC 12.2.0. I did not build or run C++ tests locally. ```sh python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 10662 git merge-tree --write-tree refs/review/pr-10662 refs/review/pr-10518 ``` ## Results | Check | Result | |---|---| | Diff and conventions | Passed; precheck confirmed head/base stable. | | Merge with current `main` | Clean. | | Pairwise merge with #10518 | Conflict in `core/relinker/relinker/src/parsing/ElfReader.cpp`. #10518 adds `PT_LOAD`/`PT_SCE_RELRO` alignment validation in the same `ReadProgramHeaders` block where this PR adds RELRO conversion. | | Author-reported tests | The PR reports 372/372 relinker-only CTest cases passing on WSL2 at this head. Windows relinker tests reportedly hit the same Application Control error on this head and plain `main`; I did not reproduce either run. | | Hosted CI | Conventions, labels, eligibility, and ASan pass. Linux/Windows relinker jobs are in progress and macOS relinker jobs are queued; product Linux/Windows and specialized jobs are skipped. | | Precheck helper | Head/base remained stable. The optional test-quality helper could not start in the isolated checkout because the workspace-only script is absent there. | <details> <summary>Unedited output from the pairwise merge preview</summary> ```text 8e3599869f98a2e53edc4c1cd70c98105056fb1c 100644 82f5e304aea38efafe6edab2f6af5cac170240b2 1 core/relinker/relinker/src/parsing/ElfReader.cpp 100644 e28cc53e427e3feef287e17e55473ec42f627f3c 2 core/relinker/relinker/src/parsing/ElfReader.cpp 100644 f454b124cdada1582d5ee0d72f0cf1e9e5d6c4da 3 core/relinker/relinker/src/parsing/ElfReader.cpp Auto-merging core/relinker/relinker/src/parsing/ElfReader.cpp CONFLICT (content): Merge conflict in core/relinker/relinker/src/parsing/ElfReader.cpp Auto-merging core/relinker/relinker/tests/ElfReaderBoundsTests.cpp ``` </details> ## Negative control | Assertion | Change to code under test | Did the new test fail? | |---|---|---| | `PT_SCE_RELRO` is converted and protected in Linux output | No local base build/control was run; the PR reports its full test suite on the changed head only | Not exercised in this review. | ## Findings ### Blocking 1. **Unresolved landing order with #10518.** The PR body acknowledges the shared `ElfReader.cpp` alignment-check stack, but the checklist currently says `Depends on: none` and I found no agreement with #10518's author. The repository requires authors to agree which overlapping PR lands first and declare the dependency. Please coordinate that order, record it on the checklist, and rebase/resolve the resulting integration before asking for another review. If this PR must follow #10518, list `Depends on: #10518`; if it goes first, record the agreed order so #10518 can integrate it. 2. **The multiple-RELRO guard is broader than its documented limitation.** `_outputHeaders` rejects every input with more than one `PT_GNU_RELRO` header, while the error, PR description, and debt entry describe only multiple *disjoint* ranges. Please either combine overlapping/identical ranges and reject only ranges with gaps, or update the error and debt entry to state that any multiple RELRO headers are unsupported, with a test for that broader rule. ### Non-blocking The reported Windows Application Control failures are not presented as regressions because the author says the same failures reproduce on plain `main`; Linux GPU/console behavior is not relevant to this relinker change. ## Sources - [Repository overlap and dependency rules at the reviewed base](https://github.com/boykopovar/AnyPS5/blob/828ac0b2ae74aac181ba128fb59b08a1534f2041/CONTRIBUTING.md#L64-L69) - [This PR's `PT_SCE_RELRO` conversion at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/4d860f88820ce0dfb22eb4ad034d9ff84a5ed023/core/relinker/relinker/src/parsing/ElfReader.cpp#L149-L181) - [Open #10518 alignment checks at its current head](https://github.com/boykopovar/AnyPS5/blob/b77442817d507bc15b3f9a66c7ce1c76843ae2fe/core/relinker/relinker/src/parsing/ElfReader.cpp#L146-L174) - [Multiple-RELRO guard at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/4d860f88820ce0dfb22eb4ad034d9ff84a5ed023/core/relinker/elfpatcher/src/general/ProgramHeaderLayoutBuilder.cpp#L153-L158) - [Debt entry at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/4d860f88820ce0dfb22eb4ad034d9ff84a5ed023/docs/dev/debt/relinker.md#L30-L34) - [PR description and author-reported test results](https://github.com/boykopovar/AnyPS5/pull/10662) ## Not verified No local C++ build/CTest, Windows rerun, or console runtime test. The author-reported WSL2 test run was not independently reproduced; hosted Linux/Windows relinker jobs were still running and macOS relinker jobs were queued at the last snapshot; ASan passed. ## To get this to a good state Agree and record the order with #10518, resolve the shared-file integration, and align the multiple-RELRO guard's behavior with its documented scope. I will rerun the same relevant checks on the updated head.
MarcZX10 commented 2026-10-31 08:29:47 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-31T08:29:47Z.

Review: APPROVED


Reviewed — looks good

The changes requested on the prior head are addressed, the exact current diff is coherent, and the available Linux relinker checks pass.

What I ran

Reviewed head 79a91f942c741b17e74ca52c8176d05eb35d2ff1, based on PR base 828ac0b2ae74aac181ba128fb59b08a1534f2041. Previewed the PR against current main at e8c25dd3baa6e78531d5eee067fec5cbe8af3dcf; it merged cleanly. Environment: Debian GNU/Linux 12, x86_64, Linux 6.1.0-54, Python 3.11.2, GCC 12.2.0. No local C++ build or CTest was run.

python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 10662 --output-dir /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-10662
python3 tools/pr_stack_check.py 10662 --repo boykopovar/AnyPS5 --output-dir /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-10662/stack
gh pr checks 10662 --repo boykopovar/AnyPS5

Results

Check Result
Diff and conventions/template Passed on the exact PR head and base.
Python syntax and test registration Passed; the precheck found 230 registered test scripts.
Current-main merge preview Clean against e8c25dd3baa6e78531d5eee067fec5cbe8af3dcf. Main's three commits since the PR base touch unrelated files.
Dependency/overlap The PR now declares Depends on: #10518, agreeing that #10518 lands first. #10518 remains open and its head is not yet included here; the stack check reports no conflict in the individual current-main previews. Reassess integration after #10518 merges.
Test-quality heuristic Unavailable: the helper is absent from the isolated precheck worktree. This is not a test failure.
Hosted relinker CI Ubuntu, Windows, and ASan passed. Both macOS relinker jobs were pending. Product Linux/Windows and specialized jobs were skipped.
Author-reported tests On this exact head, the author reports 540/540 relinker CTest cases passing on WSL2/Ubuntu 26.04 and a clean native Windows build with program_layout_ranges_tests passing. I did not independently reproduce these runs.
Local C++ build/CTest Not run; initial reviews are no-build.
Unedited outputs
Convention check
All conventions checks passed.
Dependency and merge preview
# PR stack check — fresh

Target: https://github.com/boykopovar/AnyPS5/pull/10662
Target branch tip: `e8c25dd3baa6e78531d5eee067fec5cbe8af3dcf`
All heads unchanged: **True**
Dependency order: #10518 → #10662

## Individual merge previews

- PR #10518: **clean** against current base; head `b77442817d507bc15b3f9a66c7ce1c76843ae2fe`; changed paths: none reported
- PR #10662: **clean** against current base; head `79a91f942c741b17e74ca52c8176d05eb35d2ff1`; changed paths: none reported

## Dependency relationships

- #10518 → #10662: **current_dependency_head_not_included**; overlapping changed paths: `core/relinker/relinker/src/parsing/ElfReader.cpp`, `core/relinker/relinker/tests/ElfReaderBoundsTests.cpp`, `docs/dev/debt/relinker.md`
Hosted checks (`gh pr checks`)
conventions	pass	14s	https://github.com/boykopovar/AnyPS5/actions/runs/41184261587/job/124487811088
labels	pass	7s	https://github.com/boykopovar/AnyPS5/actions/runs/41184261612/job/124487811162
relinker (windows-latest, g++)	pass	9m1s	https://github.com/boykopovar/AnyPS5/actions/runs/41184186069/job/124487616528
relinker (ubuntu-latest, g++)	pass	4m18s	https://github.com/boykopovar/AnyPS5/actions/runs/41184186069/job/124487616490
relinker-asan	pass	2m1s	https://github.com/boykopovar/AnyPS5/actions/runs/41184186069/job/124487616426
relinker (macos-latest, clang++)	pending	0	https://github.com/boykopovar/AnyPS5/actions/runs/41184186069/job/124487616449
relinker (macos-latest, clang++, x86_64)	pending	0	https://github.com/boykopovar/AnyPS5/actions/runs/41184186069/job/124487616463
register-context	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/41184186069/job/124487617553
write-watch	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/41184186069/job/124487617239
linux	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/41184186069/job/124487617519
windows	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/41184186069/job/124487617515
eligibility	pass	5s	https://github.com/boykopovar/AnyPS5/actions/runs/41184186069/job/124487594530

Findings

Blocking

None found in the reviewed head. The prior multi-RELRO scope mismatch is resolved: the error, debt entry, and added overlapping/identical-range tests now agree that Linux output rejects any input containing multiple RELRO ranges. The prior overlap-order concern is addressed by declaring the agreed #10518 dependency.

Non-blocking

  • #10518 remains open. The dependency order is now explicit; wait for it to land before rebasing/integrating this PR, then recheck the resulting head.

Sources

Not verified

No local build/CTest, Windows test reproduction, macOS test, or physical-console behavior. Hosted macOS relinker jobs were pending at the last check. The author-reported WSL2 and Windows results were not independently reproduced.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5721993878 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10662#pullrequestreview-5721993878). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-31T08:29:47Z. **Review:** APPROVED --- # Reviewed — looks good The changes requested on the prior head are addressed, the exact current diff is coherent, and the available Linux relinker checks pass. ## What I ran Reviewed head `79a91f942c741b17e74ca52c8176d05eb35d2ff1`, based on PR base `828ac0b2ae74aac181ba128fb59b08a1534f2041`. Previewed the PR against current `main` at `e8c25dd3baa6e78531d5eee067fec5cbe8af3dcf`; it merged cleanly. Environment: Debian GNU/Linux 12, x86_64, Linux 6.1.0-54, Python 3.11.2, GCC 12.2.0. No local C++ build or CTest was run. ```sh python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 10662 --output-dir /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-10662 python3 tools/pr_stack_check.py 10662 --repo boykopovar/AnyPS5 --output-dir /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-10662/stack gh pr checks 10662 --repo boykopovar/AnyPS5 ``` ## Results | Check | Result | |---|---| | Diff and conventions/template | Passed on the exact PR head and base. | | Python syntax and test registration | Passed; the precheck found 230 registered test scripts. | | Current-main merge preview | Clean against `e8c25dd3baa6e78531d5eee067fec5cbe8af3dcf`. Main's three commits since the PR base touch unrelated files. | | Dependency/overlap | The PR now declares `Depends on: #10518`, agreeing that #10518 lands first. #10518 remains open and its head is not yet included here; the stack check reports no conflict in the individual current-main previews. Reassess integration after #10518 merges. | | Test-quality heuristic | Unavailable: the helper is absent from the isolated precheck worktree. This is not a test failure. | | Hosted relinker CI | Ubuntu, Windows, and ASan passed. Both macOS relinker jobs were pending. Product Linux/Windows and specialized jobs were skipped. | | Author-reported tests | On this exact head, the author reports 540/540 relinker CTest cases passing on WSL2/Ubuntu 26.04 and a clean native Windows build with `program_layout_ranges_tests` passing. I did not independently reproduce these runs. | | Local C++ build/CTest | Not run; initial reviews are no-build. | <details><summary>Unedited outputs</summary> <details><summary>Convention check</summary> ```text All conventions checks passed. ``` </details> <details><summary>Dependency and merge preview</summary> ```text # PR stack check — fresh Target: https://github.com/boykopovar/AnyPS5/pull/10662 Target branch tip: `e8c25dd3baa6e78531d5eee067fec5cbe8af3dcf` All heads unchanged: **True** Dependency order: #10518 → #10662 ## Individual merge previews - PR #10518: **clean** against current base; head `b77442817d507bc15b3f9a66c7ce1c76843ae2fe`; changed paths: none reported - PR #10662: **clean** against current base; head `79a91f942c741b17e74ca52c8176d05eb35d2ff1`; changed paths: none reported ## Dependency relationships - #10518 → #10662: **current_dependency_head_not_included**; overlapping changed paths: `core/relinker/relinker/src/parsing/ElfReader.cpp`, `core/relinker/relinker/tests/ElfReaderBoundsTests.cpp`, `docs/dev/debt/relinker.md` ``` </details> <details><summary>Hosted checks (`gh pr checks`)</summary> ```text conventions pass 14s https://github.com/boykopovar/AnyPS5/actions/runs/41184261587/job/124487811088 labels pass 7s https://github.com/boykopovar/AnyPS5/actions/runs/41184261612/job/124487811162 relinker (windows-latest, g++) pass 9m1s https://github.com/boykopovar/AnyPS5/actions/runs/41184186069/job/124487616528 relinker (ubuntu-latest, g++) pass 4m18s https://github.com/boykopovar/AnyPS5/actions/runs/41184186069/job/124487616490 relinker-asan pass 2m1s https://github.com/boykopovar/AnyPS5/actions/runs/41184186069/job/124487616426 relinker (macos-latest, clang++) pending 0 https://github.com/boykopovar/AnyPS5/actions/runs/41184186069/job/124487616449 relinker (macos-latest, clang++, x86_64) pending 0 https://github.com/boykopovar/AnyPS5/actions/runs/41184186069/job/124487616463 register-context skipping 0 https://github.com/boykopovar/AnyPS5/actions/runs/41184186069/job/124487617553 write-watch skipping 0 https://github.com/boykopovar/AnyPS5/actions/runs/41184186069/job/124487617239 linux skipping 0 https://github.com/boykopovar/AnyPS5/actions/runs/41184186069/job/124487617519 windows skipping 0 https://github.com/boykopovar/AnyPS5/actions/runs/41184186069/job/124487617515 eligibility pass 5s https://github.com/boykopovar/AnyPS5/actions/runs/41184186069/job/124487594530 ``` </details> </details> ## Findings ### Blocking None found in the reviewed head. The prior multi-RELRO scope mismatch is resolved: the error, debt entry, and added overlapping/identical-range tests now agree that Linux output rejects any input containing multiple RELRO ranges. The prior overlap-order concern is addressed by declaring the agreed `#10518` dependency. ### Non-blocking - `#10518` remains open. The dependency order is now explicit; wait for it to land before rebasing/integrating this PR, then recheck the resulting head. ## Sources - [RELRO conversion at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/79a91f942c741b17e74ca52c8176d05eb35d2ff1/core/relinker/relinker/src/parsing/ElfReader.cpp#L149-L181) - [Multiple-range guard and regressions at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/79a91f942c741b17e74ca52c8176d05eb35d2ff1/core/relinker/elfpatcher/src/general/ProgramHeaderLayoutBuilder.cpp#L152-L158) - [Declared dependency on #10518 at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/79a91f942c741b17e74ca52c8176d05eb35d2ff1/.github/pull_request_template.md) ## Not verified No local build/CTest, Windows test reproduction, macOS test, or physical-console behavior. Hosted macOS relinker jobs were pending at the last check. The author-reported WSL2 and Windows results were not independently reproduced.
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!10662
No description provided.