aboutsummaryrefslogtreecommitdiff
path: root/binutils
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2015-12-13 22:26:19 -0800
committerJohn Baldwin <jhb@FreeBSD.org>2016-01-19 08:15:08 -0800
commitf4ddf30f1108b2c0b3eee5677c912383ac903256 (patch)
tree9c1a43f4889eec4ffeda5cb6a7fb56a8080c6520 /binutils
parent10e3ed9029dc0b6eafcd991d9f292fc079f80cf5 (diff)
downloadgdb-f4ddf30f1108b2c0b3eee5677c912383ac903256.zip
gdb-f4ddf30f1108b2c0b3eee5677c912383ac903256.tar.gz
gdb-f4ddf30f1108b2c0b3eee5677c912383ac903256.tar.bz2
Add support to readelf for reading FreeBSD ELF core notes.
binutils/ChangeLog: * readelf.c (get_freebsd_elfcore_note_type): New (process_note): Add support for FreeBSD core notes. include/ChangeLog: * elf/common.h (NT_FREEBSD_THRMISC): Define. (NT_FREEBSD_PROCSTAT_PROC): Define. (NT_FREEBSD_PROCSTAT_FILES): Define. (NT_FREEBSD_PROCSTAT_VMMAP): Define. (NT_FREEBSD_PROCSTAT_GROUPS): Define. (NT_FREEBSD_PROCSTAT_UMASK): Define. (NT_FREEBSD_PROCSTAT_RLIMIT): Define. (NT_FREEBSD_PROCSTAT_OSREL): Define. (NT_FREEBSD_PROCSTAT_PSSTRINGS): Define. (NT_FREEBSD_PROCSTAT_AUXV): Define.
Diffstat (limited to 'binutils')
-rw-r--r--binutils/ChangeLog5
-rw-r--r--binutils/readelf.c35
2 files changed, 40 insertions, 0 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index 1db49d2..1636045 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,8 @@
+2016-01-19 John Baldwin <jhb@FreeBSD.org>
+
+ * readelf.c (get_freebsd_elfcore_note_type): New
+ (process_note): Add support for FreeBSD core notes.
+
2016-01-18 Miranda Cupertino <Cupertino.Miranda@synopsys.com>
Zissulescu Claudiu <Claudiu.Zissulescu@synopsys.com>
diff --git a/binutils/readelf.c b/binutils/readelf.c
index 7391334..01e3923 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -15411,6 +15411,37 @@ process_netbsd_elf_note (Elf_Internal_Note * pnote)
}
static const char *
+get_freebsd_elfcore_note_type (unsigned e_type)
+{
+ static char buff[64];
+
+ switch (e_type)
+ {
+ case NT_FREEBSD_THRMISC:
+ return _("NT_THRMISC (thrmisc structure)");
+ case NT_FREEBSD_PROCSTAT_PROC:
+ return _("NT_PROCSTAT_PROC (proc data)");
+ case NT_FREEBSD_PROCSTAT_FILES:
+ return _("NT_PROCSTAT_FILES (files data)");
+ case NT_FREEBSD_PROCSTAT_VMMAP:
+ return _("NT_PROCSTAT_VMMAP (vmmap data)");
+ case NT_FREEBSD_PROCSTAT_GROUPS:
+ return _("NT_PROCSTAT_GROUPS (groups data)");
+ case NT_FREEBSD_PROCSTAT_UMASK:
+ return _("NT_PROCSTAT_UMASK (umask data)");
+ case NT_FREEBSD_PROCSTAT_RLIMIT:
+ return _("NT_PROCSTAT_RLIMIT (rlimit data)");
+ case NT_FREEBSD_PROCSTAT_OSREL:
+ return _("NT_PROCSTAT_OSREL (osreldate data)");
+ case NT_FREEBSD_PROCSTAT_PSSTRINGS:
+ return _("NT_PROCSTAT_PSSTRINGS (ps_strings data)");
+ case NT_FREEBSD_PROCSTAT_AUXV:
+ return _("NT_PROCSTAT_AUXV (auxv data)");
+ }
+ return get_note_type (e_type);
+}
+
+static const char *
get_netbsd_elfcore_note_type (unsigned e_type)
{
static char buff[64];
@@ -15659,6 +15690,10 @@ process_note (Elf_Internal_Note * pnote)
/* GNU-specific object file notes. */
nt = get_gnu_elf_note_type (pnote->type);
+ else if (const_strneq (pnote->namedata, "FreeBSD"))
+ /* FreeBSD-specific core file notes. */
+ nt = get_freebsd_elfcore_note_type (pnote->type);
+
else if (const_strneq (pnote->namedata, "NetBSD-CORE"))
/* NetBSD-specific core file notes. */
nt = get_netbsd_elfcore_note_type (pnote->type);