summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHiroaki Etoh <etoh@cvs.openbsd.org>2003-10-07 01:24:34 +0000
committerHiroaki Etoh <etoh@cvs.openbsd.org>2003-10-07 01:24:34 +0000
commit79c11d46cba32a2fce5716f6b0d1f67a3f6ea6d4 (patch)
tree2392ff2e9c35d23aa73c1f311822d7e37c47b0e8
parentca3e12c1aa13c1a3b73dbe10be50936d1898fc2c (diff)
toplev.c, flags.h: add -fstack-protector-all option to generate protection instruments for every functions.
ok pvalchev@
-rw-r--r--gnu/egcs/gcc/flags.h1
-rw-r--r--gnu/egcs/gcc/toplev.c7
2 files changed, 6 insertions, 2 deletions
diff --git a/gnu/egcs/gcc/flags.h b/gnu/egcs/gcc/flags.h
index 24ef2a1a80c..bc1c5690f3d 100644
--- a/gnu/egcs/gcc/flags.h
+++ b/gnu/egcs/gcc/flags.h
@@ -542,6 +542,7 @@ extern int flag_no_ident;
/* Nonzero means use propolice as a stack protection method */
extern int flag_propolice_protection;
+extern int flag_stack_protection;
/* Warn when not issuing stack smashing protection for some reason */
diff --git a/gnu/egcs/gcc/toplev.c b/gnu/egcs/gcc/toplev.c
index 6d50bd7b6e9..bbe46849d94 100644
--- a/gnu/egcs/gcc/toplev.c
+++ b/gnu/egcs/gcc/toplev.c
@@ -779,8 +779,10 @@ int flag_no_ident = 0;
#if defined(STACK_PROTECTOR) && defined(STACK_GROWS_DOWNWARD)
/* Nonzero means use propolice as a stack protection method */
int flag_propolice_protection = 1;
+int flag_stack_protection = 0;
#else
int flag_propolice_protection = 0;
+int flag_stack_protection = 0;
#endif
/* Table of supported debugging formats. */
@@ -993,8 +995,8 @@ lang_independent_options f_options[] =
"Process #ident directives"},
{"stack-protector", &flag_propolice_protection, 1,
"Enables stack protection" },
- {"no-stack-protector", &flag_propolice_protection, 0,
- "Disables stack protection" },
+ {"stack-protector-all", &flag_stack_protection, 1,
+ "Enables stack protection of every function" },
};
#define NUM_ELEM(a) (sizeof (a) / sizeof ((a)[0]))
@@ -3669,6 +3671,7 @@ rest_of_compilation (decl)
insns = get_insns ();
+ flag_propolice_protection |= flag_stack_protection;
if (flag_propolice_protection) prepare_stack_protection (inlinable);
/* Dump the rtl code if we are dumping rtl. */