[RS6000] No inline PLT for V4 bss-plt, implement -mno-pltseq

Programming / Compilers / GCC - amodra [138bc75d-0d04-0410-961f-82ee72b054a4] - 11 February 2019 15:19 EST

Inline PLT calls need PLT to be an array of addresses. PowerPC 32-bit bss-plt works differently, so this patch disables inline PLT calls when -mbss-plt. The patch also adds support for a new -mno-pltseq option, which may be required when linking with -mbss-plt code.

- doc/invoke.texi (man page RS/6000 and PowerPC Options): Mention
-mlongcall and -mpltseq. (RS/6000 and PowerPC Options <-mlongcall>): Mention inline PLT calls. (RS/6000 and PowerPC Options <-mpltseq>): Document.
- config/rs6000/rs6000.h (TARGET_PLTSEQ): Define.
- config/rs6000/sysv4.opt (mpltseq): New option.
- config/rs6000/sysv4.h (TARGET_PLTSEQ): Redefine. (SUBTARGET_OVERRIDE_OPTIONS): Error if given -mpltseq when assembler support is lacking. Don't allow -mpltseq with -mbss-plt.
- config/rs6000/linux64.h (SUBSUBTARGET_OVERRIDE_OPTIONS): Warn if
-mpltseq given for ELFv1.
- config/rs6000/rs6000.c (rs6000_call_aix): Comment on UNSPEC_PLTSEQ. Only use UNSPEC_PLTSEQ for inline PLT calls. (rs6000_call_sysv, rs6000_sibcall_sysv): Expand comments. Only use UNSPEC_PLTSEQ for inline PLT calls. (rs6000_indirect_call_template_1, rs6000_longcall_ref), (rs6000_call_aix, rs6000_call_sysv, rs6000_sibcall_sysv): Replace uses of HAVE_AS_PLTSEQ with TARGET_PLTSEQ, simplifying.
- config/rs6000/rs6000.md (pltseq_tocsave_), (pltseq_plt16_ha_, pltseq_plt16_lo_), (pltseq_mtctr_): Likewise.

eb6b3c61894 [RS6000] No inline PLT for V4 bss-plt, implement -mno-pltseq
gcc/ChangeLog | 24 +++++++++++++++++
gcc/config/rs6000/linux64.h | 7 +++++
gcc/config/rs6000/rs6000.c | 66 +++++++++++++++++++++++++++++----------------
gcc/config/rs6000/rs6000.h | 4 +++
gcc/config/rs6000/rs6000.md | 11 +++-----
gcc/config/rs6000/sysv4.h | 25 +++++++++++++++++
gcc/config/rs6000/sysv4.opt | 4 +++
gcc/doc/invoke.texi | 20 ++++++++++++++
8 files changed, 131 insertions(+), 30 deletions(-)

Upstream: gcc.gnu.org

  • Share