-fstack-protect

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

Is there a way to disable this for a specific function?  Something
like __attribute__((unprotected)) maybe?

I have a function that appends two string literals* (of known size to
the compiler) into a char array that is 43 bytes larger than the two
literals, but gcc is still emitting the stack guard instructions.

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.  It's a a heavily used function that is inlined, so it's
causing increased code size and slower performance for no reason.

Thanks,
--Mike

*It actually does more, but eliminating all but these two memcpy()s
still produces the stack guard; if reduced to a single memcpy(), gcc
does detect it cannot smash the stack and doesn't emit the stack
guard.



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux