[PATCH] D40004: [XRay][compiler-rt][x86_64] Align the stack before and after calling handlers

Dean Michael Berris via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 13 23:34:42 PST 2017


dberris created this revision.

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.


https://reviews.llvm.org/D40004

Files:
  compiler-rt/lib/xray/xray_trampoline_x86_64.S
  compiler-rt/test/xray/TestCases/Linux/common-trampoline-alignment.cc

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D40004.122782.patch
Type: text/x-patch
Size: 4128 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171114/f44e834d/attachment.bin>


More information about the llvm-commits mailing list