[RFC PATCH 0/1] RISC-V: Imply 'Zicsr' from privileged extensions with CSRs

Tsukasa OI research_trasio@irq.a4lg.com
Sat Oct 8 04:32:17 GMT 2022


Hello,

'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 could add implications from privileged extensions that
either add new CSRs, extend existing CSRs or depends on using CSRs.

This patchset adds such implications for existing privileged extensions that
satisfy this condition.

I would like to hear your thoughts.


Thanks,
Tsukasa




Tsukasa OI (1):
  RISC-V: Imply 'Zicsr' from privileged extensions with CSRs

 bfd/elfxx-riscv.c                       | 5 +++++
 gas/testsuite/gas/riscv/march-imply-h.d | 6 ++++++
 2 files changed, 11 insertions(+)
 create mode 100644 gas/testsuite/gas/riscv/march-imply-h.d


base-commit: 4cbfd0daabd68516651ee37a19d0e24ca4789ea3
-- 
2.34.1



More information about the Binutils mailing list