feat(relinker): trap exact SDK syscall stubs on request #3804
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3804"
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 MarcZX10 on 2026-10-11T16:54:43Z.
What
Add an opt-in
--trap-sdk-syscall-stubsmode for the exact numbered and generic syscall wrapper byte patterns used by ps5-payload-dev SDK libc. In executable segments and bundled guest modules, the mode replaces only each recognizedsyscallinstruction withUD2. All unrecognized syscall instructions remain relink errors, and the existing default scanner remains strict. The option cannot be combined with--skip-syscall-check.This lets unused SDK wrappers pass relinking while preserving a runtime illegal-instruction failure if one is reached. It does not implement FreeBSD syscalls. The mode is documented as debugging-only.
Resolves #2136.
Tested
python3 tools/check_conventions.py --base upstream/mainpassed;git diff --checkpassed.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 repositoryImported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T22:05:34Z.
Checked build and the relinker ctest suite (102/102) on the PR merged onto main; the new CLI, scanner and guest-module trap tests fail without the change. Unknown syscalls still fail, the default scanner is unchanged, patches go through
result.Patchesand are bounds-checked. Merging.