[PATCH 1/1] readelf: add support for more RISC-V note types

Jan Beulich jbeulich@suse.com
Wed Sep 9 06:08:55 GMT 2026


On 09.09.2026 07:57, Heinrich Schuchardt via Binutils wrote:
> Add definitions and string values for note types
> 
> * NT_RISCV_VECTOR               0x901
> * NT_RISCV_TAGGED_ADDR_CTRL     0x902
> * NT_RISCV_USER_CFI             0x903
> 
> The constants are defined in Linux' tools/include/uapi/linux/elf.h.
> 
> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>

Largely okay, one nit:

> --- a/include/elf/common.h
> +++ b/include/elf/common.h
> @@ -783,6 +783,12 @@
>  					/*   note name must be "LINUX".  */
>  #define NT_RISCV_CSR    0x900		/* RISC-V Control and Status Registers */
>  					/*   note name must be "LINUX".  */
> +#define NT_RISCV_VECTOR 0x901           /* RISC-V vector registers */
> +					/*   note name must be "LINUX".  */
> +#define NT_RISCV_TAGGED_ADDR_CTRL 0x902 /* RISC-V tagged address control (prctl()) */
> +					/*   note name must be "LINUX".  */
> +#define NT_RISCV_USER_CFI	  0x903 /* RISC-V shadow stack state */
> +					/*   note name must be "LINUX".  */
>  #define NT_SIGINFO	0x53494749	/* Fields of siginfo_t.  */
>  #define NT_FILE		0x46494c45	/* Description of mapped files.  */

Padding used wants to match that of adjacent code. Since I assume this
wants committing on your behalf anyway, I can make adjustments while
doing so.

Jan


More information about the Binutils mailing list