Inline PLT calls need PLT to be an array of addresses. bss-plt works differently.
Bootstrap and regression test on powerpc64-linux biarch in progress. OK assuming no regressions? * config/rs6000/rs6000.c (rs6000_longcall_ref): Don't use inline plt for ABI_V4 bss-plt. (rs6000_call_sysv): Likewise. diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 711278c7422..cced90bb518 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -32819,7 +32819,8 @@ rs6000_longcall_ref (rtx call_ref, rtx arg) } if (HAVE_AS_PLTSEQ - && (DEFAULT_ABI == ABI_ELFv2 || DEFAULT_ABI == ABI_V4)) + && (DEFAULT_ABI == ABI_ELFv2 + || (DEFAULT_ABI == ABI_V4 && TARGET_SECURE_PLT))) { rtx base = const0_rtx; int regno; @@ -37981,7 +37982,7 @@ rs6000_call_sysv (rtx value, rtx func_desc, rtx tlsarg, rtx cookie) func = rs6000_longcall_ref (func_desc, tlsarg); /* If the longcall was implemented using PLT16 relocs, then r11 needs to be valid at the call for lazy linking. */ - if (HAVE_AS_PLTSEQ) + if (HAVE_AS_PLTSEQ && REGNO (func) == 11) abi_reg = func; } @@ -37994,7 +37995,7 @@ rs6000_call_sysv (rtx value, rtx func_desc, rtx tlsarg, rtx cookie) calls via LR, so move the address there. Needed to mark this insn for linker plt sequence editing too. */ func_addr = gen_rtx_REG (Pmode, CTR_REGNO); - if (HAVE_AS_PLTSEQ + if (HAVE_AS_PLTSEQ && REGNO (func) == 11 && GET_CODE (func_desc) == SYMBOL_REF) { rtvec v = gen_rtvec (3, func, func_desc, tlsarg); @@ -38051,7 +38052,7 @@ rs6000_sibcall_sysv (rtx value, rtx func_desc, rtx tlsarg, rtx cookie) func = rs6000_longcall_ref (func_desc, tlsarg); /* If the longcall was implemented using PLT16 relocs, then r11 needs to be valid at the call for lazy linking. */ - if (HAVE_AS_PLTSEQ) + if (HAVE_AS_PLTSEQ && REGNO (func) == 11) abi_reg = func; } @@ -38063,7 +38064,7 @@ rs6000_sibcall_sysv (rtx value, rtx func_desc, rtx tlsarg, rtx cookie) /* Indirect sibcalls must go via CTR. Needed to mark this insn for linker plt sequence editing too. */ func_addr = gen_rtx_REG (Pmode, CTR_REGNO); - if (HAVE_AS_PLTSEQ + if (HAVE_AS_PLTSEQ && REGNO (func) == 11 && GET_CODE (func_desc) == SYMBOL_REF) { rtvec v = gen_rtvec (3, func, func_desc, tlsarg); -- Alan Modra Australia Development Lab, IBM