From de6591238b478bc86b8cf5af01a484114e399213 Mon Sep 17 00:00:00 2001 From: Nick Alcock Date: Mon, 26 Dec 2016 10:08:41 +0100 Subject: Do not stack-protect ifunc resolvers [BZ #7065] When dynamically linking, ifunc resolvers are called before TLS is initialized, so they cannot be safely stack-protected. We avoid disabling stack-protection on large numbers of files by using __attribute__ ((__optimize__ ("-fno-stack-protector"))) to turn it off just for the resolvers themselves. (We provide the attribute even when statically linking, because we will later use it elsewhere too.) --- configure.ac | 1 + 1 file changed, 1 insertion(+) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index c159768984..f5fa1aaefa 100644 --- a/configure.ac +++ b/configure.ac @@ -653,6 +653,7 @@ stack_protector= no_stack_protector= if test "$libc_cv_ssp" = yes; then no_stack_protector="-fno-stack-protector -DSTACK_PROTECTOR_LEVEL=0" + AC_DEFINE(HAVE_CC_NO_STACK_PROTECTOR) fi if test "$enable_stack_protector" = yes && test "$libc_cv_ssp" = yes; then -- cgit v1.2.3