Hi Alan, On Fri, Feb 08, 2019 at 11:05:57AM +1030, Alan Modra wrote: > 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. */
This comment could use some work. > - if (HAVE_AS_PLTSEQ) > + if (HAVE_AS_PLTSEQ && REGNO (func) == 11) This (and all occurrences below) need some explanation. It is probably best if you factor out bool something = (REGNO (func) == 11)); (with a descriptive name) and use that? The patch is okay (for all branches) with those things improved. Thanks! Segher