[binutils-gdb] Add support to readelf to display NetBSD auxv notes in core files.

Nick Clifton nickc@sourceware.org
Wed Jun 12 12:52:00 GMT 2019


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=540e617049db92b4371fa90cadd4cd994508f86d

commit 540e617049db92b4371fa90cadd4cd994508f86d
Author: Christos Zoulas <christos@zoulas.com>
Date:   Wed Jun 12 13:52:04 2019 +0100

    Add support to readelf to display NetBSD auxv notes in core files.
    
    	PR 24664
    	* readelf.c (get_netbsd_elfcore_note_type): Add support for NetBSD
    	auxv notes.

Diff:
---
 binutils/ChangeLog |  6 ++++++
 binutils/readelf.c | 31 +++++++++++++++++++++----------
 2 files changed, 27 insertions(+), 10 deletions(-)

diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index 2b6d402..7bfa6d1 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,9 @@
+2019-06-12  Christos Zoulas  <christos@zoulas.com>
+
+	PR 24664
+	* readelf.c (get_netbsd_elfcore_note_type): Add support for NetBSD
+	auxv notes.
+
 2019-06-11  Christos Zoulas  <christos@zoulas.com>
 
 	PR 24662
diff --git a/binutils/readelf.c b/binutils/readelf.c
index 8933ccb..5e970bb 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -18122,18 +18122,29 @@ get_netbsd_elfcore_note_type (Filedata * filedata, unsigned e_type)
 {
   static char buff[64];
 
-  if (e_type == NT_NETBSDCORE_PROCINFO)
-    return _("NetBSD procinfo structure");
+  switch (e_type)
+    {
+    case NT_NETBSDCORE_PROCINFO:
+      /* NetBSD core "procinfo" structure.  */
+      return _("NetBSD procinfo structure");
 
-  /* As of Jan 2002 there are no other machine-independent notes
-     defined for NetBSD core files.  If the note type is less
-     than the start of the machine-dependent note types, we don't
-     understand it.  */
+#ifdef NT_NETBSDCORE_AUXV
+    case NT_NETBSDCORE_AUXV:
+      return _("NetBSD ELF auxiliary vector data");
+#endif
 
-  if (e_type < NT_NETBSDCORE_FIRSTMACH)
-    {
-      snprintf (buff, sizeof (buff), _("Unknown note type: (0x%08x)"), e_type);
-      return buff;
+    default:
+      /* As of Jan 2002 there are no other machine-independent notes
+	 defined for NetBSD core files.  If the note type is less
+	 than the start of the machine-dependent note types, we don't
+	 understand it.  */
+
+      if (e_type < NT_NETBSDCORE_FIRSTMACH)
+	{
+	  snprintf (buff, sizeof (buff), _("Unknown note type: (0x%08x)"), e_type);
+	  return buff;
+	}
+      break;
     }
 
   switch (filedata->file_header.e_machine)



More information about the Binutils-cvs mailing list