This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] NetBSD ELF core note type pretty-printing for readelf


Hi Jason,

> 2002-01-08  Jason Thorpe  <thorpej@wasabisystems.com>
> 
> 	* readelf.c: Update copyright years.
> 	(get_netbsd_elfcore_note_type): New function.
> 	(process_note): Use get_netbsd_elfcore_note_type to get
> 	the note type string for NetBSD ELF core files.

Approved - please apply.

Coding notes:

> + static char * get_netbsd_elfcore_note_type PARAMS ((unsigned int));

The function could return a "const char *".


> +   if (e_type < 32)

32 appears to be a magic constant for NetBSD core files.  Please
consider replacing it with a meaningfully named #define macro. 


> +   else if (strncmp (pnote->namedata, "NetBSD-CORE", 11) == 0)

Why use strncmp() rather than strcmp().  [This is ignorance on my
part, I do not know very much about the format of the contents of core
files.]  If you must use strncmp then it might be nice to eliminate
the magic nature of the constant 11.  (I know that there are other
places in readelf where strncmp is used in this way too.  They ought
to be changed as well).



Grammar note:

> +   /* There are not currently any other machine-independent notes defined
> +      for NetBSD ELF core files.

A better wording would be:

      /* As of Jan 2002 there are no other machine-independent notes
         defined for NetBSD core files.

Cheers
        Nick


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]