Commit Graph

5 Commits

Author SHA1 Message Date
Nick Alcock
de6591238b 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.)
2016-12-26 10:08:41 +01:00
H.J. Lu
e0ed2fb40a Replace __attribute__((visibility("protected")))
With copy relocation, address of protected data defined in the shared
library may be external.  Compiler shouldn't asssume protected data will
be local.  But due to

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65248

__attribute__((visibility("protected"))) doesn't work correctly, we need
to use asm (".protected xxx") instead.

	* elf/ifuncdep2.c (global): Replace
	__attribute__((visibility("protected"))) with
	asm (".protected global").
	* elf/ifuncmod1.c (global): Likewise.
	* elf/ifuncmod5.c (global): Likewise.
2015-03-06 17:05:42 -08:00
Joseph Myers
9c84384cc1 Remove trailing whitespace. 2013-06-05 20:44:03 +00:00
Alan Modra
31c759bf37 Uglify IFUNC tests for PPC. 2009-10-30 00:48:54 -07:00
H.J. Lu
2f083d7511 Test for ELF IFUNC functionality. 2009-06-03 16:21:40 -07:00