aboutsummaryrefslogtreecommitdiff
path: root/bfd/elfxx-riscv.c
diff options
context:
space:
mode:
authorTsukasa OI <research_trasio@irq.a4lg.com>2023-07-24 05:01:12 +0000
committerTsukasa OI <research_trasio@irq.a4lg.com>2023-07-24 23:42:35 +0000
commit766f6d170c56d1d7b03e81f64d069386d0a7c5dd (patch)
treebb3300ea74d92af8092c7fded0ec45a8a8c84ae0 /bfd/elfxx-riscv.c
parent6badd1020f5bebd3f60a780b8e41a1b581046087 (diff)
downloadgdb-766f6d170c56d1d7b03e81f64d069386d0a7c5dd.zip
gdb-766f6d170c56d1d7b03e81f64d069386d0a7c5dd.tar.gz
gdb-766f6d170c56d1d7b03e81f64d069386d0a7c5dd.tar.bz2
RISC-V: Prohibit the 'Zcf' extension on RV64
As per: <https://github.com/riscv/riscv-code-size-reduction/issues/221>, the 'Zcf' extension does not exist on RV64. This is reflected on the version 1.0.4-1 of the code size reduction specification: <https://github.com/riscv/riscv-code-size-reduction/releases/tag/v1.0.4-1>. This commit prohibits the combination: RV64 (or any ISA with XLEN > 32) and the 'Zcf' extension. bfd/ChangeLog: * elfxx-riscv.c (riscv_parse_check_conflicts): Prohibit combination of RV64 and 'Zcf'. gas/ChangeLog: * testsuite/gas/riscv/march-fail-rv64i_zcf.d: New test. * testsuite/gas/riscv/march-fail-rv64i_zcf.l: Likewise.
Diffstat (limited to 'bfd/elfxx-riscv.c')
-rw-r--r--bfd/elfxx-riscv.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/bfd/elfxx-riscv.c b/bfd/elfxx-riscv.c
index ee96608..eaf4966 100644
--- a/bfd/elfxx-riscv.c
+++ b/bfd/elfxx-riscv.c
@@ -1946,6 +1946,13 @@ riscv_parse_check_conflicts (riscv_parse_subset_t *rps)
rps->error_handler (_("rv%d does not support the `q' extension"), xlen);
no_conflict = false;
}
+ if (riscv_lookup_subset (rps->subset_list, "zcf", &subset)
+ && xlen > 32)
+ {
+ rps->error_handler
+ (_("rv%d does not support the `zcf' extension"), xlen);
+ no_conflict = false;
+ }
if (riscv_lookup_subset (rps->subset_list, "zfinx", &subset)
&& riscv_lookup_subset (rps->subset_list, "f", &subset))
{