Add 3 new PAC-related ARM note types
authorLuis Machado <luis.machado@linaro.org>
Thu, 5 Aug 2021 16:50:17 +0000 (13:50 -0300)
committerLuis Machado <luis.machado@linaro.org>
Wed, 11 Aug 2021 12:42:44 +0000 (09:42 -0300)
The following patch synchronizes includes/objdump/readelf with the Linux
Kernel in terms of ARM regset notes.

We're currently missing 3 of them:

NT_ARM_PACA_KEYS
NT_ARM_PACG_KEYS
NT_ARM_PAC_ENABLED_KEYS

We don't need GDB to bother with this at the moment, so this doesn't update
bfd/elf.c. If needed, we can do it in the future.

binutils/

* readelf.c (get_note_type): Handle new ARM PAC notes.

include/elf/

* common.h (NT_ARM_PACA_KEYS, NT_ARM_PACG_KEYS)
(NT_ARM_PAC_ENABLED_KEYS): New constants.

binutils/readelf.c
include/elf/common.h

index bd16fcc77add1d758e0e9050e5cfaab7060a4511..bedd3893b59b937a9501ed7ccb27620258a5604a 100644 (file)
@@ -18828,8 +18828,14 @@ get_note_type (Filedata * filedata, unsigned e_type)
        return _("NT_ARM_SVE (AArch SVE registers)");
       case NT_ARM_PAC_MASK:
        return _("NT_ARM_PAC_MASK (AArch pointer authentication code masks)");
+      case NT_ARM_PACA_KEYS:
+       return _("NT_ARM_PACA_KEYS (ARM pointer authentication address keys)");
+      case NT_ARM_PACG_KEYS:
+       return _("NT_ARM_PACG_KEYS (ARM pointer authentication generic keys)");
       case NT_ARM_TAGGED_ADDR_CTRL:
        return _("NT_ARM_TAGGED_ADDR_CTRL (AArch tagged address control)");
+      case NT_ARM_PAC_ENABLED_KEYS:
+       return _("NT_ARM_PAC_ENABLED_KEYS (AArch64 pointer authentication enabled keys)");
       case NT_ARC_V2:
        return _("NT_ARC_V2 (ARC HS accumulator/extra registers)");
       case NT_RISCV_CSR:
index 0d381f0d27be5b818a79dfea8293a0bc9a62012a..95ade894e98f361cfd82bd0a20a5c520015a0635 100644 (file)
                                        /*   note name must be "LINUX".  */
 #define NT_ARM_PAC_MASK        0x406           /* AArch pointer authentication code masks */
                                        /*   note name must be "LINUX".  */
+#define NT_ARM_PACA_KEYS  0x407                /* ARM pointer authentication address
+                                          keys */
+                                       /*   note name must be "LINUX".  */
+#define NT_ARM_PACG_KEYS  0x408                /* ARM pointer authentication generic
+                                          keys */
+                                       /*  note name must be "LINUX".  */
 #define NT_ARM_TAGGED_ADDR_CTRL        0x409   /* AArch64 tagged address control
                                           (prctl()) */
                                        /*   note name must be "LINUX".  */
+#define NT_ARM_PAC_ENABLED_KEYS        0x40a   /* AArch64 pointer authentication
+                                          enabled keys (prctl()) */
+                                       /*   note name must be "LINUX".  */
 #define NT_ARC_V2      0x600           /* ARC HS accumulator/extra registers.  */
                                        /*   note name must be "LINUX".  */
 #define NT_RISCV_CSR    0x900          /* RISC-V Control and Status Registers */