On Fri, Apr 12, 2013 at 04:43:51PM +0800, Andrew Hsieh wrote: > --- gcc/config/i386/i386-opts.h (revision 197837) > +++ gcc/config/i386/i386-opts.h (working copy) > @@ -85,4 +85,9 @@ > ix86_veclibabi_type_acml > }; > > +enum stack_protector_guard { > + SSP_TLS, /* per-thread canary at %gs:20 */
This comment is wrong, the TLS canary is {%fs,%gs}:{0x14,0x18,0x28} depending on command line options. > --- gcc/config/i386/i386.c (revision 197837) > +++ gcc/config/i386/i386.c (working copy) > @@ -3922,6 +3922,12 @@ > if (main_args_p) > target_option_default_node = target_option_current_node > = build_target_option_node (); > + > + /* Handle stack protector */ > + if (!global_options_set.x_ix86_stack_protector_guard) > + { > + ix86_stack_protector_guard = TARGET_HAS_BIONIC? SSP_GLOBAL : SSP_TLS; > + } Wrong formatting. No {} around single line statement then body, and missing space before ?. Jakub