Eric Botcazou c20c30f615 Fix PR ld/22263 on SPARC.
This is -fpie -pie generating dynamic relocations in the text section,
simply because no TLS transitions are applied in PIE mode.  The meat
of the patch is to turn calls to bfd_link_pic (info) in TLS-related code
into !bfd_link_executable (info) and there are quite a lot of them...

bfd/
	* elfxx-sparc.c (sparc_elf_tls_transition): Turn call to bfd_link_pic
	into call to !bfd_link_executable and tidy up.
	(_bfd_sparc_elf_check_relocs): Fix formatting and tidy up.
	<R_SPARC_TLS_LE_HIX22>: Turn call to bfd_link_pic into call to
	!bfd_link_executable.
	<R_SPARC_TLS_IE_HI22>: Likewise.
	<GOT relocations>: Remove useless code, tidy and merge blocks.
	<R_SPARC_TLS_GD_CALL>: Turn call to bfd_link_pic into call to
	!bfd_link_executable.
	<R_SPARC_WPLT30>: Tidy up.
	(_bfd_sparc_elf_gc_mark_hook): Turn call to bfd_link_pic into call
	to !bfd_link_executable.
	(allocate_dynrelocs): Likewise.
	(_bfd_sparc_elf_relocate_section): Fix formatting and tidy up.
	<R_SPARC_TLS_GD_HI22>: Merge into...
	<R_SPARC_TLS_GD_LO10>: ...this.  Adjust 4th argument in call to
	sparc_elf_tls_transition and remove redundant code.
	<R_SPARC_TLS_LDM_HI22>: Turn call to bfd_link_pic into call to
	!bfd_link_executable.
	<R_SPARC_TLS_LDO_HIX22>: Likewise.
	<R_SPARC_TLS_LE_HIX22>: Likewise.  Tidy up.
	<R_SPARC_TLS_LDM_CALL>: Likewise.
	<R_SPARC_TLS_GD_CALL>: Likewise.  Tidy up.
	<R_SPARC_TLS_GD_ADD>: Likewise.
	<R_SPARC_TLS_LDM_ADD>: Likewise.
	<R_SPARC_TLS_LDO_ADD>: Likewise.
	<R_SPARC_TLS_IE_LD>: Likewise.
ld/
	* testsuite/ld-elf/tls.exp (AFLAGS_PIC): Define on SPARC.
	(pr22263-1): Pass AFLAGS_PIC to the assembler.
	* testsuite/ld-sparc/tlspie32.s: Add test for other 3 transitions.
	* testsuite/ld-sparc/tlspie32.dd: Adjust to above.
	* testsuite/ld-sparc/tlspie64.s: Add test for other 3 transitions.
	* testsuite/ld-sparc/tlspie64.dd: Adjust to above.
2018-02-06 18:17:39 +01:00
..
2012-05-29 15:58:15 +00:00
2015-07-14 09:18:16 -07:00
2009-09-07 00:44:08 +00:00
2009-09-07 00:44:08 +00:00
2009-09-07 00:44:08 +00:00
2009-09-07 00:44:08 +00:00
2015-07-14 09:18:16 -07:00
2009-05-12 18:16:01 +00:00
2009-05-12 18:16:01 +00:00
2009-09-07 00:44:08 +00:00
2018-02-06 18:17:39 +01:00
2004-09-23 19:43:47 +00:00
2015-06-30 10:20:19 -07:00
2015-03-16 08:49:06 -07:00
2005-09-23 17:28:31 +00:00
2009-07-30 19:43:16 +00:00
2008-01-08 17:29:24 +00:00
2010-07-02 11:58:19 +00:00
2018-02-06 18:17:39 +01:00
2015-07-27 07:43:26 -07:00
2004-09-23 19:43:47 +00:00
2012-11-03 23:53:02 +00:00
2006-07-25 08:39:57 +00:00
2004-09-23 19:43:47 +00:00
2004-09-23 19:43:47 +00:00
2004-09-23 19:43:47 +00:00
2004-09-23 19:43:47 +00:00
2009-11-30 16:46:47 +00:00
2004-09-23 19:43:47 +00:00
2009-08-16 12:49:48 +00:00
2004-09-23 19:43:47 +00:00
2004-09-23 19:43:47 +00:00
2004-09-23 19:43:47 +00:00
2010-12-06 01:40:20 +00:00
2012-05-29 15:58:15 +00:00
2012-05-29 15:58:15 +00:00
2012-05-29 15:58:15 +00:00
2012-05-29 15:58:15 +00:00
2015-03-16 08:41:42 -07:00
2016-12-08 21:35:11 +10:30
2004-09-23 19:43:47 +00:00
2009-07-30 19:43:16 +00:00
2017-01-05 00:02:57 +10:30
2015-07-27 07:43:26 -07:00
2015-07-14 09:18:16 -07:00
2004-09-23 19:43:47 +00:00
2015-07-27 07:43:26 -07:00
2015-07-14 09:18:16 -07:00
2015-07-27 07:43:26 -07:00
2004-09-23 19:43:47 +00:00
2004-09-23 19:43:47 +00:00
2009-08-16 12:49:48 +00:00
2015-07-14 08:39:12 -07:00
2012-05-29 15:58:15 +00:00