diff options
author | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2016-04-11 22:27:48 +0000 |
---|---|---|
committer | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2016-04-11 22:27:48 +0000 |
commit | f17120a85ff619f2420a6b86a05bed5c5d816353 (patch) | |
tree | 2971d0e35456c1cbea475d571eb3e9bcffacbb32 /llvm/lib/CodeGen/StackProtector.cpp | |
parent | a6dea06fe3d74eb75ab58f14d7b87f068f043de0 (diff) | |
download | bcm5719-llvm-f17120a85ff619f2420a6b86a05bed5c5d816353.tar.gz bcm5719-llvm-f17120a85ff619f2420a6b86a05bed5c5d816353.zip |
[safestack] Add canary to unsafe stack frames
Add StackProtector to SafeStack. This adds limited protection against
data corruption in the caller frame. Current implementation treats
all stack protector levels as -fstack-protector-all.
llvm-svn: 266004
Diffstat (limited to 'llvm/lib/CodeGen/StackProtector.cpp')
-rw-r--r-- | llvm/lib/CodeGen/StackProtector.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/StackProtector.cpp b/llvm/lib/CodeGen/StackProtector.cpp index 3ea56d85fe5..5407c740ead 100644 --- a/llvm/lib/CodeGen/StackProtector.cpp +++ b/llvm/lib/CodeGen/StackProtector.cpp @@ -210,6 +210,9 @@ bool StackProtector::RequiresStackProtector() { Intrinsic::stackprotector)) HasPrologue = true; + if (F->hasFnAttribute(Attribute::SafeStack)) + return false; + if (F->hasFnAttribute(Attribute::StackProtectReq)) { NeedsProtector = true; Strong = true; // Use the same heuristic as strong to determine SSPLayout |