diff options
Diffstat (limited to 'gcc-4.8/gcc')
-rw-r--r-- | gcc-4.8/gcc/config/i386/i386.c | 4 | ||||
-rw-r--r-- | gcc-4.8/gcc/config/i386/i386.h | 3 | ||||
-rw-r--r-- | gcc-4.8/gcc/config/i386/i386.md | 8 | ||||
-rw-r--r-- | gcc-4.8/gcc/doc/invoke.texi | 10 |
4 files changed, 17 insertions, 8 deletions
diff --git a/gcc-4.8/gcc/config/i386/i386.c b/gcc-4.8/gcc/config/i386/i386.c index a8212f54b..74b8e9675 100644 --- a/gcc-4.8/gcc/config/i386/i386.c +++ b/gcc-4.8/gcc/config/i386/i386.c @@ -3925,9 +3925,7 @@ ix86_option_override_internal (bool main_args_p) /* Handle stack protector */ if (!global_options_set.x_ix86_stack_protector_guard) - { - ix86_stack_protector_guard = TARGET_HAS_BIONIC? SSP_GLOBAL : SSP_TLS; - } + ix86_stack_protector_guard = TARGET_HAS_BIONIC ? SSP_GLOBAL : SSP_TLS; } /* Implement the TARGET_OPTION_OVERRIDE hook. */ diff --git a/gcc-4.8/gcc/config/i386/i386.h b/gcc-4.8/gcc/config/i386/i386.h index a69862c54..a30c80067 100644 --- a/gcc-4.8/gcc/config/i386/i386.h +++ b/gcc-4.8/gcc/config/i386/i386.h @@ -486,6 +486,9 @@ extern unsigned char x86_prefetch_sse; #define TARGET_TLS_DIRECT_SEG_REFS_DEFAULT 0 #endif +#define TARGET_SSP_GLOBAL_GUARD (ix86_stack_protector_guard == SSP_GLOBAL) +#define TARGET_SSP_TLS_GUARD (ix86_stack_protector_guard == SSP_TLS) + /* Fence to use after loop using storent. */ extern tree x86_mfence; diff --git a/gcc-4.8/gcc/config/i386/i386.md b/gcc-4.8/gcc/config/i386/i386.md index 247e6f9ec..314fd7160 100644 --- a/gcc-4.8/gcc/config/i386/i386.md +++ b/gcc-4.8/gcc/config/i386/i386.md @@ -17599,7 +17599,7 @@ (define_expand "stack_protect_set" [(match_operand 0 "memory_operand") (match_operand 1 "memory_operand")] - "ix86_stack_protector_guard == SSP_TLS" + "TARGET_SSP_TLS_GUARD" { rtx (*insn)(rtx, rtx); @@ -17624,7 +17624,7 @@ UNSPEC_SP_SET)) (set (match_scratch:PTR 2 "=&r") (const_int 0)) (clobber (reg:CC FLAGS_REG))] - "ix86_stack_protector_guard == SSP_TLS" + "TARGET_SSP_TLS_GUARD" "mov{<imodesuffix>}\t{%1, %2|%2, %1}\;mov{<imodesuffix>}\t{%2, %0|%0, %2}\;xor{l}\t%k2, %k2" [(set_attr "type" "multi")]) @@ -17642,7 +17642,7 @@ [(match_operand 0 "memory_operand") (match_operand 1 "memory_operand") (match_operand 2)] - "ix86_stack_protector_guard == SSP_TLS" + "TARGET_SSP_TLS_GUARD" { rtx flags = gen_rtx_REG (CCZmode, FLAGS_REG); @@ -17672,7 +17672,7 @@ (match_operand:PTR 2 "memory_operand" "m")] UNSPEC_SP_TEST)) (clobber (match_scratch:PTR 3 "=&r"))] - "ix86_stack_protector_guard == SSP_TLS" + "TARGET_SSP_TLS_GUARD" "mov{<imodesuffix>}\t{%1, %3|%3, %1}\;xor{<imodesuffix>}\t{%2, %3|%3, %2}" [(set_attr "type" "multi")]) diff --git a/gcc-4.8/gcc/doc/invoke.texi b/gcc-4.8/gcc/doc/invoke.texi index 6ef6039c5..6243c50cf 100644 --- a/gcc-4.8/gcc/doc/invoke.texi +++ b/gcc-4.8/gcc/doc/invoke.texi @@ -655,7 +655,8 @@ Objective-C and Objective-C++ Dialects}. -mcmodel=@var{code-model} -mabi=@var{name} -maddress-mode=@var{mode} @gol -m32 -m64 -mx32 -mlarge-data-threshold=@var{num} @gol -msse2avx -mfentry -m8bit-idiv @gol --mavx256-split-unaligned-load -mavx256-split-unaligned-store} +-mavx256-split-unaligned-load -mavx256-split-unaligned-store @gol +-mstack-protector-guard=@var{guard}} @emph{i386 and x86-64 Windows Options} @gccoptlist{-mconsole -mcygwin -mno-cygwin -mdll @gol @@ -14517,6 +14518,13 @@ to 255, 8-bit unsigned integer divide is used instead of @opindex avx256-split-unaligned-store Split 32-byte AVX unaligned load and store. +@item -mstack-protector-guard=@var{guard} +@opindex mstack-protector-guard=@var{guard} +Generate stack protection code using canary at @var{guard}. Supported +locations are @samp{global} or @samp{tls} per thread at %gs:20 (the default). +This option has effect only when @option{-fstack-protector} +or @option{-fstack-protector-all} is also specified. + @end table These @samp{-m} switches are supported in addition to the above |