Hi Segher, This is the patch series you already saw earlier this year, rebased to recent gcc, and with a comment or two fixed. The first five patches tidy and rearrange the function call code in order to support inline plt calls without a huge increase in rs6000.md. As is, inline plt calls are supported for powerpc-linux and powerpc64le-linux ELFv2. I don't support them for powerpc64-linux ELFv1 due to the extra read barriers needed there, but it wouldn't be too difficult to support if there was demand.
I've regression tested again on powerpc64le-linux. Earlier testing went to some lengths with old and new binutils on powerpc-linux, powerpc64le-linux and powerpc64-linux. I also tested using -fno-plt in bootstrap and regression tests, which unsurprisingly showed numerous fails due to wrong counts of symbols (inline plt references a function symbol multiple times to make a call), wrong "bl" counts (none with inline call) or similar. I didn't see anything frightening, and I expect that people generally won't regression test with -fno-plt, so I haven't modified any tests. One benefit of the inline plt support is that gcc will now use the new sequences and relocs to support -mlongcall. This allows lazy dynamic resolution of the plt entries so it is now possible to dlopen libraries and have -mlongcall code call functions in those libraries. That wasn't possible before. See https://bugzilla.redhat.com/show_bug.cgi?id=1633721 Alan Modra (6): [RS6000] rs6000_output_call for external call insn assembly output [RS6000] rs6000_output_indirect_call [RS6000] Replace TLSmode with P, and correct tls call mems [RS6000] Remove constraints on call rounded_stack_size_rtx arg [RS6000] Use standard call patterns for __tls_get_addr calls [RS6000] inline plt call sequences gcc/config.in | 6 + gcc/config/rs6000/darwin.md | 8 +- gcc/config/rs6000/predicates.md | 25 + gcc/config/rs6000/rs6000-protos.h | 8 +- gcc/config/rs6000/rs6000.c | 617 ++++++++++++++--- gcc/config/rs6000/rs6000.h | 4 + gcc/config/rs6000/rs6000.md | 1023 +++++++++++++---------------- gcc/configure | 36 + gcc/configure.ac | 6 + 9 files changed, 1065 insertions(+), 668 deletions(-) -- Alan Modra Australia Development Lab, IBM