summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2013-01-23 06:43:53 +0000
committerBill Wendling <isanbard@gmail.com>2013-01-23 06:43:53 +0000
commite4957fb9b77a4fbdf711b9e5a722d107d86ccc50 (patch)
tree7cb29431e3cd756a0e20c187026f7031fec3e61f /docs
parent114baee1fa017daefad2339c77b45b9ca3d79a41 (diff)
downloadllvm-e4957fb9b77a4fbdf711b9e5a722d107d86ccc50.tar.gz
llvm-e4957fb9b77a4fbdf711b9e5a722d107d86ccc50.tar.bz2
llvm-e4957fb9b77a4fbdf711b9e5a722d107d86ccc50.tar.xz
Add the heuristic to differentiate SSPStrong from SSPRequired.
The requirements of the strong heuristic are: * A Protector is required for functions which contain an array, regardless of type or length. * A Protector is required for functions which contain a structure/union which contains an array, regardless of type or length. Note, there is no limit to the depth of nesting. * A protector is required when the address of a local variable (i.e., stack based variable) is exposed. (E.g., such as through a local whose address is taken as part of the RHS of an assignment or a local whose address is taken as part of a function argument.) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173231 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'docs')
-rw-r--r--docs/LangRef.rst17
1 files changed, 14 insertions, 3 deletions
diff --git a/docs/LangRef.rst b/docs/LangRef.rst
index 1a85469550..4fd4c3ee27 100644
--- a/docs/LangRef.rst
+++ b/docs/LangRef.rst
@@ -825,7 +825,11 @@ example:
placed on the stack before the local variables that's checked upon
return from the function to see if it has been overwritten. A
heuristic is used to determine if a function needs stack protectors
- or not.
+ or not. The heuristic used will enable protectors for functions with:
+ - Character arrays larger than ``ssp-buffer-size`` (default 8).
+ - Aggregates containing character arrays larger than ``ssp-buffer-size``.
+ - Calls to alloca() with variable sizes or constant sizes greater than
+ ``ssp-buffer-size``.
If a function that has an ``ssp`` attribute is inlined into a
function that doesn't have an ``ssp`` attribute, then the resulting
@@ -841,8 +845,15 @@ example:
an ``sspreq`` attribute.
``sspstrong``
This attribute indicates that the function should emit a stack smashing
- protector. Currently this attribute has the same effect as
- ``sspreq``. This overrides the ``ssp`` function attribute.
+ protector. This attribute causes a strong heuristic to be used when
+ determining if a function needs stack protectors. The strong heuristic
+ will enable protectors for functions with:
+ - Arrays of any size and type
+ - Aggregates containing an array of any size and type.
+ - Calls to alloca().
+ - Local variables that have had their address taken.
+
+ This overrides the ``ssp`` function attribute.
If a function that has an ``sspstrong`` attribute is inlined into a
function that doesn't have an ``sspstrong`` attribute, then the