diff options
author | Josh Magee <joshua_magee@playstation.sony.com> | 2014-02-01 01:36:16 +0000 |
---|---|---|
committer | Josh Magee <joshua_magee@playstation.sony.com> | 2014-02-01 01:36:16 +0000 |
commit | cde5c26c465d9831546896aa5f2e81358ae05e6c (patch) | |
tree | 50f646096ce637650f1178a128b4058856823db7 /docs | |
parent | 8a24e835504105efdf6d882053d5da7b0e1dccd3 (diff) | |
download | llvm-cde5c26c465d9831546896aa5f2e81358ae05e6c.tar.gz llvm-cde5c26c465d9831546896aa5f2e81358ae05e6c.tar.bz2 llvm-cde5c26c465d9831546896aa5f2e81358ae05e6c.tar.xz |
[stackprotector] Implement the sspstrong rules for stack layout.
This changes the PrologueEpilogInserter and LocalStackSlotAllocation passes to
follow the extended stack layout rules for sspstrong and sspreq.
The sspstrong layout rules are:
1. Large arrays and structures containing large arrays (>= ssp-buffer-size)
are closest to the stack protector.
2. Small arrays and structures containing small arrays (< ssp-buffer-size) are
2nd closest to the protector.
3. Variables that have had their address taken are 3rd closest to the
protector.
Differential Revision: http://llvm-reviews.chandlerc.com/D2546
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200601 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'docs')
-rw-r--r-- | docs/LangRef.rst | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/docs/LangRef.rst b/docs/LangRef.rst index 07e94a9f84..e1880f2bc1 100644 --- a/docs/LangRef.rst +++ b/docs/LangRef.rst @@ -1112,6 +1112,9 @@ example: - Calls to alloca() with variable sizes or constant sizes greater than ``ssp-buffer-size``. + Variables that are identified as requiring a protector will be arranged + on the stack such that they are adjacent to the stack protector guard. + If a function that has an ``ssp`` attribute is inlined into a function that doesn't have an ``ssp`` attribute, then the resulting function will have an ``ssp`` attribute. @@ -1120,6 +1123,17 @@ example: stack smashing protector. This overrides the ``ssp`` function attribute. + Variables that are identified as requiring a protector will be arranged + on the stack such that they are adjacent to the stack protector guard. + The specific layout rules are: + + #. Large arrays and structures containing large arrays + (``>= ssp-buffer-size``) are closest to the stack protector. + #. Small arrays and structures containing small arrays + (``< ssp-buffer-size``) are 2nd closest to the protector. + #. Variables that have had their address taken are 3rd closest to the + protector. + If a function that has an ``sspreq`` attribute is inlined into a function that doesn't have an ``sspreq`` attribute or which has an ``ssp`` or ``sspstrong`` attribute, then the resulting function will have @@ -1135,6 +1149,17 @@ example: - Calls to alloca(). - Local variables that have had their address taken. + Variables that are identified as requiring a protector will be arranged + on the stack such that they are adjacent to the stack protector guard. + The specific layout rules are: + + #. Large arrays and structures containing large arrays + (``>= ssp-buffer-size``) are closest to the stack protector. + #. Small arrays and structures containing small arrays + (``< ssp-buffer-size``) are 2nd closest to the protector. + #. Variables that have had their address taken are 3rd closest to the + protector. + This overrides the ``ssp`` function attribute. If a function that has an ``sspstrong`` attribute is inlined into a |