From 7a39ea1e6af354e0c17d4e2a88b6abbbd7c31163 Mon Sep 17 00:00:00 2001
From: wilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Sat, 13 Aug 2005 20:52:01 +0000
Subject: [PATCH] Add missing docs for feature added by Richard Henderson. *
 doc/cpp.texi (__SSP__, __SSP_ALL__): Document. * doc/invoke.texi
 (-Wstack-protector, -fstack-protector, -fstack-protector-all, --param
 ssp-buffer-size): Document. (-Wvariadic-macros): Alphabetize.
 (-fsched-stalled-insns-dep): Add missing 'f'.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@103057 138bc75d-0d04-0410-961f-82ee72b054a4
---
 gcc/ChangeLog       |  8 ++++++++
 gcc/doc/cpp.texi    |  9 +++++++++
 gcc/doc/invoke.texi | 30 ++++++++++++++++++++++++++----
 3 files changed, 43 insertions(+), 4 deletions(-)

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 1058d983437e..f6243ce294cc 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2005-08-13  James E Wilson  <wilson@specifix.com>
+
+	* doc/cpp.texi (__SSP__, __SSP_ALL__): Document.
+	* doc/invoke.texi (-Wstack-protector, -fstack-protector,
+	-fstack-protector-all, --param ssp-buffer-size): Document.
+	(-Wvariadic-macros): Alphabetize.
+	(-fsched-stalled-insns-dep): Add missing 'f'.
+
 2005-08-13  David Edelsohn  <edelsohn@gnu.org>
 
 	* config/rs6000/rs6000.h (EXTRA_CONSTRAINT): Add 'a' for indexed
diff --git a/gcc/doc/cpp.texi b/gcc/doc/cpp.texi
index e9c64078e1ad..f5f29a6397b2 100644
--- a/gcc/doc/cpp.texi
+++ b/gcc/doc/cpp.texi
@@ -2117,6 +2117,15 @@ macro to determine which runtime (NeXT or GNU) is being used.
 These macros are defined, with value 1, if (and only if) the compilation
 is for a target where @code{long int} and pointer both use 64-bits and
 @code{int} uses 32-bit.
+
+@item __SSP__
+This macro is defined, with value 1, when @option{-fstack-protector} is in
+use.
+
+@item __SSP_ALL__
+This macro is defined, with value 2, when @option{-fstack-protector-all} is
+in use.
+
 @end table
 
 @node System-specific Predefined Macros
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index a5491b0679ef..643805c136e3 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -238,13 +238,14 @@ Objective-C and Objective-C++ Dialects}.
 -Wparentheses  -Wpointer-arith  -Wno-pointer-to-int-cast @gol
 -Wredundant-decls @gol
 -Wreturn-type  -Wsequence-point  -Wshadow @gol
--Wsign-compare  -Wstrict-aliasing -Wstrict-aliasing=2 @gol
+-Wsign-compare  -Wstack-protector @gol
+-Wstrict-aliasing -Wstrict-aliasing=2 @gol
 -Wswitch  -Wswitch-default  -Wswitch-enum @gol
 -Wsystem-headers  -Wtrigraphs  -Wundef  -Wuninitialized @gol
 -Wunknown-pragmas  -Wno-pragmas -Wunreachable-code @gol
 -Wunused  -Wunused-function  -Wunused-label  -Wunused-parameter @gol
--Wunused-value  -Wunused-variable  -Wwrite-strings @gol
--Wvariadic-macros}
+-Wunused-value  -Wunused-variable  -Wvariadic-macros @gol
+-Wwrite-strings}
 
 @item C-only Warning Options
 @gccoptlist{-Wbad-function-cast  -Wmissing-declarations @gol
@@ -322,10 +323,11 @@ Objective-C and Objective-C++ Dialects}.
 -frounding-math -fschedule-insns  -fschedule-insns2 @gol
 -fno-sched-interblock  -fno-sched-spec  -fsched-spec-load @gol
 -fsched-spec-load-dangerous  @gol
--fsched-stalled-insns=@var{n} -sched-stalled-insns-dep=@var{n} @gol
+-fsched-stalled-insns=@var{n} -fsched-stalled-insns-dep=@var{n} @gol
 -fsched2-use-superblocks @gol
 -fsched2-use-traces -freschedule-modulo-scheduled-loops @gol
 -fsignaling-nans -fsingle-precision-constant  @gol
+-fstack-protector  -fstack-protector-all @gol
 -fstrength-reduce  -fstrict-aliasing  -ftracer  -fthread-jumps @gol
 -funroll-all-loops  -funroll-loops  -fpeel-loops @gol
 -fsplit-ivs-in-unroller -funswitch-loops @gol
@@ -3362,6 +3364,11 @@ This option is only supported for C and Objective-C@.
 @item -Werror
 @opindex Werror
 Make all warnings into errors.
+
+@item -Wstack-protector
+This option is only active when @option{-fstack-protector} is active.  It
+warns about functions that will not be protected against stack smashing.
+
 @end table
 
 @node Debugging Options
@@ -5628,6 +5635,17 @@ threading.
 When performing branch target register load optimization, don't reuse
 branch target registers in within any basic block.
 
+@item -fstack-protector
+Emit extra code to check for buffer overflows, such as stack smashing
+attacks.  This is done by adding a guard variable to functions with
+vulnerable objects.  This includes functions that call alloca, and
+functions with buffers larger than 8 bytes.  The guards are initialized
+when a function is entered and then checked when the function exits.
+If a guard check fails, an error message is printed and the program exits.
+
+@item -fstack-protector-all
+Like @option{-fstack-protector} except that all functions are protected.
+
 @item --param @var{name}=@var{value}
 @opindex param
 In some places, GCC uses various constants to control the amount of
@@ -6003,6 +6021,10 @@ than the number of virtual symbols to be updated, then the incremental
 SSA updater switches to a full update for those symbols.  The default
 ratio is 3.
 
+@item ssp-buffer-size
+The minimum size of buffers (i.e. arrays) that will receive stack smashing
+protection when @option{-fstack-protection} is used.
+
 @end table
 @end table
 
-- 
GitLab