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.) --- config.h.in | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'config.h.in') diff --git a/config.h.in b/config.h.in index d96ce0f8cf..82f95a6dbd 100644 --- a/config.h.in +++ b/config.h.in @@ -48,6 +48,10 @@ /* Define if compiler accepts -ftree-loop-distribute-patterns. */ #undef HAVE_CC_INHIBIT_LOOP_TO_LIBCALL +/* Define if compiler accepts -fno-stack-protector in an + __attribute__ ((__optimize__)). */ +#undef HAVE_CC_NO_STACK_PROTECTOR + /* The level of stack protection in use for glibc as a whole. May be overridden on a file-by-file basis. */ #ifndef STACK_PROTECTOR_LEVEL -- cgit v1.2.3