fix(relinker): decode XOP instructions #2568
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2568"
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 oneandonlydean on 2026-10-10T06:27:42Z.
Carrying @AchrafReyani's fix for #2559 while PR intake is paused. The commit is theirs, unchanged (cherry-picked from
AchrafReyani/AnyPS5:fix/relinker-decode-xop, 2253d53d8a).What
The x86 decoder now recognises the XOP escape (
8Fwith a map-select field of 8 or above) and decodes those instructions instead of reading8F E8 ..asPOP r/m.Why
Fixes #2559. Since #2238 (
ba525633, "root code addresses taken by RIP-relative LEA"), code reached through RIP-relativeleais decoded, and some of it uses AMD XOP instructions. Decoded asPOP, they put instruction boundaries in the wrong place, and the Windows conversion of three homebrew titles fails withCode analysis: overlapping instruction boundaries(PPSA74126, PPSA99082, PPSA99420). The Linux output was unaffected. Bisected toba525633in the issue.Tested
bc40a6b5(fork run 38027642514): Linux passes, the relinker passes on Linux, Windows and macOS, and Windows passes 606/606.Amd64OnlyConverterTestscovers the XOP decode.tools/check_conventions.pypasses.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)