RISC-V: Disable -msave-restore for shared libraries.
authorJim Wilson <jimw@sifive.com>
Fri, 30 Aug 2019 23:32:52 +0000 (23:32 +0000)
committerJim Wilson <wilson@gcc.gnu.org>
Fri, 30 Aug 2019 23:32:52 +0000 (16:32 -0700)
commita169f35890152e8a31ef9bdc0d28a2e0a62e866e
tree65cc8352d4cfbbf79ce8d3e14f69b6f8196876f7
parent4a140826453da37a134d792e0224f4e37343e68a
RISC-V: Disable -msave-restore for shared libraries.

This was noticed while trying to test -msave-restore support.  The
save/restore routines use the alternate return register t0/x5 which is
clobbered by the PLT header, so we can't use them in shared libraries.
This patch disables -msave-restore when -fpic (and -mplt), and emits a
warning if the user explicitly turned on -msave-restore.

gcc/
* config/riscv/riscv.c (riscv_option_override): If -msave-restore
and -fpic and -mplt then disable -msave-restore and warn.

From-SVN: r275231
gcc/ChangeLog
gcc/config/riscv/riscv.c