+2019-02-20 Alan Hayward <alan.hayward@arm.com>
+
+ * elf-bfd.h (elfcore_write_aarch_pauth): Add declaration.
+ * elf.c (elfcore_grok_aarch_pauth): New function.
+ (elfcore_grok_note): Check for NT_ARM_PAC_MASK.
+ (elfcore_write_aarch_pauth): New function.
+ (elfcore_write_register_note): Check for AArch64 pauth section.
+
2019-02-20 Alan Modra <amodra@gmail.com>
PR 24225
(bfd *, char *, int *, const void *, int);
extern char *elfcore_write_aarch_sve
(bfd *, char *, int *, const void *, int);
+extern char *elfcore_write_aarch_pauth
+ (bfd *, char *, int *, const void *, int);
extern char *elfcore_write_lwpstatus
(bfd *, char *, int *, long, int, const void *);
extern char *elfcore_write_register_note
return elfcore_make_note_pseudosection (abfd, ".reg-aarch-sve", note);
}
+static bfd_boolean
+elfcore_grok_aarch_pauth (bfd *abfd, Elf_Internal_Note *note)
+{
+ return elfcore_make_note_pseudosection (abfd, ".reg-aarch-pauth", note);
+}
+
#if defined (HAVE_PRPSINFO_T)
typedef prpsinfo_t elfcore_psinfo_t;
#if defined (HAVE_PRPSINFO32_T) /* Sparc64 cross Sparc32 */
else
return TRUE;
+ case NT_ARM_PAC_MASK:
+ if (note->namesz == 6
+ && strcmp (note->namedata, "LINUX") == 0)
+ return elfcore_grok_aarch_pauth (abfd, note);
+ else
+ return TRUE;
+
case NT_PRPSINFO:
case NT_PSINFO:
if (bed->elf_backend_grok_psinfo)
note_name, NT_ARM_SVE, aarch_sve, size);
}
+char *
+elfcore_write_aarch_pauth (bfd *abfd,
+ char *buf,
+ int *bufsiz,
+ const void *aarch_pauth,
+ int size)
+{
+ char *note_name = "LINUX";
+ return elfcore_write_note (abfd, buf, bufsiz,
+ note_name, NT_ARM_PAC_MASK, aarch_pauth, size);
+}
+
char *
elfcore_write_register_note (bfd *abfd,
char *buf,
return elfcore_write_aarch_hw_watch (abfd, buf, bufsiz, data, size);
if (strcmp (section, ".reg-aarch-sve") == 0)
return elfcore_write_aarch_sve (abfd, buf, bufsiz, data, size);
+ if (strcmp (section, ".reg-aarch-pauth") == 0)
+ return elfcore_write_aarch_pauth (abfd, buf, bufsiz, data, size);
return NULL;
}
/* note name must be "LINUX". */
#define NT_ARM_SVE 0x405 /* AArch SVE registers. */
/* note name must be "LINUX". */
+#define NT_ARM_PAC_MASK 0x406 /* AArch pointer authentication code masks */
+ /* note name must be "LINUX". */
#define NT_SIGINFO 0x53494749 /* Fields of siginfo_t. */
#define NT_FILE 0x46494c45 /* Description of mapped files. */