Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: <srinath.parvathaneni@arm.com>
To: <gdb-patches@sourceware.org>
Cc: <thiago.bauermann@linaro.org>, <luis.machado.foss@gmail.com>,
	<guinevere@redhat.com>, <Ezra.Sitorus@arm.com>,
	<Matthieu.Longo@arm.com>,
	Srinath Parvathaneni <srinath.parvathaneni@arm.com>
Subject: [PATCH v2 5/7] bfd/readelf: Add core file support for FEAT_S1POE
Date: Fri, 26 Jun 2026 18:08:19 +0000	[thread overview]
Message-ID: <20260626180821.376406-6-srinath.parvathaneni@arm.com> (raw)
In-Reply-To: <20260626180821.376406-1-srinath.parvathaneni@arm.com>

From: Srinath Parvathaneni <srinath.parvathaneni@arm.com>

Add support for `NT_ARM_POE` dumps/reads for core files.
---
 bfd/elf.c          | 25 +++++++++++++++++++++++++
 binutils/readelf.c |  2 ++
 2 files changed, 27 insertions(+)

diff --git a/bfd/elf.c b/bfd/elf.c
index c9a68404e9d..c7f557b8be6 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -64,6 +64,7 @@ SECTION
 /* Names of a pseudo-section which represent core notes.  */
 #define NOTE_PSEUDO_SECTION_AARCH_FPMR		".reg-aarch-fpmr"
 #define NOTE_PSEUDO_SECTION_AARCH_GCS		".reg-aarch-gcs"
+#define NOTE_PSEUDO_SECTION_AARCH_POE		".reg-aarch-poe"
 #define NOTE_PSEUDO_SECTION_AARCH_HW_BREAK	".reg-aarch-hw-break"
 #define NOTE_PSEUDO_SECTION_AARCH_HW_WATCH	".reg-aarch-hw-watch"
 #define NOTE_PSEUDO_SECTION_AARCH_MTE		".reg-aarch-mte"
@@ -10735,6 +10736,15 @@ elfcore_grok_aarch_gcs (bfd *abfd, Elf_Internal_Note *note)
   return elfcore_make_note_pseudosection (abfd, NOTE_PSEUDO_SECTION_AARCH_GCS, note);
 }
 
+/* Convert NOTE into a bfd_section called ".reg-aarch-poe".  Return TRUE if
+   successful, otherwise return FALSE.  */
+
+static bool
+elfcore_grok_aarch_poe (bfd *abfd, Elf_Internal_Note *note)
+{
+  return elfcore_make_note_pseudosection (abfd, NOTE_PSEUDO_SECTION_AARCH_POE, note);
+}
+
 /* Convert NOTE into the appropriate note pseudo-section for the AArch64 FPMR.
  * Return TRUE if successful, otherwise return FALSE.  */
 
@@ -11179,6 +11189,7 @@ elfcore_grok_note (bfd *abfd, Elf_Internal_Note *note)
 	case NT_ARC_V2:		return elfcore_grok_arc_v2 (abfd, note);
 	case NT_ARM_FPMR:	return elfcore_grok_aarch_fpmr (abfd, note);
 	case NT_ARM_GCS:	return elfcore_grok_aarch_gcs (abfd, note);
+	case NT_ARM_POE:	return elfcore_grok_aarch_poe (abfd, note);
 	case NT_ARM_HW_BREAK:	return elfcore_grok_aarch_hw_break (abfd, note);
 	case NT_ARM_HW_WATCH:	return elfcore_grok_aarch_hw_watch (abfd, note);
 	case NT_ARM_PAC_MASK:	return elfcore_grok_aarch_pauth (abfd, note);
@@ -12900,6 +12911,19 @@ elfcore_write_aarch_gcs (bfd *abfd, char *buf, int *bufsiz,
 			     aarch_gcs, size);
 }
 
