From d161cb2dde01d0224f471b8a3ed16ab858276dc1 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Wed, 30 Jul 2008 02:43:05 +0000 Subject: [PATCH] re PR target/36955 (TLS LIBCALL change breaks libstdc++ built with older binutils) PR target/36955 * config/rs6000/rs6000.c (rs6000_legitimize_tls_address): Add a use of pic_offset_table_rtx for -msecure-plt __tls_get_addr calls. From-SVN: r138291 --- gcc/ChangeLog | 6 ++++++ gcc/config/rs6000/rs6000.c | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 406234289ea..5ad3bec3b48 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2008-07-30 Alan Modra + + PR target/36955 + * config/rs6000/rs6000.c (rs6000_legitimize_tls_address): Add + a use of pic_offset_table_rtx for -msecure-plt __tls_get_addr calls. + 2008-07-29 Jan Hubicka * c-decl.c (merge_decls): Do not handle DECL_INLINE. diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 0e03be0fe2a..e67b1a7fed8 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -3948,6 +3948,8 @@ rs6000_legitimize_tls_address (rtx addr, enum tls_model model) insn = emit_call_insn (insn); RTL_CONST_CALL_P (insn) = 1; use_reg (&CALL_INSN_FUNCTION_USAGE (insn), r3); + if (DEFAULT_ABI == ABI_V4 && TARGET_SECURE_PLT && flag_pic) + use_reg (&CALL_INSN_FUNCTION_USAGE (insn), pic_offset_table_rtx); insn = get_insns (); end_sequence (); emit_libcall_block (insn, dest, r3, addr); @@ -3970,6 +3972,8 @@ rs6000_legitimize_tls_address (rtx addr, enum tls_model model) insn = emit_call_insn (insn); RTL_CONST_CALL_P (insn) = 1; use_reg (&CALL_INSN_FUNCTION_USAGE (insn), r3); + if (DEFAULT_ABI == ABI_V4 && TARGET_SECURE_PLT && flag_pic) + use_reg (&CALL_INSN_FUNCTION_USAGE (insn), pic_offset_table_rtx); insn = get_insns (); end_sequence (); tmp1 = gen_reg_rtx (Pmode); -- 2.30.2