aboutsummaryrefslogtreecommitdiff
path: root/binutils
diff options
context:
space:
mode:
authorFrederic Cambus <fred@statdns.com>2021-09-11 23:30:22 +0200
committerAlan Modra <amodra@gmail.com>2021-09-30 10:00:57 +0930
commit98ca73afe51e1e921915c37f242c88d4d445841c (patch)
tree6157a6bee913cbf92e6a7a50ead7e8fc3a44fe24 /binutils
parentf141837642f08eb13f4476d85bbe69d76252abd3 (diff)
downloadgdb-98ca73afe51e1e921915c37f242c88d4d445841c.zip
gdb-98ca73afe51e1e921915c37f242c88d4d445841c.tar.gz
gdb-98ca73afe51e1e921915c37f242c88d4d445841c.tar.bz2
Add support to readelf for reading OpenBSD ELF core notes.
* readelf.c (get_openbsd_elfcore_note_type): New function. (process_note): Add support for OpenBSD core notes.
Diffstat (limited to 'binutils')
-rw-r--r--binutils/readelf.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/binutils/readelf.c b/binutils/readelf.c
index 4a6fcff..3b6f1a3 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -19990,6 +19990,26 @@ get_netbsd_elfcore_note_type (Filedata * filedata, unsigned e_type)
}
static const char *
+get_openbsd_elfcore_note_type (Filedata * filedata, unsigned e_type)
+{
+ switch (e_type)
+ {
+ case NT_OPENBSD_PROCINFO:
+ return _("OpenBSD procinfo structure");
+ case NT_OPENBSD_AUXV:
+ return _("OpenBSD ELF auxiliary vector data");
+ case NT_OPENBSD_REGS:
+ return _("OpenBSD regular registers");
+ case NT_OPENBSD_FPREGS:
+ return _("OpenBSD floating point registers");
+ case NT_OPENBSD_WCOOKIE:
+ return _("OpenBSD window cookie");
+ }
+
+ return get_note_type (filedata, e_type);
+}
+
+static const char *
get_stapsdt_note_type (unsigned e_type)
{
static char buff[64];
@@ -20770,6 +20790,10 @@ process_note (Elf_Internal_Note * pnote,
/* NetBSD-specific core file notes. */
return process_netbsd_elf_note (pnote);
+ else if (startswith (pnote->namedata, "OpenBSD"))
+ /* OpenBSD-specific core file notes. */
+ nt = get_openbsd_elfcore_note_type (filedata, pnote->type);
+
else if (startswith (pnote->namedata, "SPU/"))
{
/* SPU-specific core file notes. */