From c20c30f615756ddfccc4bb75c65ccfc1a399466e Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Tue, 6 Feb 2018 18:15:56 +0100 Subject: 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. : Turn call to bfd_link_pic into call to !bfd_link_executable. : Likewise. : Remove useless code, tidy and merge blocks. : Turn call to bfd_link_pic into call to !bfd_link_executable. : 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. : Merge into... : ...this. Adjust 4th argument in call to sparc_elf_tls_transition and remove redundant code. : Turn call to bfd_link_pic into call to !bfd_link_executable. : Likewise. : Likewise. Tidy up. : Likewise. : Likewise. Tidy up. : Likewise. : Likewise. : Likewise. : 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. --- config/ChangeLog | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'config/ChangeLog') diff --git a/config/ChangeLog b/config/ChangeLog index 5e75dc3..721c47e 100644 --- a/config/ChangeLog +++ b/config/ChangeLog @@ -1,3 +1,7 @@ +2018-02-06 Eric Botcazou + + * gcc-plugin.m4 (GCC_ENABLE_PLUGINS): Remove -q option passed to grep. + 2018-01-10 Nick Clifton * Sync with GCC sources: -- cgit v1.1