[binutils-gdb] Implement NT_NETBSDCORE_LWPSTATUS (NetBSD-Core)

Kamil Rytarowski krytarowski@sourceware.org
Fri Mar 13 23:32:03 GMT 2020


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

commit 06d949ec3121f4732e789db1efc53986355c9481
Author: Kamil Rytarowski <n54@gmx.com>
Date:   Fri Mar 13 23:37:10 2020 +0100

    Implement NT_NETBSDCORE_LWPSTATUS (NetBSD-Core)
    
    bfd/ChangeLog:
    
            * elf.c (elfcore_grok_netbsd_note): Add support for
            NT_NETBSDCORE_LWPSTATUS notes.
    
    binutils/ChangeLog:
    
            * readelf.c (get_netbsd_elfcore_note_type): Add support for
            NT_NETBSDCORE_LWPSTATUS notes.
    
    include/ChangeLog:
    
            * elf/common.h (NT_NETBSDCORE_LWPSTATUS): New define.

Diff:
---
 bfd/ChangeLog        | 5 +++++
 bfd/elf.c            | 8 +++++++-
 binutils/ChangeLog   | 5 +++++
 binutils/readelf.c   | 7 ++++++-
 include/ChangeLog    | 6 +++++-
 include/elf/common.h | 1 +
 6 files changed, 29 insertions(+), 3 deletions(-)

diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 84bc1e116ba..23d539c51b5 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,8 @@
+2020-03-13  Kamil Rytarowski  <n54@gmx.com>
+
+	* elf.c (elfcore_grok_netbsd_note): Add support for
+	NT_NETBSDCORE_LWPSTATUS notes.
+
 2020-03-13  Christophe Lyon  <christophe.lyon@linaro.org>
 
 	* bfd-in2.h: Regenerate.
diff --git a/bfd/elf.c b/bfd/elf.c
index 1926ecc8037..c8241cc5799 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -10749,12 +10749,18 @@ elfcore_grok_netbsd_note (bfd *abfd, Elf_Internal_Note *note)
     case NT_NETBSDCORE_AUXV:
       /* NetBSD-specific Elf Auxiliary Vector data. */
       return elfcore_make_auxv_note_section (abfd, note, 4);
+#endif
+#ifdef NT_NETBSDCORE_LWPSTATUS
+    case NT_NETBSDCORE_LWPSTATUS:
+      return elfcore_make_note_pseudosection (abfd,
+					      ".note.netbsdcore.lwpstatus",
+					      note);
 #endif
     default:
       break;
     }
 
-  /* As of March 2017 there are no other machine-independent notes
+  /* As of March 2020 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.  */
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index cafd0762a65..d88ec4dacb2 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,8 @@
+2020-03-13  Kamil Rytarowski  <n54@gmx.com>
+
+	* readelf.c (get_netbsd_elfcore_note_type): Add support for
+	NT_NETBSDCORE_LWPSTATUS notes.
+
 2020-03-13  Alan Modra  <amodra@gmail.com>
 
 	* elfcomm.c (get_archive_member_name): Always return malloc'd
diff --git a/binutils/readelf.c b/binutils/readelf.c
index 4e21bdb56c9..f36883cb645 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -18451,8 +18451,13 @@ get_netbsd_elfcore_note_type (Filedata * filedata, unsigned e_type)
       return _("NetBSD ELF auxiliary vector data");
 #endif
 
+#ifdef NT_NETBSDCORE_LWPSTATUS
+    case NT_NETBSDCORE_LWPSTATUS:
+      return _("PT_LWPSTATUS (ptrace_lwpstatus structure)");
+#endif
+
     default:
-      /* As of Jan 2002 there are no other machine-independent notes
+      /* As of Jan 2020 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.  */
diff --git a/include/ChangeLog b/include/ChangeLog
index f0934c984ca..c19d4d4881c 100644
--- a/include/ChangeLog
+++ b/include/ChangeLog
@@ -1,4 +1,8 @@
-2020-03-13  Kamil Rytarowski  <n54@gmx.de>
+2020-03-13  Kamil Rytarowski  <n54@gmx.com>
+
+	* elf/common.h (NT_NETBSDCORE_LWPSTATUS): New define.
+
+2020-03-13  Kamil Rytarowski  <n54@gmx.com>
 
 	* elf/common.h (NT_NETBSDCORE_AUXV): New define.
 
diff --git a/include/elf/common.h b/include/elf/common.h
index 755c791ad69..1c84ccb430e 100644
--- a/include/elf/common.h
+++ b/include/elf/common.h
@@ -687,6 +687,7 @@
 
 #define NT_NETBSDCORE_PROCINFO	1	/* Has a struct procinfo */
 #define NT_NETBSDCORE_AUXV	2	/* Has auxv data */
+#define NT_NETBSDCORE_LWPSTATUS	24	/* Has LWPSTATUS data */
 #define NT_NETBSDCORE_FIRSTMACH	32	/* start of machdep note types */


More information about the Binutils-cvs mailing list