-fstack-protect

Florian Weimer fweimer@redhat.com
Thu Jan 15 09:51:00 GMT 2015


On 01/14/2015 04:25 PM, Mike Harrold wrote:
> Since I know the stack cannot be smashed (and gcc is apparently unable
> to determine that for itself), I'd like to turn it off for that
> function.

Have you tried -fstack-protector-strong?  It does a much better job than 
the size-based heuristics.

If you can come up with a minimal example that shows the phenomenon, we 
might come up with something better.

> It's a a heavily used function that is inlined, so it's
> causing increased code size and slower performance for no reason.

If it is inlined, the function itself will not be instrumented.  Whether 
the caller is instrumented depends on its inlined functions and what 
else it does.

-- 
Florian Weimer / Red Hat Product Security



More information about the Gcc-help mailing list