aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2010-02-02 12:37:40 +0000
committerH.J. Lu <hjl.tools@gmail.com>2010-02-02 12:37:40 +0000
commit4339cae0bb39a38117d51fc52066e659dccaee29 (patch)
tree46d30d4f07656095d9d0d9f07e837d99da10c239 /bfd
parent0718675c768e5a5d2fc96a6a4e70cd52fe148c16 (diff)
downloadgdb-4339cae0bb39a38117d51fc52066e659dccaee29.zip
gdb-4339cae0bb39a38117d51fc52066e659dccaee29.tar.gz
gdb-4339cae0bb39a38117d51fc52066e659dccaee29.tar.bz2
Add NT_386_XSTATE.
bfd/ 2010-02-02 H.J. Lu <hongjiu.lu@intel.com> * elf-bfd.h (elfcore_write_xstatereg): New. * elf.c (elfcore_grok_xstatereg): New. (elfcore_write_xstatereg): Likewise. (elfcore_grok_note): Handle NT_X86_XSTATE. (elfcore_write_register_note): Handle .reg-xstate section. binutils/ 2010-02-02 H.J. Lu <hongjiu.lu@intel.com> * readelf.c (get_note_type): Handle NT_X86_XSTATE. include/elf/ 2010-02-02 H.J. Lu <hongjiu.lu@intel.com> * common.h (NT_386_XSTATE): New.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog9
-rw-r--r--bfd/elf-bfd.h2
-rw-r--r--bfd/elf.c28
3 files changed, 39 insertions, 0 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 7e1f1c2..791ec74 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,12 @@
+2010-02-02 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elf-bfd.h (elfcore_write_xstatereg): New.
+
+ * elf.c (elfcore_grok_xstatereg): New.
+ (elfcore_write_xstatereg): Likewise.
+ (elfcore_grok_note): Handle NT_X86_XSTATE.
+ (elfcore_write_register_note): Handle .reg-xstate section.
+
2010-02-01 Tristan Gingold <gingold@adacore.com>
* som.c (som_write_ar_hdr): Define this macro.
diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h
index daa2b62..3c3ac9b 100644
--- a/bfd/elf-bfd.h
+++ b/bfd/elf-bfd.h
@@ -2149,6 +2149,8 @@ extern char *elfcore_write_prfpreg
(bfd *, char *, int *, const void *, int);
extern char *elfcore_write_prxfpreg
(bfd *, char *, int *, const void *, int);
+extern char *elfcore_write_xstatereg
+ (bfd *, char *, int *, const void *, int);
extern char *elfcore_write_ppc_vmx
(bfd *, char *, int *, const void *, int);
extern char *elfcore_write_ppc_vsx
diff --git a/bfd/elf.c b/bfd/elf.c
index 19e4695..c176256 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -7628,6 +7628,16 @@ elfcore_grok_prxfpreg (bfd *abfd, Elf_Internal_Note *note)
return elfcore_make_note_pseudosection (abfd, ".reg-xfp", note);
}
+/* Linux dumps the Intel XSAVE extended state in a note named "LINUX"
+ with a note type of NT_X86_XSTATE. Just include the whole note's
+ contents literally. */
+
+static bfd_boolean
+elfcore_grok_xstatereg (bfd *abfd, Elf_Internal_Note *note)
+{
+ return elfcore_make_note_pseudosection (abfd, ".reg-xstate", note);
+}
+
static bfd_boolean
elfcore_grok_ppc_vmx (bfd *abfd, Elf_Internal_Note *note)
{
@@ -7996,6 +8006,13 @@ elfcore_grok_note (bfd *abfd, Elf_Internal_Note *note)
else
return TRUE;
+ case NT_X86_XSTATE: /* Linux XSAVE extension */
+ if (note->namesz == 6
+ && strcmp (note->namedata, "LINUX") == 0)
+ return elfcore_grok_xstatereg (abfd, note);
+ else
+ return TRUE;
+
case NT_PPC_VMX:
if (note->namesz == 6
&& strcmp (note->namedata, "LINUX") == 0)
@@ -8636,6 +8653,15 @@ elfcore_write_prxfpreg (bfd *abfd,
}
char *
+elfcore_write_xstatereg (bfd *abfd, char *buf, int *bufsiz,
+ const void *xfpregs, int size)
+{
+ char *note_name = "LINUX";
+ return elfcore_write_note (abfd, buf, bufsiz,
+ note_name, NT_X86_XSTATE, xfpregs, size);
+}
+
+char *
elfcore_write_ppc_vmx (bfd *abfd,
char *buf,
int *bufsiz,
@@ -8684,6 +8710,8 @@ elfcore_write_register_note (bfd *abfd,
return elfcore_write_prfpreg (abfd, buf, bufsiz, data, size);
if (strcmp (section, ".reg-xfp") == 0)
return elfcore_write_prxfpreg (abfd, buf, bufsiz, data, size);
+ if (strcmp (section, ".reg-xstate") == 0)
+ return elfcore_write_xstatereg (abfd, buf, bufsiz, data, size);
if (strcmp (section, ".reg-ppc-vmx") == 0)
return elfcore_write_ppc_vmx (abfd, buf, bufsiz, data, size);
if (strcmp (section, ".reg-ppc-vsx") == 0)