}
}
+static void
+decode_riscv_feature_1_and (unsigned int bitmask)
+{
+ while (bitmask)
+ {
+ unsigned int bit = bitmask & (- bitmask);
+
+ bitmask &= ~ bit;
+ switch (bit)
+ {
+ case GNU_PROPERTY_RISCV_FEATURE_1_CFI_LP_UNLABELED:
+ printf ("CFI_LP_UNLABELED");
+ break;
+
+ case GNU_PROPERTY_RISCV_FEATURE_1_CFI_SS:
+ printf ("CFI_SS");
+ break;
+
+ default:
+ printf (_("<unknown: %x>"), bit);
+ break;
+ }
+ if (bitmask)
+ printf (", ");
+ }
+}
+
static void
decode_1_needed (unsigned int bitmask)
{
goto next;
}
}
+ else if (filedata->file_header.e_machine == EM_RISCV)
+ {
+ if (type == GNU_PROPERTY_RISCV_FEATURE_1_AND)
+ {
+ printf ("RISC-V AND feature: ");
+ if (datasz != 4)
+ printf (_("<corrupt length: %#x> "), datasz);
+ else
+ decode_riscv_feature_1_and (byte_get (ptr, 4));
+ goto next;
+ }
+ }
}
else
{
--- /dev/null
+#as: -defsym __property_zicfilp_unlabeled__=1 -march=rv64i -mabi=lp64
+#readelf: -n
+#source: property.s
+
+Displaying notes found in: .note.gnu.property
+[ ]+Owner[ ]+Data size[ ]+Description
+[ ]+GNU[ ]+0x00000010[ ]+NT_GNU_PROPERTY_TYPE_0
+[ ]+Properties: RISC-V AND feature: CFI_LP_UNLABELED
--- /dev/null
+#as: -defsym __property_zicfiss__=1 -march=rv64i -mabi=lp64
+#readelf: -n
+#source: property.s
+
+Displaying notes found in: .note.gnu.property
+[ ]+Owner[ ]+Data size[ ]+Description
+[ ]+GNU[ ]+0x00000010[ ]+NT_GNU_PROPERTY_TYPE_0
+[ ]+Properties: RISC-V AND feature: CFI_SS
--- /dev/null
+ .text
+ .globl _start
+ .type _start,@function
+_start:
+ ret
+
+.ifdef __property_zicfilp_unlabeled__
+ .section ".note.gnu.property", "a"
+ .p2align 3
+ .long 1f - 0f /* name length */
+ .long 5f - 2f /* data length */
+ .long 5 /* note type */
+0: .asciz "GNU" /* vendor name */
+1:
+ .p2align 3
+2: .long 0xc0000000 /* pr_type. */
+ .long 4f - 3f /* pr_datasz. */
+3:
+ .long 0x1 /* GNU_PROPERTY_RISCV_FEATURE_1_CFI_LP_UNLABELED. */
+4:
+ .p2align 3
+5:
+.endif
+
+.ifdef __property_zicfiss__
+ .section ".note.gnu.property", "a"
+ .p2align 3
+ .long 1f - 0f /* name length */
+ .long 5f - 2f /* data length */
+ .long 5 /* note type */
+0: .asciz "GNU" /* vendor name */
+1:
+ .p2align 3
+2: .long 0xc0000000 /* pr_type. */
+ .long 4f - 3f /* pr_datasz. */
+3:
+ .long 0x2 /* GNU_PROPERTY_RISCV_FEATURE_1_CFI_SS. */
+4:
+ .p2align 3
+5:
+.endif
#define GNU_PROPERTY_AARCH64_FEATURE_1_PAC (1U << 1)
#define GNU_PROPERTY_AARCH64_FEATURE_1_GCS (1U << 2)
+/* 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)
+
/* Values used in GNU .note.ABI-tag notes (NT_GNU_ABI_TAG). */
#define GNU_ABI_TAG_LINUX 0
#define GNU_ABI_TAG_HURD 1