refactor(relinker): remove relocation types validation already rejects #10357
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/10357"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by roboterspinne on 2026-10-23T19:08:39Z.
What
Follow-up to #9220.
ValidationPolicyrejectsR_X86_64_GOT32,PLT32,GOTPCREL,32S,GOTPCRELXandREX_GOTPCRELXfor everyDT_RELAandDT_JMPRELentry (RelinkerPipeline.cpp:349) before the Linux patcher runs, and every other writer of those tables emits only types the allowlist accepts. TheR_X86_64_32Scase of the fixed-base relocation list inLinuxElfPatcher.cpptherefore cannot be reached. It was the only user ofR_X86_64_32S, and the other five constants inElfConstants.hpphave none. This removes the case and the six constants. No behaviour changes: 32S is still rejected withUnsupported relocation type 0xb, astest_linux_fixed_base.pyandtest_executable_tls_relocations.pycheck.R_X86_64_IRELATIVEand the default throw of that list stay; this only removes what #9220 dropped from validation.Tested
Ubuntu 24.04 x86_64, relinker-only Release build (
-DANYPS5_RELINKER_ONLY=ON -DBUILD_TESTING=ON); synthetic fixtures only, no title or homebrew.ctest --test-dir build-relinker: 240/240 passed, as onmain.test_executable_tls_relocations.pyfixture with every relocation type 0-63 inDT_RELAand inDT_JMPREL, against the null symbol, a defined TLS symbol, a TLS import and a function import, in the default mode (fixed base 0x400000) and with--lazy-binding: exit codes, error messages and outputs are identical with and without this change. No input reachescannot be placed at a fixed Linux base, and no output holds type 11.git grepfinds no other use of the six constants.python3 tools/check_conventions.py --base upstream/mainwith this title and description passed.python3 tools/pr_overlap.py --repo boykopovar/AnyPS5 --branch claude/new-session-2p8mgt: no overlap with open pull requests.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-23T19:18:40Z.
Review: APPROVED
This removes only relocation constants and the unreachable
R_X86_64_32Sarm fromRebasedRelocations. The PR traces the validation paths that reject the relevant types before this writer and includes fixture checks that the rejected32Sdiagnostic/output remain unchanged. The diff is appropriately narrow; hosted conventions, eligibility, intake, labels and Linux/Windows/macOS relinker plus ASan checks all pass. I did not rerun the relinker suite locally. I found no blocking issue.