This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH] Add alias for kernel's NT_PRFPREG from linux/elf.h.
- From: Carlos O'Donell <carlos_odonell at mentor dot com>
- To: Roland McGrath <roland at hack dot frob dot com>
- Cc: Andreas Krebbel <krebbel at linux dot vnet dot ibm dot com>, Andreas Krebbel<Andreas dot Krebbel at de dot ibm dot com>, Petr Machata <pmachata at redhat dot com>,<libc-alpha at sourceware dot org>
- Date: Thu, 6 Sep 2012 16:20:24 -0400
- Subject: [PATCH] Add alias for kernel's NT_PRFPREG from linux/elf.h.
- References: <5048F96E.3040602@mentor.com> <20120906193444.6B2172C0C4@topped-with-meat.com>
On 9/6/2012 3:34 PM, Roland McGrath wrote:
> Please separate NT_PRFPREG from the others. It needs separate review.
> The NT_S390_* and NT_ARM_* additions are fine without arch maintainer
> sign-off, I think. They match the linux/elf.h values and comments, and
> that is the source of truth for these particular constants.
I've checked in Petr's patch.
Here is the new patch for discussion with a new topic.
The Linux kernel header linux/elf.h defines NT_PRFPREG with a value of 2.
This is the same as the userspace NT_FPREGSET which also has a value of 2.
For all intents and purposes the two macros mean the same thing but have
different macro names.
For example:
x86 uses the note value to write out the core file...
linux/arch/x86/kernel/ptrace.c
~~~
...
[REGSET_FP] = {
.core_note_type = NT_PRFPREG,
.n = sizeof(struct user_i387_struct) / sizeof(long),
.size = sizeof(long), .align = sizeof(long),
.active = xfpregs_active, .get = xfpregs_get, .set = xfpregs_set
},
...
~~~
... and the target independent portions of gdb process it into a section
for the debugger to inspect.
gdb/bfd/elf.c
~~~
...
case NT_FPREGSET: /* FIXME: rename to NT_PRFPREG */
return elfcore_grok_prfpreg (abfd, note);
...
~~~
Note: gdb actually has it's own copies of the NT_* values in include/elf/common.h.
The following patch adds an alias to the user distributed header file elf.h.
2012-09-06 Carlos O'Donell <carlos_odonell@mentor.com>
* elf/elf.h (NT_PRFPREG): New macro.
diff --git a/elf/elf.h b/elf/elf.h
index 41fc3bd..3e488ec 100644
--- a/elf/elf.h
+++ b/elf/elf.h
@@ -601,6 +601,7 @@ typedef struct
#define NT_PRSTATUS 1 /* Contains copy of prstatus struct */
#define NT_FPREGSET 2 /* Contains copy of fpregset struct */
+#define NT_PRFPREG 2 /* Contains copy of fpregset struct */
#define NT_PRPSINFO 3 /* Contains copy of prpsinfo struct */
#define NT_PRXREG 4 /* Contains copy of prxregset struct */
#define NT_TASKSTRUCT 4 /* Contains copy of task structure */
---
OK to checkin?
Cheers,
Carlos.
--
Carlos O'Donell
Mentor Graphics / CodeSourcery
carlos_odonell@mentor.com
carlos@codesourcery.com
+1 (613) 963 1026