]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
RISC-V: allow -fno-plt to disable PLT
authorYangyu Chen <cyy@cyyself.name>
Thu, 31 Oct 2024 08:31:24 +0000 (16:31 +0800)
committerKito Cheng <kito.cheng@sifive.com>
Thu, 31 Oct 2024 08:54:55 +0000 (16:54 +0800)
Currently, the RISC-V target uses the target specific mplt option to
control PLT generation. This patch deprecates the target specific mplt
option and uses the common fplt option instead. This allows users to
use the same option for most targets.

Co-Developed-by: Liao Shihua <shihua@iscas.ac.cn>
Signed-off-by: Yangyu Chen <cyy@cyyself.name>
gcc/ChangeLog:

* config/riscv/predicates.md: Use flag_plt instead of TARGET_PLT.
* config/riscv/riscv.opt: alias common option fplt to mplt.

gcc/config/riscv/predicates.md
gcc/config/riscv/riscv.opt

index 9971fabc587380de79f602dabb5c0b6ce99a3934..55bcfa4fa4f1f1fa964d2d5bb48aa69743e6d68d 100644 (file)
 {
   enum riscv_symbol_type type;
   return (riscv_symbolic_constant_p (op, &type)
-         && type == SYMBOL_GOT_DISP && !SYMBOL_REF_WEAK (op) && TARGET_PLT);
+         && type == SYMBOL_GOT_DISP && !SYMBOL_REF_WEAK (op) && flag_plt);
 })
 
 (define_predicate "call_insn_operand"
index 6360ed3984d0a53ea232696e31bb3937ad0b448d..5bc5d30029345b66604cf570e44fb738d7f9b10c 100644 (file)
@@ -34,8 +34,8 @@ Target RejectNegative Joined UInteger Var(riscv_branch_cost)
 -mbranch-cost=N        Set the cost of branches to roughly N instructions.
 
 mplt
-Target Var(TARGET_PLT) Init(1)
-When generating -fpic code, allow the use of PLTs. Ignored for fno-pic.
+Target Alias(fplt)
+This option is deprecated; use -fplt or -fno-plt instead.
 
 mabi=
 Target RejectNegative Joined Enum(abi_type) Var(riscv_abi) Init(ABI_ILP32) Negative(mabi=)