[v4,03/17] riscv: Add GNU property definitions for RISC-V CFI

Message ID 20260526061703.2188042-4-jesse.huang@sifive.com (mailing list archive)
State New
Headers
Series Support RISC-V Control Flow Integrifty (CFI) |

Checks

Context Check Description
redhat-pt-bot/TryBot-apply_patch success Patch applied to master at the time it was sent
linaro-tcwg-bot/tcwg_glibc_build--master-arm success Build passed
linaro-tcwg-bot/tcwg_glibc_build--master-aarch64 success Build passed
linaro-tcwg-bot/tcwg_glibc_check--master-aarch64 success Test passed

Commit Message

Jesse Huang May 26, 2026, 6:16 a.m. UTC
  Add GNU properties used by RISC-V CFI extensions (zicfilp/zicfiss)
---
 elf/elf.h | 5 +++++
 1 file changed, 5 insertions(+)
  

Comments

Deepak Gupta May 26, 2026, 6:30 p.m. UTC | #1
Reviewed-by: Deepak Gupta <debug@rivosinc.com>

On Mon, May 25, 2026 at 11:17 PM Jesse Huang <jesse.huang@sifive.com> wrote:
>
> Add GNU properties used by RISC-V CFI extensions (zicfilp/zicfiss)
> ---
>  elf/elf.h | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/elf/elf.h b/elf/elf.h
> index 3a60ef36b5..3e8c4fb92d 100644
> --- a/elf/elf.h
> +++ b/elf/elf.h
> @@ -1427,6 +1427,11 @@ typedef struct
>     SHSTK.  */
>  #define GNU_PROPERTY_X86_FEATURE_1_SHSTK       (1U << 1)
>
> +/* RISC-V specific GNU PROPERTY. */
> +#define GNU_PROPERTY_RISCV_FEATURE_1_AND       0xc0000000
> +#define GNU_PROPERTY_RISCV_FEATURE_1_CFI_LP_UNLABELED  (1u << 0)
> +#define GNU_PROPERTY_RISCV_FEATURE_1_CFI_SS    (1u << 1)
> +
>  /* Move records.  */
>  typedef struct
>  {
> --
> 2.43.7
>
  

Patch

diff --git a/elf/elf.h b/elf/elf.h
index 3a60ef36b5..3e8c4fb92d 100644
--- a/elf/elf.h
+++ b/elf/elf.h
@@ -1427,6 +1427,11 @@  typedef struct
    SHSTK.  */
 #define GNU_PROPERTY_X86_FEATURE_1_SHSTK	(1U << 1)
 
+/* RISC-V specific GNU PROPERTY. */
+#define GNU_PROPERTY_RISCV_FEATURE_1_AND	0xc0000000
+#define GNU_PROPERTY_RISCV_FEATURE_1_CFI_LP_UNLABELED	(1u << 0)
+#define GNU_PROPERTY_RISCV_FEATURE_1_CFI_SS	(1u << 1)
+
 /* Move records.  */
 typedef struct
 {