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'.