This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: -fstack-protect
- From: Florian Weimer <fweimer at redhat dot com>
- To: Mike Harrold <alexmudmiko at gmail dot com>, gcc-help at gcc dot gnu dot org
- Date: Thu, 15 Jan 2015 10:51:22 +0100
- Subject: Re: -fstack-protect
- Authentication-results: sourceware.org; auth=none
- References: <CADepfxH34yTgTtycVMrFqkhOSTZpknWrQ1PhMOS1JFr2BQQ60g at mail dot gmail dot com>
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