This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/36955] [4.4 Regression] TLS LIBCALL change breaks libstdc++ built with older binutils
- From: "amodra at bigpond dot net dot au" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 29 Jul 2008 00:37:17 -0000
- Subject: [Bug target/36955] [4.4 Regression] TLS LIBCALL change breaks libstdc++ built with older binutils
- References: <bug-36955-4503@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #12 from amodra at bigpond dot net dot au 2008-07-29 00:37 -------
So, the easy fix for this bug is (totally untested, not even compiled)
Index: gcc/config/rs6000/rs6000.c
===================================================================
--- gcc/config/rs6000/rs6000.c (revision 138134)
+++ gcc/config/rs6000/rs6000.c (working copy)
@@ -3940,7 +3940,12 @@ rs6000_legitimize_tls_address (rtx addr,
else if (DEFAULT_ABI == ABI_AIX && !TARGET_64BIT)
insn = gen_tls_gd_aix32 (r3, got, addr, tga, const0_rtx);
else if (DEFAULT_ABI == ABI_V4)
- insn = gen_tls_gd_sysvsi (r3, got, addr, tga, const0_rtx);
+ {
+ insn = gen_tls_gd_sysvsi (r3, got, addr, tga, const0_rtx);
+ if (TARGET_SECURE_PLT && flag_pic == 2)
+ use_reg (&CALL_INSN_FUNCTION_USAGE (insn),
+ pic_offset_table_rtx);
+ }
else
gcc_unreachable ();
@@ -3962,7 +3967,12 @@ rs6000_legitimize_tls_address (rtx addr,
else if (DEFAULT_ABI == ABI_AIX && !TARGET_64BIT)
insn = gen_tls_ld_aix32 (r3, got, tga, const0_rtx);
else if (DEFAULT_ABI == ABI_V4)
- insn = gen_tls_ld_sysvsi (r3, got, tga, const0_rtx);
+ {
+ insn = gen_tls_ld_sysvsi (r3, got, tga, const0_rtx);
+ if (TARGET_SECURE_PLT && flag_pic == 2)
+ use_reg (&CALL_INSN_FUNCTION_USAGE (insn),
+ pic_offset_table_rtx);
+ }
else
gcc_unreachable ();
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36955