This is an archive of the discontinued LLVM Phabricator instance.

[compiler rt] Win64 GetInstructionSize additional register MOV + stack alignment AND
ClosedPublic

Authored by mcgov on Jan 28 2019, 9:54 AM.

Details

Summary

Current interception code does not cover all of the required registers on Windows for a specific flavor of MOV, so this patch adds cases to identify the following 5-byte instructions on 64-bit Windows:

mov QWORD PTR [rsp + XX], rdx <- second integer argument
mov QWORD PTR [rsp + XX], r9 <- third integer argument
mov QWORD PTR [rsp + XX], r8 <- fourth integer argument

The instruction for MOV [...] RCX is already covered in the previous version.

Diff Detail

Repository
rL LLVM

Event Timeline

mcgov created this revision.Jan 28 2019, 9:54 AM
Herald added subscribers: Restricted Project, llvm-commits. · View Herald TranscriptJan 28 2019, 9:54 AM
mcgov updated this revision to Diff 184635.Jan 31 2019, 3:26 PM

Added stack alignment instruction which is common on msvc /Od executables

mcgov retitled this revision from [compiler rt] Win64 abi requires additional registers for integer arguments to [compiler rt] Win64 GetInstructionSize additional register MOV + stack alignment AND.Jan 31 2019, 3:36 PM
rnk accepted this revision.Feb 1 2019, 2:52 PM

lgtm

Honestly, I don't really feel the need to add an interceptor test for this encoding. It's just testing that we've put the bytes in two places.

This revision is now accepted and ready to land.Feb 1 2019, 2:52 PM
mcgov updated this revision to Diff 185863.Feb 7 2019, 1:51 PM

Added tests for interception of new functions (just in case).

Herald added a project: Restricted Project. · View Herald TranscriptFeb 7 2019, 1:51 PM
mcgov accepted this revision.Feb 7 2019, 1:52 PM
This revision was automatically updated to reflect the committed changes.