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 /gas | |
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 'gas')
-rw-r--r-- | gas/testsuite/gas/riscv/march-imply-h.d | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gas/testsuite/gas/riscv/march-imply-h.d b/gas/testsuite/gas/riscv/march-imply-h.d new file mode 100644 index 0000000..04ad9f6 --- /dev/null +++ b/gas/testsuite/gas/riscv/march-imply-h.d @@ -0,0 +1,6 @@ +#as: -march=rv32ih -march-attr -misa-spec=20191213 -mpriv-spec=1.12 +#readelf: -A +#source: empty.s +Attribute Section: riscv +File Attributes + Tag_RISCV_arch: "rv32i2p1_h1p0_zicsr2p0" |