diff options
author | Bill Wendling <isanbard@gmail.com> | 2013-01-23 06:43:53 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2013-01-23 06:43:53 +0000 |
commit | 7c8f96a91b9edde97ccd0dfaaa04e5bb04e308c6 (patch) | |
tree | cfdb4e8d8c3fe11238e870ae1db1283750d253db /llvm/docs | |
parent | d154e283f28525a5fcfb063d4b527bb9a68a8608 (diff) | |
download | bcm5719-llvm-7c8f96a91b9edde97ccd0dfaaa04e5bb04e308c6.tar.gz bcm5719-llvm-7c8f96a91b9edde97ccd0dfaaa04e5bb04e308c6.zip |
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.)
llvm-svn: 173231
Diffstat (limited to 'llvm/docs')
-rw-r--r-- | llvm/docs/LangRef.rst | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst index 1a854695501..4fd4c3ee274 100644 --- a/llvm/docs/LangRef.rst +++ b/llvm/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 |