From 9be3bb2c0a258fd6a7d3d05d232a21930c757d3c Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Wed, 29 Apr 2020 04:52:46 -0700 Subject: x86: Allow -fcf-protection with external thunk Allow -fcf-protection with external thunk since the external thunk can be made compatible with -fcf-protection. gcc/ PR target/93654 * config/i386/i386-options.c (ix86_set_indirect_branch_type): Allow -fcf-protection with -mindirect-branch=thunk-extern and -mfunction-return=thunk-extern. * doc/invoke.texi: Update notes for -fcf-protection=branch with -mindirect-branch=thunk-extern and -mindirect-return=thunk-extern. gcc/testsuite/ PR target/93654 * gcc.target/i386/pr93654.c: New test. --- gcc/doc/invoke.texi | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'gcc/doc') diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index fed38e8..5bb7d94 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -30097,9 +30097,9 @@ Note that @option{-mcmodel=large} is incompatible with @option{-mindirect-branch=thunk-extern} since the thunk function may not be reachable in the large code model. -Note that @option{-mindirect-branch=thunk-extern} is incompatible with -@option{-fcf-protection=branch} since the external thunk cannot be modified -to disable control-flow check. +Note that @option{-mindirect-branch=thunk-extern} is compatible with +@option{-fcf-protection=branch} since the external thunk can be made +to enable control-flow check. @item -mfunction-return=@var{choice} @opindex mfunction-return @@ -30112,6 +30112,10 @@ object file. You can control this behavior for a specific function by using the function attribute @code{function_return}. @xref{Function Attributes}. +Note that @option{-mindirect-return=thunk-extern} is compatible with +@option{-fcf-protection=branch} since the external thunk can be made +to enable control-flow check. + Note that @option{-mcmodel=large} is incompatible with @option{-mfunction-return=thunk} and @option{-mfunction-return=thunk-extern} since the thunk function may -- cgit v1.1