aboutsummaryrefslogtreecommitdiff
path: root/contrib/binutils
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/binutils')
-rw-r--r--contrib/binutils/bfd/elf-bfd.h2
-rw-r--r--contrib/binutils/bfd/elf.c38
-rw-r--r--contrib/binutils/binutils/readelf.c2
-rw-r--r--contrib/binutils/include/elf/common.h1
4 files changed, 43 insertions, 0 deletions
diff --git a/contrib/binutils/bfd/elf-bfd.h b/contrib/binutils/bfd/elf-bfd.h
index f4c3a0a3203b..6ac59e1ea84b 100644
--- a/contrib/binutils/bfd/elf-bfd.h
+++ b/contrib/binutils/bfd/elf-bfd.h
@@ -2003,6 +2003,8 @@ extern char * elfcore_write_pstatus
(bfd *, char *, int *, long, int, const void *);
extern char *elfcore_write_prfpreg
(bfd *, char *, int *, const void *, int);
+extern char *elfcore_write_thrmisc
+ (bfd *, char *, int *, const char *, int);
extern char *elfcore_write_prxfpreg
(bfd *, char *, int *, const void *, int);
extern char *elfcore_write_lwpstatus
diff --git a/contrib/binutils/bfd/elf.c b/contrib/binutils/bfd/elf.c
index e8196099c5ce..c4e3d8030a21 100644
--- a/contrib/binutils/bfd/elf.c
+++ b/contrib/binutils/bfd/elf.c
@@ -7443,6 +7443,12 @@ _bfd_elf_rel_vtable_reloc_fn
#ifdef HAVE_SYS_PROCFS_H
# include <sys/procfs.h>
+
+/* Define HAVE_THRMISC_T for consistency with other similar GNU-type stubs. */
+#undef HAVE_THRMISC_T
+#if defined (THRMISC_VERSION)
+#define HAVE_THRMISC_T 1
+#endif
#endif
/* FIXME: this is kinda wrong, but it's what gdb wants. */
@@ -7623,6 +7629,16 @@ elfcore_grok_prxfpreg (bfd *abfd, Elf_Internal_Note *note)
return elfcore_make_note_pseudosection (abfd, ".reg-xfp", note);
}
+#if defined (HAVE_THRMISC_T)
+
+static bfd_boolean
+elfcore_grok_thrmisc (bfd *abfd, Elf_Internal_Note *note)
+{
+ return elfcore_make_note_pseudosection (abfd, ".tname", note);
+}
+
+#endif /* defined (HAVE_THRMISC_T) */
+
#if defined (HAVE_PRPSINFO_T)
typedef prpsinfo_t elfcore_psinfo_t;
#if defined (HAVE_PRPSINFO32_T) /* Sparc64 cross Sparc32 */
@@ -7986,6 +8002,12 @@ elfcore_grok_note (bfd *abfd, Elf_Internal_Note *note)
return TRUE;
}
+
+#if defined (HAVE_THRMISC_T)
+ case NT_THRMISC:
+ return elfcore_grok_thrmisc (abfd, note);
+#endif
+
}
}
@@ -8451,6 +8473,22 @@ elfcore_write_prfpreg (bfd *abfd,
}
char *
+elfcore_write_thrmisc (bfd *abfd,
+ char *buf,
+ int *bufsiz,
+ const char *tname,
+ int size)
+{
+#if defined (HAVE_THRMISC_T)
+ char *note_name = "CORE";
+ return elfcore_write_note (abfd, buf, bufsiz,
+ note_name, NT_THRMISC, tname, size);
+#else
+ return buf;
+#endif
+}
+
+char *
elfcore_write_prxfpreg (bfd *abfd,
char *buf,
int *bufsiz,
diff --git a/contrib/binutils/binutils/readelf.c b/contrib/binutils/binutils/readelf.c
index ab41e28828b1..59a20906acc5 100644
--- a/contrib/binutils/binutils/readelf.c
+++ b/contrib/binutils/binutils/readelf.c
@@ -9103,6 +9103,8 @@ get_note_type (unsigned e_type)
return _("NT_FPREGS (floating point registers)");
case NT_PSINFO:
return _("NT_PSINFO (psinfo structure)");
+ case NT_THRMISC:
+ return _("NT_THRMISC (thrmisc structure)");
case NT_LWPSTATUS:
return _("NT_LWPSTATUS (lwpstatus_t structure)");
case NT_LWPSINFO:
diff --git a/contrib/binutils/include/elf/common.h b/contrib/binutils/include/elf/common.h
index 2eb6853e6669..bb50a5c21ee0 100644
--- a/contrib/binutils/include/elf/common.h
+++ b/contrib/binutils/include/elf/common.h
@@ -388,6 +388,7 @@
#define NT_PRPSINFO 3 /* Contains copy of prpsinfo struct */
#define NT_TASKSTRUCT 4 /* Contains copy of task struct */
#define NT_AUXV 6 /* Contains copy of Elfxx_auxv_t */
+#define NT_THRMISC 7 /* Contains copy of thrmisc struct */
#define NT_PRXFPREG 0x46e62b7f /* Contains a user_xfpregs_struct; */
/* note name must be "LINUX". */