diff options
| author | Peter Collingbourne <peter@pcc.me.uk> | 2018-04-04 21:55:44 +0000 |
|---|---|---|
| committer | Peter Collingbourne <peter@pcc.me.uk> | 2018-04-04 21:55:44 +0000 |
| commit | deddcb8899c7e7657cc79a0e96e3a532638769c7 (patch) | |
| tree | 8b07cfbb1bcf8d7c8dad70d7787a539aa3eec51e /lib/Driver/ToolChain.cpp | |
| parent | af0e708bd214e13b22da1ce3006b52b4f18056bc (diff) | |
| download | clang-deddcb8899c7e7657cc79a0e96e3a532638769c7.tar.gz | |
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
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@329236 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/ToolChain.cpp')
| -rw-r--r-- | lib/Driver/ToolChain.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Driver/ToolChain.cpp b/lib/Driver/ToolChain.cpp index 23d6503d33..bf97557bd6 100644 --- a/lib/Driver/ToolChain.cpp +++ b/lib/Driver/ToolChain.cpp @@ -814,7 +814,8 @@ SanitizerMask ToolChain::getSupportedSanitizers() const { getTriple().getArch() == llvm::Triple::wasm32 || getTriple().getArch() == llvm::Triple::wasm64) Res |= CFIICall; - if (getTriple().getArch() == llvm::Triple::x86_64) + if (getTriple().getArch() == llvm::Triple::x86_64 || + getTriple().getArch() == llvm::Triple::aarch64) Res |= ShadowCallStack; return Res; } |
