aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.6/gcc/config/i386/i386.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.6/gcc/config/i386/i386.c')
-rw-r--r--gcc-4.6/gcc/config/i386/i386.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc-4.6/gcc/config/i386/i386.c b/gcc-4.6/gcc/config/i386/i386.c
index b99d31150..6e7eb6183 100644
--- a/gcc-4.6/gcc/config/i386/i386.c
+++ b/gcc-4.6/gcc/config/i386/i386.c
@@ -2369,6 +2369,9 @@ static int ix86_regparm;
static const char ix86_force_align_arg_pointer_string[]
= "force_align_arg_pointer";
+/* Stack protector option. */
+enum stack_protector_guard ix86_stack_protector_guard;
+
static rtx (*ix86_gen_leave) (void);
static rtx (*ix86_gen_add3) (rtx, rtx, rtx);
static rtx (*ix86_gen_sub3) (rtx, rtx, rtx);
@@ -4360,6 +4363,22 @@ ix86_option_override_internal (bool main_args_p)
}
free (token);
}
+
+ /* Handle stack protector */
+ if (ix86_stack_protector_guard_string != 0)
+ {
+ if (!strcmp (ix86_stack_protector_guard_string, "tls"))
+ ix86_stack_protector_guard = SSP_TLS;
+ else if (!strcmp (ix86_stack_protector_guard_string, "global"))
+ ix86_stack_protector_guard = SSP_GLOBAL;
+ else
+ error ("bad value (%s) for %sstack-protector-guard=%s %s",
+ ix86_stack_protector_guard, prefix, suffix, sw);
+ }
+ else
+ {
+ ix86_stack_protector_guard = TARGET_HAS_BIONIC? SSP_GLOBAL : SSP_TLS;
+ }
}
/* Return TRUE if VAL is passed in register with 256bit AVX modes. */