This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH] Use NT_PRFPREG where possible.
- From: Carlos O'Donell <carlos_odonell at mentor dot com>
- To: binutils <binutils at sourceware dot org>
- Date: Fri, 16 Nov 2012 11:17:34 -0500
- Subject: [PATCH] Use NT_PRFPREG where possible.
The note value NT_FPREGSET is a legacy value that was obsoleted
in favour of NT_PRFPREG. The value of NT_FPREGSET and NT_PRFPREG
are the same.
The following patch changes the code in bfd and binutils to
use NT_PRFPREG, but does not change what readelf prints for
the note e.g. NT_FPREGSET. The readelf output change is something
that can only be made once we safely expect that every consumer
can understand NT_PRFPREG.
Given that we are only *just* about to add NT_PRFPREG to glibc's
elf.h, it will be a long time before we can make the change in
the output to readelf.
While glibc's elf.h doesn't have NT_PRFPREG yet that doesn't matter
to binutils since the value is defined in include/elf/common.h.
Tested with no regressions on x86-64.
OK to checkin?
bfd/
2012-10-26 Carlos O'Donell <carlos_odonell@mentor.com>
* elf.c (elfcore_write_prfpreg): Use NT_PRFPREG.
(elfcore_grok_note): Likewise.
Index: bfd/elf.c
===================================================================
RCS file: /cvs/src/src/bfd/elf.c,v
retrieving revision 1.576
diff -u -r1.576 elf.c
--- bfd/elf.c 13 Nov 2012 22:54:21 -0000 1.576
+++ bfd/elf.c 16 Nov 2012 15:32:34 -0000
@@ -8483,7 +8483,7 @@
return elfcore_grok_lwpstatus (abfd, note);
#endif
- case NT_FPREGSET: /* FIXME: rename to NT_PRFPREG */
+ case NT_PRFPREG:
return elfcore_grok_prfpreg (abfd, note);
case NT_WIN32PSTATUS:
@@ -9220,7 +9220,7 @@
{
const char *note_name = "CORE";
return elfcore_write_note (abfd, buf, bufsiz,
- note_name, NT_FPREGSET, fpregs, size);
+ note_name, NT_PRFPREG, fpregs, size);
}
char *
---
binutils/
2012-10-26 Carlos O'Donell <carlos_odonell@mentor.com>
* readelf.c (get_note_type): Use NT_PRFPREG.
Index: binutils/readelf.c
===================================================================
RCS file: /cvs/src/src/binutils/readelf.c,v
retrieving revision 1.588
diff -u -r1.588 readelf.c
--- binutils/readelf.c 16 Nov 2012 12:49:20 -0000 1.588
+++ binutils/readelf.c 16 Nov 2012 15:32:34 -0000
@@ -12771,7 +12771,9 @@
return _("NT_AUXV (auxiliary vector)");
case NT_PRSTATUS:
return _("NT_PRSTATUS (prstatus structure)");
- case NT_FPREGSET:
+ case NT_PRFPREG:
+ /* We can't change the output text to NT_PRFPREG without breaking
+ consumers of this output, so we continue to print the old name. */
return _("NT_FPREGSET (floating point registers)");
case NT_PRPSINFO:
return _("NT_PRPSINFO (prpsinfo structure)");
---
Cheers,
Carlos.
--
Carlos O'Donell
Mentor Graphics / CodeSourcery
carlos_odonell@mentor.com
carlos@codesourcery.com
+1 (613) 963 1026