This is an archive of the discontinued LLVM Phabricator instance.

[XRay][compiler-rt][x86_64] Align the stack before and after calling handlers
ClosedPublic

Authored by dberris on Nov 13 2017, 11:34 PM.

Details

Summary

This change fixes the XRay trampolines aside from the __xray_CustomEvent
trampoline to align the stack to 16-byte boundaries before calling the
handler. Before this change we've not been explicitly aligning the stack
to 16-byte boundaries, which makes it dangerous when calling handlers
that leave the stack in a state that isn't strictly 16-byte aligned
after calling the handlers.

We add a test that makes sure we can handle these cases appropriately
after the changes, and prevents us from regressing the state moving
forward.

Fixes http://llvm.org/PR35294.

Diff Detail

Repository
rL LLVM

Event Timeline

dberris created this revision.Nov 13 2017, 11:34 PM
pcc accepted this revision.Nov 14 2017, 6:39 PM

LGTM

This revision is now accepted and ready to land.Nov 14 2017, 6:39 PM
This revision was automatically updated to reflect the committed changes.