fix(relinker): reject executable relocations against defined local, hidden or internal symbols #14370

Merged
roboterspinne merged 2 commits from upstream-pr/14370 into main 2026-11-14 03:54:36 +00:00
roboterspinne commented 2026-11-01 10:42:52 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by roboterspinne on 2026-11-01T10:42:52Z.


What

On 26fa1212b8 (line numbers below refer to it) an R_X86_64_64, R_X86_64_GLOB_DAT or R_X86_64_JUMP_SLOT relocation in the main executable against a symbol that the executable itself defines with STB_LOCAL binding or STV_HIDDEN or STV_INTERNAL visibility is converted into an import of that name from a library. extractRela checks the visibility of undefined symbols (RelinkerPipeline.cpp:426, from #11925) but turns every other named, non-TLS reference into a NidReference without looking at st_shndx or the binding, and SysVDynamicSectionBuilder.cpp:151 and :161 write each one as an undefined STV_DEFAULT symbol with st_shndx 0. The definition is dropped: for a GLOB_DAT against a defined local or hidden STT_FUNC symbol, the Linux output's .dynsym holds only symbol with st_shndx 0, so the host loader binds the slot to whatever library exports the name, while for a default or protected definition it also keeps the export (st_shndx 1, 0x400200). The Windows output loads the name from a library at start, and the macOS output takes the same import path. Linux, --lazy-binding, --windows and --macos all convert such input with exit 0. The ELF gABI symbol table (binding and visibility) says that a local symbol is not visible outside its object and that a hidden or internal symbol is not visible to other components, so such a reference binds to the definition in the same component, as the psABI's S for these relocation types assumes. The guest path already does that: WindowsGuestModuleWriter.cpp:68-70 writes the module's own relocated st_value for a defined symbol, and the guest defined-hidden case of test_restricted_undefined_symbols.py is accepted. The executable path has no such resolution, and WindowsRelocationBuilder.cpp:66-67 (Defined symbols require explicit relocation support) shows that the import builders are not meant to receive a defined symbol, but that check is never reached because the SysV builder has already made every symbol undefined. #11925 states that "Defined hidden symbols, ordinary global/weak imports and unreferenced symbol entries remain accepted."; the defined hidden case was tested on the guest branch only, and its executable cases have no defined symbol. Binding the slot to the executable's own definition, as closed #5229 proposed, is not implemented here; this PR refuses the input instead of converting it into a wrong binding, in the same family as #11925, #11881 and #11367.

  • Rule. After the unnamed-symbol check, extractRela throws Relocation names a defined symbol that is local, hidden or internal: <name> at the symbol entry's offset when st_shndx is not SHN_UNDEF and the binding is STB_LOCAL or the visibility is STV_INTERNAL or STV_HIDDEN. It covers every relocation that reaches the import list, on every target, and runs before NID filtering, so unused-filter levels refuse as well. Global and weak definitions with default or protected visibility are unchanged; the Linux output keeps their export, and the executable comes first in the lookup scope. Section symbols keep the Unnamed import symbol is not a null symbol entry message, because the new check comes after that one. The gap is recorded in docs/dev/debt/relinker.md, next to the null-symbol entry. 14 retail executables checked for #5229 have no such relocation, so no title changes.
  • Tests. test_restricted_undefined_symbols.py gives the executable fixture a defined option (st_shndx 1, st_value 0x200 inside its PT_LOAD) and adds six executable cases per relocation type (1, 6, 7) and target (Linux, --lazy-binding, --windows, --macos): defined-default and defined-protected convert, while defined-local, defined-internal, defined-hidden and defined-hidden-filtered (unused-filter=1) fail with exit 2 and the new message, write neither the output nor app0, and leave the input unchanged. The expected message is now passed per case. The existing cases and the guest cases are unchanged.
  • Overlap. pr_overlap.py --branch finds no shared lines with the open pull requests it can compare and cannot compare twelve that do not merge with its base: #10861, which also changes RelinkerPipeline.cpp, and #5021, #10518, #11628, #11661, #11689, #11698, #11991, #12678, #12910, #14107 and #14212, which share only docs/dev/debt/relinker.md. Checked by hand: a trial merge of this branch with each of the first eleven conflicts only in the files that 26fa1212b8 with it already conflicts in, and RelinkerPipeline.cpp merges cleanly with #10861; #14212 puts a blank line between debt entries; it already conflicts with 26fa1212b8 in 31 other debt files but not in docs/dev/debt/relinker.md, and with this branch it also conflicts there, only at the one entry this PR adds, so whichever lands second needs a one-line rebase. My open #12341 and #13862 (RelinkerPipeline.cpp) and #11487 and #11883 (docs/dev/debt/relinker.md) merge with this branch without conflict.

Tested

Windows 11, WinLibs GCC 15.2.0, relinker-only build (cmake -S . -B build-relinker -G Ninja -DCMAKE_BUILD_TYPE=Release -DANYPS5_RELINKER_ONLY=ON -DBUILD_TESTING=ON, cmake --build build-relinker --parallel 6) on 26fa1212b8 and on this branch:

  • Counter-check: with the new test file and the untouched pipeline of 26fa1212b8, ctest --test-dir build-relinker -R restricted_undefined_symbols --output-on-failure fails restricted_undefined_symbols_executable_1, _6 and _7, each with AssertionError: ('<type>-linux-False-defined-local', [], 0, 'Converting input.elf ... Conversion complete ...', ''), after defined-default and defined-protected converted; the three guest partitions pass. A probe with the same fixtures converts every local, internal, hidden, default and protected case for types 1, 6 and 7 with exit 0 on Linux, --lazy-binding, --windows and --macos.
  • On this branch the same command passes all six partitions (executable 1.9 s, 0.9 s and 1.1 s, guest 2.0 to 2.4 s); each executable partition reports Restricted undefined symbol tests passed: 56 conversions (executable), up from 32. The probe now gives exit 2 for every local, internal and hidden case and exit 0 for every default and protected case.
  • ctest --test-dir build-relinker -j 6: 552 tests, 546 passed, long_paths skipped; annotate_module, which tests tools/annotate_module.py and does not run the relinker, timed out under the parallel load and passes alone in 14.0 s; select_tests and its three parts select_tests_SelectGraphStateTests, select_tests_SelectBuildTests and select_tests_SelectArgumentTests fail with the Windows symlink fixture's FileExistsError, as on main on this machine; this change touches nothing under tools/.
  • Follow-up commit e4bf9457c5 changes only the message text and DEFINED_ERROR: with the updated test file and the relinker built from e3db043f72, restricted_undefined_symbols_executable_1, _6 and _7 fail with an AssertionError whose stderr contains FAIL: Relocation names a locally bound defined symbol: symbol (offset 0x638); with e4bf9457c5, ctest --test-dir build-relinker -R 'restricted_undefined_symbols|executable_tls_relocations|call_registry|unused_filter' --output-on-failure passes 11 of 11, again with 56 conversions per executable partition and 48 per guest partition. The full ctest -j 6, the timings and the probe above ran on e3db043f72; no other file in the repository contains the old text.
  • python tools/check_conventions.py --base 26fa1212b8 with this title and description passed.

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 (Claude Code)
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5106581879 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14370). Originally posted by [roboterspinne](https://github.com/roboterspinne) on 2026-11-01T10:42:52Z. --- ### What On 26fa1212b8 (line numbers below refer to it) an `R_X86_64_64`, `R_X86_64_GLOB_DAT` or `R_X86_64_JUMP_SLOT` relocation in the main executable against a symbol that the executable itself defines with `STB_LOCAL` binding or `STV_HIDDEN` or `STV_INTERNAL` visibility is converted into an import of that name from a library. `extractRela` checks the visibility of undefined symbols (`RelinkerPipeline.cpp:426`, from #11925) but turns every other named, non-TLS reference into a `NidReference` without looking at `st_shndx` or the binding, and `SysVDynamicSectionBuilder.cpp:151` and `:161` write each one as an undefined `STV_DEFAULT` symbol with `st_shndx` 0. The definition is dropped: for a `GLOB_DAT` against a defined local or hidden `STT_FUNC` symbol, the Linux output's `.dynsym` holds only `symbol` with `st_shndx` 0, so the host loader binds the slot to whatever library exports the name, while for a default or protected definition it also keeps the export (`st_shndx` 1, 0x400200). The Windows output loads the name from a library at start, and the macOS output takes the same import path. Linux, `--lazy-binding`, `--windows` and `--macos` all convert such input with exit 0. The [ELF gABI symbol table](https://www.sco.com/developers/gabi/latest/ch4.symtab.html) (binding and visibility) says that a local symbol is not visible outside its object and that a hidden or internal symbol is not visible to other components, so such a reference binds to the definition in the same component, as the psABI's `S` for these relocation types assumes. The guest path already does that: `WindowsGuestModuleWriter.cpp:68-70` writes the module's own relocated `st_value` for a defined symbol, and the guest `defined-hidden` case of `test_restricted_undefined_symbols.py` is accepted. The executable path has no such resolution, and `WindowsRelocationBuilder.cpp:66-67` (`Defined symbols require explicit relocation support`) shows that the import builders are not meant to receive a defined symbol, but that check is never reached because the SysV builder has already made every symbol undefined. #11925 states that "Defined hidden symbols, ordinary global/weak imports and unreferenced symbol entries remain accepted."; the defined hidden case was tested on the guest branch only, and its executable cases have no defined symbol. Binding the slot to the executable's own definition, as closed #5229 proposed, is not implemented here; this PR refuses the input instead of converting it into a wrong binding, in the same family as #11925, #11881 and #11367. - **Rule.** After the unnamed-symbol check, `extractRela` throws `Relocation names a defined symbol that is local, hidden or internal: <name>` at the symbol entry's offset when `st_shndx` is not `SHN_UNDEF` and the binding is `STB_LOCAL` or the visibility is `STV_INTERNAL` or `STV_HIDDEN`. It covers every relocation that reaches the import list, on every target, and runs before NID filtering, so `unused-filter` levels refuse as well. Global and weak definitions with default or protected visibility are unchanged; the Linux output keeps their export, and the executable comes first in the lookup scope. Section symbols keep the `Unnamed import symbol is not a null symbol entry` message, because the new check comes after that one. The gap is recorded in `docs/dev/debt/relinker.md`, next to the null-symbol entry. 14 retail executables checked for #5229 have no such relocation, so no title changes. - **Tests.** `test_restricted_undefined_symbols.py` gives the executable fixture a `defined` option (`st_shndx` 1, `st_value` 0x200 inside its `PT_LOAD`) and adds six executable cases per relocation type (1, 6, 7) and target (Linux, `--lazy-binding`, `--windows`, `--macos`): `defined-default` and `defined-protected` convert, while `defined-local`, `defined-internal`, `defined-hidden` and `defined-hidden-filtered` (`unused-filter=1`) fail with exit 2 and the new message, write neither the output nor `app0`, and leave the input unchanged. The expected message is now passed per case. The existing cases and the guest cases are unchanged. - **Overlap.** `pr_overlap.py --branch` finds no shared lines with the open pull requests it can compare and cannot compare twelve that do not merge with its base: #10861, which also changes `RelinkerPipeline.cpp`, and #5021, #10518, #11628, #11661, #11689, #11698, #11991, #12678, #12910, #14107 and #14212, which share only `docs/dev/debt/relinker.md`. Checked by hand: a trial merge of this branch with each of the first eleven conflicts only in the files that 26fa1212b8 with it already conflicts in, and `RelinkerPipeline.cpp` merges cleanly with #10861; #14212 puts a blank line between debt entries; it already conflicts with 26fa1212b8 in 31 other debt files but not in `docs/dev/debt/relinker.md`, and with this branch it also conflicts there, only at the one entry this PR adds, so whichever lands second needs a one-line rebase. My open #12341 and #13862 (`RelinkerPipeline.cpp`) and #11487 and #11883 (`docs/dev/debt/relinker.md`) merge with this branch without conflict. ### 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 11, WinLibs GCC 15.2.0, relinker-only build (`cmake -S . -B build-relinker -G Ninja -DCMAKE_BUILD_TYPE=Release -DANYPS5_RELINKER_ONLY=ON -DBUILD_TESTING=ON`, `cmake --build build-relinker --parallel 6`) on 26fa1212b8 and on this branch: - Counter-check: with the new test file and the untouched pipeline of 26fa1212b8, `ctest --test-dir build-relinker -R restricted_undefined_symbols --output-on-failure` fails `restricted_undefined_symbols_executable_1`, `_6` and `_7`, each with `AssertionError: ('<type>-linux-False-defined-local', [], 0, 'Converting input.elf ... Conversion complete ...', '')`, after `defined-default` and `defined-protected` converted; the three guest partitions pass. A probe with the same fixtures converts every local, internal, hidden, default and protected case for types 1, 6 and 7 with exit 0 on Linux, `--lazy-binding`, `--windows` and `--macos`. - On this branch the same command passes all six partitions (executable 1.9 s, 0.9 s and 1.1 s, guest 2.0 to 2.4 s); each executable partition reports `Restricted undefined symbol tests passed: 56 conversions (executable)`, up from 32. The probe now gives exit 2 for every local, internal and hidden case and exit 0 for every default and protected case. - `ctest --test-dir build-relinker -j 6`: 552 tests, 546 passed, `long_paths` skipped; `annotate_module`, which tests `tools/annotate_module.py` and does not run the relinker, timed out under the parallel load and passes alone in 14.0 s; `select_tests` and its three parts `select_tests_SelectGraphStateTests`, `select_tests_SelectBuildTests` and `select_tests_SelectArgumentTests` fail with the Windows symlink fixture's `FileExistsError`, as on `main` on this machine; this change touches nothing under `tools/`. - Follow-up commit e4bf9457c5 changes only the message text and `DEFINED_ERROR`: with the updated test file and the relinker built from e3db043f72, `restricted_undefined_symbols_executable_1`, `_6` and `_7` fail with an `AssertionError` whose stderr contains `FAIL: Relocation names a locally bound defined symbol: symbol (offset 0x638)`; with e4bf9457c5, `ctest --test-dir build-relinker -R 'restricted_undefined_symbols|executable_tls_relocations|call_registry|unused_filter' --output-on-failure` passes 11 of 11, again with 56 conversions per executable partition and 48 per guest partition. The full `ctest -j 6`, the timings and the probe above ran on e3db043f72; no other file in the repository contains the old text. - `python tools/check_conventions.py --base 26fa1212b8` with this title and description passed. ### 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: <!-- #PR, or none --> none - [x] Fixes: <!-- issue it closes as Fixes #N, or none --> none - [x] Unblocks: <!-- title ID and Game bring-up discussion, e.g. PPSA01325 #3232, or none --> none - [x] GPUs tested: <!-- for AGC, shader recompiler or VideoOut changes: vendor, model, driver and OS of each GPU the GPU tests ran on; otherwise n/a --> n/a - [x] AI-assisted: <!-- yes / no --> yes (Claude Code)
MarcZX10 commented 2026-11-01 11:14:18 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-01T11:14:18Z.

Review: COMMENTED


Reviewed — no blocking findings

The change adds one conversion-time check to the main-executable relocation scan, which rejects a relocation against a symbol the executable defines with local binding or hidden or internal visibility, and I found no defect in it, but its error text says "locally bound" for symbols that are global with hidden or internal visibility.

What I ran

Exact head e3db043f72493756011f1197ff8a19d4c7366159, PR base e6f57307fa7f47165d7fc1bee945abdb2f6816e7. Environment: Debian 12, Python 3.11.2, git 2.39.5. No build and no relinker test was run locally.

python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14370
python3 tools/pr_test_quality.py --root <new directory with git archive of the head> --json core/relinker/relinker/tests/test_restricted_undefined_symbols.py

I also read the head version of RelinkerPipeline.cpp (extractRela, lines 377-442) and the hosted log of the Windows relinker job. The precheck's test-quality helper could not find its script in its isolated head tree, so I ran it by hand as listed.

Results

Check Result
git diff --check (precheck) Passed.
Conventions and PR template (precheck) Passed.
Python syntax, test registration (precheck) Passed.
Live stack and merge preview (precheck) Clean.
pr_test_quality.py (by hand) No findings for test_restricted_undefined_symbols.py.
Hosted relinker, ubuntu-latest, g++ Passed.
Hosted relinker-asan Passed.
Hosted relinker, windows-latest, g++ Failed on one CTest, web_release, which hit its 20 s timeout. All restricted_undefined_symbols_executable_* and restricted_undefined_symbols_guest_* tests that ran in that job passed.
Hosted relinker, macOS (two jobs) Queued at the time of the precheck snapshot.
Build and relinker tests run locally Not run.
Unedited output from the Windows relinker job
99% tests passed, 1 tests failed out of 557
The following tests FAILED:
	110 - web_release (Timeout)
Errors while running CTest
##[error]Process completed with exit code 8.

Findings

Blocking: None.

Non-blocking:

  • The new check fires when st_shndx is defined and either the binding is local or st_other & 3 is 1 (internal) or 2 (hidden). The message text, "Relocation names a locally bound defined symbol", is accurate only for the local-binding case. For a global symbol with hidden or internal visibility it reads as if the binding were local. Suggested wording: "Relocation names a defined symbol with local binding or hidden or internal visibility: ". The DEFINED_ERROR constant at test_restricted_undefined_symbols.py line 14 would need the same change.

Sources

Not verified

  • The relinker tests were not built or run here. The Linux and Windows results above come from the hosted logs, not from a local run, and the macOS jobs were still queued at the precheck snapshot.
  • The web_release timeout is in a different test and I did not investigate it further.
  • Whether any real title has an executable relocation against such a symbol, and so would convert today and fail after this change, is not known to me. The debt entry says that no such title is known.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5727788728 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14370#pullrequestreview-5727788728). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-01T11:14:18Z. **Review:** COMMENTED --- # Reviewed — no blocking findings The change adds one conversion-time check to the main-executable relocation scan, which rejects a relocation against a symbol the executable defines with local binding or hidden or internal visibility, and I found no defect in it, but its error text says "locally bound" for symbols that are global with hidden or internal visibility. ## What I ran Exact head `e3db043f72493756011f1197ff8a19d4c7366159`, PR base `e6f57307fa7f47165d7fc1bee945abdb2f6816e7`. Environment: Debian 12, Python 3.11.2, git 2.39.5. No build and no relinker test was run locally. ```sh python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14370 python3 tools/pr_test_quality.py --root <new directory with git archive of the head> --json core/relinker/relinker/tests/test_restricted_undefined_symbols.py ``` I also read the head version of `RelinkerPipeline.cpp` (`extractRela`, lines 377-442) and the hosted log of the Windows relinker job. The precheck's test-quality helper could not find its script in its isolated head tree, so I ran it by hand as listed. ## Results | Check | Result | |---|---| | `git diff --check` (precheck) | Passed. | | Conventions and PR template (precheck) | Passed. | | Python syntax, test registration (precheck) | Passed. | | Live stack and merge preview (precheck) | Clean. | | `pr_test_quality.py` (by hand) | No findings for `test_restricted_undefined_symbols.py`. | | Hosted relinker, ubuntu-latest, g++ | Passed. | | Hosted relinker-asan | Passed. | | Hosted relinker, windows-latest, g++ | Failed on one CTest, `web_release`, which hit its 20 s timeout. All `restricted_undefined_symbols_executable_*` and `restricted_undefined_symbols_guest_*` tests that ran in that job passed. | | Hosted relinker, macOS (two jobs) | Queued at the time of the precheck snapshot. | | Build and relinker tests run locally | Not run. | <details><summary>Unedited output from the Windows relinker job</summary> ```text 99% tests passed, 1 tests failed out of 557 The following tests FAILED: 110 - web_release (Timeout) Errors while running CTest ##[error]Process completed with exit code 8. ``` </details> ## Findings **Blocking:** None. **Non-blocking:** - The new check fires when `st_shndx` is defined and either the binding is local or `st_other & 3` is 1 (internal) or 2 (hidden). The message text, "Relocation names a locally bound defined symbol", is accurate only for the local-binding case. For a global symbol with hidden or internal visibility it reads as if the binding were local. Suggested wording: "Relocation names a defined symbol with local binding or hidden or internal visibility: ". The `DEFINED_ERROR` constant at `test_restricted_undefined_symbols.py` line 14 would need the same change. ## Sources - [New check in `extractRela` at the head](https://github.com/boykopovar/AnyPS5/blob/e3db043f72493756011f1197ff8a19d4c7366159/core/relinker/relinker/src/pipeline/RelinkerPipeline.cpp#L432-L433) - [Test constant for the new message](https://github.com/boykopovar/AnyPS5/blob/e3db043f72493756011f1197ff8a19d4c7366159/core/relinker/relinker/tests/test_restricted_undefined_symbols.py#L14) - [Defined-local test case](https://github.com/boykopovar/AnyPS5/blob/e3db043f72493756011f1197ff8a19d4c7366159/core/relinker/relinker/tests/test_restricted_undefined_symbols.py#L99) ## Not verified - The relinker tests were not built or run here. The Linux and Windows results above come from the hosted logs, not from a local run, and the macOS jobs were still queued at the precheck snapshot. - The `web_release` timeout is in a different test and I did not investigate it further. - Whether any real title has an executable relocation against such a symbol, and so would convert today and fail after this change, is not known to me. The debt entry says that no such title is known.
MarcZX10 commented 2026-11-01 14:08:54 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-01T14:08:54Z.

Review: COMMENTED


Reviewed — no blocking findings

Rejecting an executable relocation against a defined symbol that is local, hidden or internal matches the ELF visibility rules and the existing undefined-symbol visibility check; the rejection is intentional and documented in the debt file.

What I ran

  • Exact head e4bf9457c50d036bfe4b5bf4798637b2142e1b7d, base e6f57307fa.
  • Environment: Linux, /usr/bin/python3 3.11.2, no build.
  • Precheck: python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14370 --output-dir /dev/shm/reviewer-run/precheck/14370
  • Test-quality helper on core/relinker/relinker/tests/test_restricted_undefined_symbols.py from a head extract: no findings.
  • Source read at head: the new check in core/relinker/relinker/src/pipeline/RelinkerPipeline.cpp near line 432, including the bit tests on st_other (& 3 equal to 1 for STV_INTERNAL, 2 for STV_HIDDEN) and the binding test (< STB_GLOBAL).

Results

Precheck report, checks table, unedited (/dev/shm/reviewer-run/precheck/14370/report.md):

Check Status Command / reason
build_and_compile not_applicable The precheck deliberately does not configure, build, or compile AnyPS5.
diff_check passed git diff --check e6f57307fa7f47165d7fc1bee945abdb2f6816e7...e4bf9457c50d036bfe4b5bf4798637b2142e1b7d
conventions_and_pr_template passed /usr/bin/python3 tools/check_conventions.py --base e6f57307fa7f47165d7fc1bee945abdb2f6816e7 --head e4bf9457c50d036bfe4b5bf4798637b2142e1b7d --title fix(relinker): reject executable relocations against defined local, hidden or internal symbols --body /dev/shm/reviewer-run/precheck/14370/pr-body.md
changed_export_abi_audit not_applicable No changed source or public header under core/libs/prx.
python_syntax passed /usr/bin/python3 -m py_compile core/relinker/relinker/tests/test_restricted_undefined_symbols.py
related_python_unit_tests not_applicable No changed tools/ module has an existing sibling tools/tests/test_<module>.py suite.
python_test_registration passed /usr/bin/python3 tools/check_test_registration.py --scripts
live_dependency_and_mergeability_check passed /usr/bin/python3 /marc/AnyPS5/tools/pr_stack_check.py 14370 --repo boykopovar/AnyPS5 --output-dir /dev/shm/reviewer-run/precheck/14370/stack
build_dependent_cpp_tests not_applicable Not run: C++ tests need exact-head binaries, which require a build; the precheck does not build.
test_quality_heuristics failed /usr/bin/python3 /dev/shm/reviewer-run/precheck/14370/head-e4bf9457c50d-1e320f6c/tools/pr_test_quality.py --root /dev/shm/reviewer-run/precheck/14370/head-e4bf9457c50d-1e320f6c --json core/relinker/relinker/src/pipeline/RelinkerPipeline.cpp core/relinker/relinker/tests/test_restricted_undefined_symbols.py docs/dev/debt/relinker.md
negative_controls not_applicable No changed Python test module in tools/ can be run as a no-build base-source control.

Negative control

Not run. The relinker test needs a built relinker binary, which the no-build policy does not allow here.

Findings

Blocking: none.

Non-blocking:

  • Inputs that previously converted with a dangling import for such a relocation now fail. That is the intended change; the debt entry should list the rejected case so that the behaviour is discoverable.

Sources

Not verified

  • The relinker test test_restricted_undefined_symbols.py was not run (needs a build).
  • Hosted: at this head the Ubuntu and Windows relinker jobs succeeded; conventions was cancelled once and eligibility and labels succeeded; linux, register-context and write-watch were skipped.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5728460160 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14370#pullrequestreview-5728460160). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-01T14:08:54Z. **Review:** COMMENTED --- # Reviewed — no blocking findings Rejecting an executable relocation against a defined symbol that is local, hidden or internal matches the ELF visibility rules and the existing undefined-symbol visibility check; the rejection is intentional and documented in the debt file. ## What I ran - Exact head `e4bf9457c50d036bfe4b5bf4798637b2142e1b7d`, base `e6f57307fa`. - Environment: Linux, `/usr/bin/python3` 3.11.2, no build. - Precheck: `python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14370 --output-dir /dev/shm/reviewer-run/precheck/14370` - Test-quality helper on `core/relinker/relinker/tests/test_restricted_undefined_symbols.py` from a head extract: no findings. - Source read at head: the new check in `core/relinker/relinker/src/pipeline/RelinkerPipeline.cpp` near line 432, including the bit tests on `st_other` (`& 3` equal to 1 for `STV_INTERNAL`, 2 for `STV_HIDDEN`) and the binding test (`< STB_GLOBAL`). ## Results Precheck report, checks table, unedited (`/dev/shm/reviewer-run/precheck/14370/report.md`): | Check | Status | Command / reason | |---|---|---| | build_and_compile | not_applicable | `The precheck deliberately does not configure, build, or compile AnyPS5.` | | diff_check | passed | `git diff --check e6f57307fa7f47165d7fc1bee945abdb2f6816e7...e4bf9457c50d036bfe4b5bf4798637b2142e1b7d` | | conventions_and_pr_template | passed | `/usr/bin/python3 tools/check_conventions.py --base e6f57307fa7f47165d7fc1bee945abdb2f6816e7 --head e4bf9457c50d036bfe4b5bf4798637b2142e1b7d --title fix(relinker): reject executable relocations against defined local, hidden or internal symbols --body /dev/shm/reviewer-run/precheck/14370/pr-body.md` | | changed_export_abi_audit | not_applicable | `No changed source or public header under core/libs/prx.` | | python_syntax | passed | `/usr/bin/python3 -m py_compile core/relinker/relinker/tests/test_restricted_undefined_symbols.py` | | related_python_unit_tests | not_applicable | `No changed tools/ module has an existing sibling tools/tests/test_<module>.py suite.` | | python_test_registration | passed | `/usr/bin/python3 tools/check_test_registration.py --scripts` | | live_dependency_and_mergeability_check | passed | `/usr/bin/python3 /marc/AnyPS5/tools/pr_stack_check.py 14370 --repo boykopovar/AnyPS5 --output-dir /dev/shm/reviewer-run/precheck/14370/stack` | | build_dependent_cpp_tests | not_applicable | `Not run: C++ tests need exact-head binaries, which require a build; the precheck does not build.` | | test_quality_heuristics | failed | `/usr/bin/python3 /dev/shm/reviewer-run/precheck/14370/head-e4bf9457c50d-1e320f6c/tools/pr_test_quality.py --root /dev/shm/reviewer-run/precheck/14370/head-e4bf9457c50d-1e320f6c --json core/relinker/relinker/src/pipeline/RelinkerPipeline.cpp core/relinker/relinker/tests/test_restricted_undefined_symbols.py docs/dev/debt/relinker.md` | | negative_controls | not_applicable | `No changed Python test module in tools/ can be run as a no-build base-source control.` | ## Negative control Not run. The relinker test needs a built relinker binary, which the no-build policy does not allow here. ## Findings **Blocking:** none. **Non-blocking:** - Inputs that previously converted with a dangling import for such a relocation now fail. That is the intended change; the debt entry should list the rejected case so that the behaviour is discoverable. ## Sources - New check at head: https://github.com/boykopovar/AnyPS5/blob/e4bf9457c50d036bfe4b5bf4798637b2142e1b7d/core/relinker/relinker/src/pipeline/RelinkerPipeline.cpp#L432-L433 ## Not verified - The relinker test `test_restricted_undefined_symbols.py` was not run (needs a build). - Hosted: at this head the Ubuntu and Windows relinker jobs succeeded; `conventions` was cancelled once and `eligibility` and `labels` succeeded; `linux`, `register-context` and `write-watch` were skipped.
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!14370
No description provided.