+/* Write the buffer of POE register values in AARCH_POE (length SIZE) into
+   the note buffer BUF and update *BUFSIZ.  ABFD is the bfd the note is being
+   written into.  Return a pointer to the new start of the note buffer, to
+   replace BUF which may no longer be valid.  */
+
+static char *
+elfcore_write_aarch_poe (bfd *abfd, char *buf, int *bufsiz,
+			 const void *aarch_poe, int size)
+{
+  return elfcore_write_note (abfd, buf, bufsiz, NOTE_NAME_LINUX, NT_ARM_POE,
+			     aarch_poe, size);
+}
+
 /* Write the buffer of FPMR value in AARCH_FPMR (length SIZE) into
    the note buffer BUF and update *BUFSIZ.  ABFD is the bfd the note is being
    written into.  Return a pointer to the new start of the note buffer, to
@@ -13024,6 +13048,7 @@ elfcore_write_register_note (bfd *abfd,
     {
       { NOTE_PSEUDO_SECTION_AARCH_FPMR,       elfcore_write_aarch_fpmr},
       { NOTE_PSEUDO_SECTION_AARCH_GCS,        elfcore_write_aarch_gcs},
+      { NOTE_PSEUDO_SECTION_AARCH_POE,        elfcore_write_aarch_poe},
       { NOTE_PSEUDO_SECTION_AARCH_HW_BREAK,   elfcore_write_aarch_hw_break},
       { NOTE_PSEUDO_SECTION_AARCH_HW_WATCH,   elfcore_write_aarch_hw_watch},
       { NOTE_PSEUDO_SECTION_AARCH_MTE,        elfcore_write_aarch_mte},
diff --git a/binutils/readelf.c b/binutils/readelf.c
index bf27f9eec23..61354d7ab11 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -21915,6 +21915,8 @@ get_note_type (Filedata * filedata, unsigned e_type)
 	return _("NT_ARM_PAC_ENABLED_KEYS (AArch64 pointer authentication enabled keys)");
       case NT_ARM_FPMR:
 	return _("NT_ARM_FPMR (AArch64 Floating Point Mode Register)");
+      case NT_ARM_POE:
+	return _("NT_ARM_POE (AArch64 Permission Overlay Extension Register)");
       case NT_ARC_V2:
 	return _("NT_ARC_V2 (ARC HS accumulator/extra registers)");
       case NT_RISCV_CSR:
-- 
2.43.0


  parent reply	other threads:[~2026-06-26 18:12 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-26 18:08 [PATCH v2 0/7] gdb/aarch64: Add support for FEAT_S1POE feature srinath.parvathaneni
2026-06-26 18:08 ` [PATCH v2 1/7] gdb/aarch64: Add POR_EL0 register support for FEAT_S1POE srinath.parvathaneni
2026-06-27  6:06   ` Thiago Jung Bauermann
2026-06-29 10:44     ` Srinath Parvathaneni
2026-07-01  5:16       ` Thiago Jung Bauermann
2026-07-01 14:45         ` Marc Zyngier
2026-06-26 18:08 ` [PATCH v2 2/7] gdb/aarch64: Add custom printing for POR_EL0 srinath.parvathaneni
2026-06-27  7:03   ` Thiago Jung Bauermann
2026-06-29  7:02     ` Srinath Parvathaneni
2026-06-29 15:58       ` Ezra Sitorus
2026-06-26 18:08 ` [PATCH v2 3/7] gdb: Improve SIGSEGV diagnostics for POE faults srinath.parvathaneni
2026-06-29  2:42   ` Thiago Jung Bauermann
2026-06-26 18:08 ` [PATCH v2 4/7] gdbserver/aarch64: Add POR_EL0 register support srinath.parvathaneni
2026-06-29  2:43   ` Thiago Jung Bauermann
2026-06-26 18:08 ` srinath.parvathaneni [this message]
2026-06-29  2:43   ` [PATCH v2 5/7] bfd/readelf: Add core file support for FEAT_S1POE Thiago Jung Bauermann
2026-06-26 18:08 ` [PATCH v2 6/7] gdb/aarch64: " srinath.parvathaneni
2026-06-29  2:44   ` Thiago Jung Bauermann
2026-06-26 18:08 ` [PATCH v2 7/7] gdb/testsuite: Add FEAT_S1POE testcases srinath.parvathaneni
2026-07-01  5:12   ` Thiago Jung Bauermann
2026-06-29 12:18 ` [PATCH v2 0/7] gdb/aarch64: Add support for FEAT_S1POE feature Guinevere Larsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260626180821.376406-6-srinath.parvathaneni@arm.com \
    --to=srinath.parvathaneni@arm.com \
    --cc=Ezra.Sitorus@arm.com \
    --cc=Matthieu.Longo@arm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=guinevere@redhat.com \
    --cc=luis.machado.foss@gmail.com \
    --cc=thiago.bauermann@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox