[PATCH 6/8] bfd/binutils: add support for RISC-V CSRs in core files

Andrew Burgess andrew.burgess@embecosm.com
Mon Dec 14 13:37:04 GMT 2020


* Jim Wilson <jimw@sifive.com> [2020-12-02 15:50:58 -0800]:

> On Wed, Dec 2, 2020 at 9:39 AM Andrew Burgess <andrew.burgess@embecosm.com>
> wrote:
> 
> > diff --git a/include/elf/common.h b/include/elf/common.h
> > index 1dbf0b11983..54d5d989a39 100644
> > --- a/include/elf/common.h
> > +++ b/include/elf/common.h
> > @@ -663,6 +663,8 @@
> >                                         /*   note name must be "LINUX".  */
> >  #define NT_ARC_V2      0x600           /* ARC HS accumulator/extra
> > registers.  */
> >                                         /*   note name must be "LINUX".  */
> > +#define NT_RISCV_CSR    0x501           /* RISC-V Control and Status
> > Registers */
> > +                                        /*   note name must be "CORE".  */
> >  #define NT_SIGINFO     0x53494749      /* Fields of siginfo_t.  */
> >  #define NT_FILE                0x46494c45      /* Description of mapped
> > files.  */
> >
> 
> Odd that the 0x5XX numbering was skipped for ARC, though I don't see any
> reason for it, so it appears OK to use for RISC-V.  I would suggest keeping
> them in numerical order to make the file easier to read, so if you want to
> use 0x501 put it before the ARC entry.
> 
> Otherwise, this looks OK to me with a trivial change here.

On further reflection I wonder if I should submit a patch to the Linux
kernel to try and reserve this (or some other suitable) number,
otherwise there's a risk that whatever we pick could be used by the
kernel for some other architecture?

Thanks,
Andrew


More information about the Binutils mailing list