[Bug target/36955] [4.4 Regression] TLS LIBCALL change breaks libstdc++ built with older binutils

amodra at bigpond dot net dot au gcc-bugzilla@gcc.gnu.org
Tue Jul 29 00:38:00 GMT 2008



------- 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



More information about the Gcc-bugs mailing list