aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Thorpe <thorpej@netbsd.org>2002-01-09 18:59:11 +0000
committerJason Thorpe <thorpej@netbsd.org>2002-01-09 18:59:11 +0000
commitb4db1224b76fe25c9770904953491be0e51cb9fb (patch)
tree549855e99e7e9245bff9809080cf9b675838fa4c
parentc564377feab16bc2fda4424625f23813186c3e8c (diff)
downloadgdb-b4db1224b76fe25c9770904953491be0e51cb9fb.zip
gdb-b4db1224b76fe25c9770904953491be0e51cb9fb.tar.gz
gdb-b4db1224b76fe25c9770904953491be0e51cb9fb.tar.bz2
include/elf:
* common.h: Update copyright years. (NT_NETBSDCORE_PROCINFO): Define. (NT_NETBSDCORE_FIRSTMACH): Define. bfd: * elf.c: Update copyright years. (elfcore_grok_netbsd_note): Use NT_NETBSDCORE_PROCINFO and NT_NETBSDCORE_FIRSTMACH. Improve a comment. bintuils: * readelf.c (get_netbsd_elfcore_note_type): Use NT_NETBSDCORE_PROCINFO and NT_NETBSDCORE_FIRSTMACH.
-rw-r--r--bfd/ChangeLog6
-rw-r--r--bfd/elf.c19
-rw-r--r--binutils/ChangeLog5
-rw-r--r--binutils/readelf.c18
-rw-r--r--include/elf/ChangeLog6
-rw-r--r--include/elf/common.h10
6 files changed, 47 insertions, 17 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 7013b7d..24af6fd 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,9 @@
+2002-01-09 Jason Thorpe <thorpej@wasabisystems.com>
+
+ * elf.c: Update copyright years.
+ (elfcore_grok_netbsd_note): Use NT_NETBSDCORE_PROCINFO
+ and NT_NETBSDCORE_FIRSTMACH. Improve a comment.
+
2002-01-08 Michael Snyder <msnyder@redhat.com>
Add capability to write corefile note sections, for gdb.
diff --git a/bfd/elf.c b/bfd/elf.c
index ed2396e..1dd7d7d 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -6432,7 +6432,7 @@ elfcore_grok_netbsd_note (abfd, note)
if (elfcore_netbsd_get_lwpid (note, &lwp))
elf_tdata (abfd)->core_lwpid = lwp;
- if (note->type == 1)
+ if (note->type == NT_NETBSDCORE_PROCINFO)
{
/* NetBSD-specific core "procinfo". Note that we expect to
find this note before any of the others, which is fine,
@@ -6442,11 +6442,12 @@ elfcore_grok_netbsd_note (abfd, note)
return elfcore_grok_netbsd_procinfo (abfd, note);
}
- /* There are not currently any other machine-independent notes defined
- for NetBSD ELF core files. If the note type is less than the start
- of the machine-dependent note types, we don't understand it. */
+ /* 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 (note->type < 32)
+ if (note->type < NT_NETBSDCORE_FIRSTMACH)
return true;
@@ -6459,10 +6460,10 @@ elfcore_grok_netbsd_note (abfd, note)
case bfd_arch_sparc:
switch (note->type)
{
- case 32+0:
+ case NT_NETBSDCORE_FIRSTMACH+0:
return elfcore_make_note_pseudosection (abfd, ".reg", note);
- case 32+2:
+ case NT_NETBSDCORE_FIRSTMACH+2:
return elfcore_make_note_pseudosection (abfd, ".reg2", note);
default:
@@ -6475,10 +6476,10 @@ elfcore_grok_netbsd_note (abfd, note)
default:
switch (note->type)
{
- case 32+1:
+ case NT_NETBSDCORE_FIRSTMACH+1:
return elfcore_make_note_pseudosection (abfd, ".reg", note);
- case 32+3:
+ case NT_NETBSDCORE_FIRSTMACH+3:
return elfcore_make_note_pseudosection (abfd, ".reg2", note);
default:
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index 574ced0..51b9bfc 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,5 +1,10 @@
2002-01-09 Jason Thorpe <thorpej@wasabisystems.com>
+ * readelf.c (get_netbsd_elfcore_note_type): Use
+ NT_NETBSDCORE_PROCINFO and NT_NETBSDCORE_FIRSTMACH.
+
+2002-01-09 Jason Thorpe <thorpej@wasabisystems.com>
+
* readelf.c: Update copyright years.
(get_note_type): Return a const char *.
(get_netbsd_elfcore_note_type): New function.
diff --git a/binutils/readelf.c b/binutils/readelf.c
index 6eddf7e..7ac891f 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -9087,7 +9087,7 @@ get_netbsd_elfcore_note_type (e_type)
{
static char buff[64];
- if (e_type == 1)
+ if (e_type == NT_NETBSDCORE_PROCINFO)
{
/* NetBSD core "procinfo" structure. */
return _("NetBSD procinfo structure");
@@ -9098,7 +9098,7 @@ get_netbsd_elfcore_note_type (e_type)
than the start of the machine-dependent note types, we don't
understand it. */
- if (e_type < 32)
+ if (e_type < NT_NETBSDCORE_FIRSTMACH)
{
sprintf (buff, _("Unknown note type: (0x%08x)"), e_type);
return buff;
@@ -9116,8 +9116,10 @@ get_netbsd_elfcore_note_type (e_type)
case EM_SPARCV9:
switch (e_type)
{
- case 32+0: return _("PT_GETREGS (reg structure)");
- case 32+2: return _("PT_GETFPREGS (fpreg structure)");
+ case NT_NETBSDCORE_FIRSTMACH+0:
+ return _("PT_GETREGS (reg structure)");
+ case NT_NETBSDCORE_FIRSTMACH+2:
+ return _("PT_GETFPREGS (fpreg structure)");
default:
break;
}
@@ -9128,14 +9130,16 @@ get_netbsd_elfcore_note_type (e_type)
default:
switch (e_type)
{
- case 32+1: return _("PT_GETREGS (reg structure)");
- case 32+3: return _("PT_GETFPREGS (fpreg structure)");
+ case NT_NETBSDCORE_FIRSTMACH+1:
+ return _("PT_GETREGS (reg structure)");
+ case NT_NETBSDCORE_FIRSTMACH+3:
+ return _("PT_GETFPREGS (fpreg structure)");
default:
break;
}
}
- sprintf (buff, _("PT_FIRSTMACH+%d"), e_type - 32);
+ sprintf (buff, _("PT_FIRSTMACH+%d"), e_type - NT_NETBSDCORE_FIRSTMACH);
return buff;
}
diff --git a/include/elf/ChangeLog b/include/elf/ChangeLog
index 068a4b6..ae780e2 100644
--- a/include/elf/ChangeLog
+++ b/include/elf/ChangeLog
@@ -1,3 +1,9 @@
+2002-01-09 Jason Thorpe <thorpej@wasabisystems.com>
+
+ * common.h: Update copyright years.
+ (NT_NETBSDCORE_PROCINFO): Define.
+ (NT_NETBSDCORE_FIRSTMACH): Define.
+
2002-01-06 Steve Ellcey <sje@cup.hp.com>
* ia64.h (ELF_STRING_ia64_unwind_hdr): New Macro for HP-UX.
diff --git a/include/elf/common.h b/include/elf/common.h
index 39ba05a..289d3f2 100644
--- a/include/elf/common.h
+++ b/include/elf/common.h
@@ -1,6 +1,6 @@
/* ELF support for BFD.
Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
- 2001
+ 2001, 2002
Free Software Foundation, Inc.
Written by Fred Fish @ Cygnus Support, from information published
@@ -342,6 +342,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define NT_LWPSINFO 17 /* Has a struct lwpsinfo_t */
#define NT_WIN32PSTATUS 18 /* Has a struct win32_pstatus */
+
+/* Note segments for core files on NetBSD systems. Note name
+ must start with "NetBSD-CORE". */
+
+#define NT_NETBSDCORE_PROCINFO 1 /* Has a struct procinfo */
+#define NT_NETBSDCORE_FIRSTMACH 32 /* start of machdep note types */
+
+
/* Values of note segment descriptor types for object files. */
#define NT_VERSION 1 /* Contains a version string. */