AArch64: Implement support for the shadowcallstack attribute.
authorPeter Collingbourne <peter@pcc.me.uk>
Wed, 4 Apr 2018 21:55:44 +0000 (21:55 +0000)
committerPeter Collingbourne <peter@pcc.me.uk>
Wed, 4 Apr 2018 21:55:44 +0000 (21:55 +0000)
commitf11eb3ebe77729426e562d7d4d7ebb1d5ff2e7c8
treebb02cd6d80b6bbd8c47cc5b9490b26cb24a39d81
parent4296ea72ffcef9fff5ce735dbbfeccd503200735
AArch64: Implement support for the shadowcallstack attribute.

The implementation of shadow call stack on aarch64 is quite different to
the implementation on x86_64. Instead of reserving a segment register for
the shadow call stack, we reserve the platform register, x18. Any function
that spills lr to sp also spills it to the shadow call stack, a pointer to
which is stored in x18.

Differential Revision: https://reviews.llvm.org/D45239

llvm-svn: 329236
clang/docs/ShadowCallStack.rst
clang/lib/Driver/SanitizerArgs.cpp
clang/lib/Driver/ToolChain.cpp
clang/test/Driver/sanitizer-ld.c
llvm/include/llvm/Support/TargetParser.h
llvm/lib/Support/TargetParser.cpp
llvm/lib/Target/AArch64/AArch64CallingConvention.td
llvm/lib/Target/AArch64/AArch64FrameLowering.cpp
llvm/lib/Target/AArch64/AArch64RegisterInfo.cpp
llvm/lib/Target/AArch64/AArch64Subtarget.cpp
llvm/test/CodeGen/AArch64/shadow-call-stack.ll [new file with mode: 0644]