diff options
author | Tsukasa OI <research_trasio@irq.a4lg.com> | 2022-09-05 08:11:54 +0000 |
---|---|---|
committer | Tsukasa OI <research_trasio@irq.a4lg.com> | 2022-10-14 05:21:42 +0000 |
commit | b16e13328b14e2668e2a4355d587368ed040b680 (patch) | |
tree | 2ac223eb3f8ab1eb823b983435c5faf8b527a175 /bfd | |
parent | 637d7c14299eea2fbffb0e133ffe5e1883fbd43b (diff) | |
download | gdb-b16e13328b14e2668e2a4355d587368ed040b680.zip gdb-b16e13328b14e2668e2a4355d587368ed040b680.tar.gz gdb-b16e13328b14e2668e2a4355d587368ed040b680.tar.bz2 |
RISC-V: Imply 'Zicsr' from privileged extensions with CSRs
'H', 'Smstateen', 'Sscofpmf' and 'Sstc' are four privileged extensions with
their CSR definitions and 'Smepmp' is a privileged extension with additional
CSR bits.
Volume II: Privileged Architecture of the RISC-V ISA Manual states that the
privileged architecture requires the 'Zicsr' extension. However, current
GNU Binutils has no direct way whether the program has dependency to the
privileged architecture itself.
As a workaround, we should add implications from privileged extensions that
either add new CSRs, extend existing CSRs or depends on using CSRs.
This commit adds such implications for existing privileged extensions that
satisfy this condition.
gas/ChangeLog:
* testsuite/gas/riscv/march-imply-h.d: New test, at least for 'H'.
bfd/ChangeLog:
* elfxx-riscv.c (riscv_implicit_subsets): Add 'Zicsr'
implicications for privileged extensions 'H', 'Smstateen',
'Sscofpmf', 'Sstc' and 'Smepmp'.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/elfxx-riscv.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/bfd/elfxx-riscv.c b/bfd/elfxx-riscv.c index 1bcc6c0..f0c91cc 100644 --- a/bfd/elfxx-riscv.c +++ b/bfd/elfxx-riscv.c @@ -1047,6 +1047,7 @@ static struct riscv_implicit_subset riscv_implicit_subsets[] = {"g", "zicsr", check_implicit_always}, {"g", "zifencei", check_implicit_always}, {"m", "zmmul", check_implicit_always}, + {"h", "zicsr", check_implicit_always}, {"q", "d", check_implicit_always}, {"v", "d", check_implicit_always}, {"v", "zve64d", check_implicit_always}, @@ -1096,6 +1097,10 @@ static struct riscv_implicit_subset riscv_implicit_subsets[] = {"zks", "zbkx", check_implicit_always}, {"zks", "zksed", check_implicit_always}, {"zks", "zksh", check_implicit_always}, + {"smepmp", "zicsr", check_implicit_always}, + {"smstateen", "zicsr", check_implicit_always}, + {"sscofpmf", "zicsr", check_implicit_always}, + {"sstc", "zicsr", check_implicit_always}, {NULL, NULL, NULL} }; |