[v3,1/6] Add support to readelf for reading FreeBSD ELF core notes.
Commit Message
On Tuesday, January 19, 2016 05:50:30 PM Christophe Lyon wrote:
> On 18 January 2016 at 03:27, John Baldwin <jhb@freebsd.org> wrote:
> > binutils/ChangeLog:
> >
> > * readelf.c (get_freebsd_elfcore_note_type): New
> > (process_note): Add support for FreeBSD core notes.
> >
> > include/ChangeLog:
> >
> > * elf/common.h (NT_FREEBSD_THRMISC): Define.
> > (NT_FREEBSD_PROCSTAT_PROC): Define.
> > (NT_FREEBSD_PROCSTAT_FILES): Define.
> > (NT_FREEBSD_PROCSTAT_VMMAP): Define.
> > (NT_FREEBSD_PROCSTAT_GROUPS): Define.
> > (NT_FREEBSD_PROCSTAT_UMASK): Define.
> > (NT_FREEBSD_PROCSTAT_RLIMIT): Define.
> > (NT_FREEBSD_PROCSTAT_OSREL): Define.
> > (NT_FREEBSD_PROCSTAT_PSSTRINGS): Define.
> > (NT_FREEBSD_PROCSTAT_AUXV): Define.
> > ---
> > binutils/ChangeLog | 5 +++++
> > binutils/readelf.c | 35 +++++++++++++++++++++++++++++++++++
> > include/ChangeLog | 13 +++++++++++++
> > include/elf/common.h | 14 ++++++++++++++
> > 4 files changed, 67 insertions(+)
> >
> > diff --git a/binutils/ChangeLog b/binutils/ChangeLog
> > index 21dcb2c..47773c9 100644
> > --- a/binutils/ChangeLog
> > +++ b/binutils/ChangeLog
> > @@ -1,3 +1,8 @@
> > +2016-01-09 John Baldwin <jhb@FreeBSD.org>
> > +
> > + * readelf.c (get_freebsd_elfcore_note_type): New
> > + (process_note): Add support for FreeBSD core notes.
> > +
> > 2016-01-01 Alan Modra <amodra@gmail.com>
> >
> > Update year range in copyright notice of all files.
> > diff --git a/binutils/readelf.c b/binutils/readelf.c
> > index 47ac1ad..fa9cda1 100644
> > --- a/binutils/readelf.c
> > +++ b/binutils/readelf.c
> > @@ -15388,6 +15388,37 @@ process_netbsd_elf_note (Elf_Internal_Note * pnote)
> > }
> >
> > static const char *
> > +get_freebsd_elfcore_note_type (unsigned e_type)
> > +{
> > + static char buff[64];
>
> Hi,
>
> This makes the build fail when using -Werror:
>
> ./../binutils/readelf.c: In function 'get_freebsd_elfcore_note_type':
> ../../binutils/readelf.c:15416:15: error: unused variable 'buff'
> [-Werror=unused-variable]
> static char buff[64];
>
> Christophe.
My fault. Is this fix ok to push?
commit 40068dccc4f9c86cb9e7c425c4ab3e272312affb
Author: John Baldwin <jhb@FreeBSD.org>
Date: Tue Jan 19 09:06:33 2016 -0800
Remove an unused variable.
binutils/ChangeLog:
* readelf.c (get_freebsd_elfcore_note_type): Remove unused variable.
Comments
On 01/19/2016 05:08 PM, John Baldwin wrote:
> My fault. Is this fix ok to push?
Please feel free to push this in as an obvious fix.
Thanks,
Pedro Alves
@@ -1,5 +1,9 @@
2016-01-19 John Baldwin <jhb@FreeBSD.org>
+ * readelf.c (get_freebsd_elfcore_note_type): Remove unused variable.
+
+2016-01-19 John Baldwin <jhb@FreeBSD.org>
+
* readelf.c (get_freebsd_elfcore_note_type): New
(process_note): Add support for FreeBSD core notes.
@@ -15413,8 +15413,6 @@ process_netbsd_elf_note (Elf_Internal_Note * pnote)
static const char *
get_freebsd_elfcore_note_type (unsigned e_type)
{
- static char buff[64];
-
switch (e_type)
{
case NT_FREEBSD_THRMISC: