summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@gcc.gnu.org>2018-02-06 18:15:56 +0100
committerEric Botcazou <ebotcazou@gcc.gnu.org>2018-02-06 18:17:39 +0100
commitc20c30f615756ddfccc4bb75c65ccfc1a399466e (patch)
tree9b5459a709bf72b5b53986110d56499cff9cdc52 /config
parentbca65a2394ce11bb4a0b001b8a986961c2e84881 (diff)
downloadbinutils-gdb-c20c30f615756ddfccc4bb75c65ccfc1a399466e.tar.gz
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.
Diffstat (limited to 'config')
-rw-r--r--config/ChangeLog4
-rw-r--r--config/gcc-plugin.m44
2 files changed, 6 insertions, 2 deletions
diff --git a/config/ChangeLog b/config/ChangeLog
index 5e75dc36c3e..721c47e52f8 100644
--- a/config/ChangeLog
+++ b/config/ChangeLog
@@ -1,3 +1,7 @@
+2018-02-06 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc-plugin.m4 (GCC_ENABLE_PLUGINS): Remove -q option passed to grep.
+
2018-01-10 Nick Clifton <nickc@redhat.com>
* Sync with GCC sources:
diff --git a/config/gcc-plugin.m4 b/config/gcc-plugin.m4
index 38b2ae6e12e..8f278719118 100644
--- a/config/gcc-plugin.m4
+++ b/config/gcc-plugin.m4
@@ -60,14 +60,14 @@ AC_DEFUN([GCC_ENABLE_PLUGINS],
if test "x$export_sym_check" != x; then
echo "int main() {return 0;} int foobar() {return 0;}" > conftest.c
${CC} ${CFLAGS} ${LDFLAGS} conftest.c -o conftest$ac_exeext > /dev/null 2>&1
- if $export_sym_check conftest$ac_exeext | grep -q foobar > /dev/null; then
+ if $export_sym_check conftest$ac_exeext | grep foobar > /dev/null; then
: # No need to use a flag
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([yes])
AC_MSG_CHECKING([for -rdynamic])
${CC} ${CFLAGS} ${LDFLAGS} -rdynamic conftest.c -o conftest$ac_exeext > /dev/null 2>&1
- if $export_sym_check conftest$ac_exeext | grep -q foobar > /dev/null; then
+ if $export_sym_check conftest$ac_exeext | grep foobar > /dev/null; then
plugin_rdynamic=yes
pluginlibs="-rdynamic"
else