fix(relinker): reject input executables that are not x86-64 #3809
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3809"
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 aayushmishraaa on 2026-10-11T16:57:38Z.
What
ElfReader::ReadHeadervalidates the ELF identification bytes but note_machine. An input executable whosee_machineis not x86-64 (62) is relinked to a Linux ELF that keeps the foreign machine value and exits 0;--macosand--windowsfail later with Windows-specific messages from the patchers. Guest modules (GuestImageReader) and Windows images (WindowsLoadImage) already requiree_machine == 62.ReadHeadernow throwsExpected an x86-64 ELFafter the identification check.test_elf_header.pycoverse_machine0, 3 and 183 in its four output modes (no output or registry written), and theheader-onlycase setse_machineso it still reachesNo PT_DYNAMIC segment found.Tested
macOS (Apple Silicon, AppleClang), relinker-only build: the extended
elf_headertest fails on currentmain(machine-0relinks with exit 0) and passes with the change; all 105 relinker ctest tests pass;tools/check_conventions.py --base origin/mainpasses. Not tested with a title.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-12T11:45:48Z.
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
main)core/relinker/relinker/src/parsing/ElfReader.cppL88core/relinker/relinker/tests/test_elf_header.pyL19-21, L42