This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
Re: patch for readelf - dumping NOTE sections
- To: fnf at www dot ninemoons dot com
- Subject: Re: patch for readelf - dumping NOTE sections
- From: Nick Clifton <nickc at cygnus dot com>
- Date: Thu, 25 Nov 1999 11:06:23 GMT
- CC: binutils at sourceware dot cygnus dot com, fnf at cygnus dot com
Hi Fred,
: + 1999-11-24 Fred Fish <fnf@cygnus.com>
: +
: + * readelf.c (process_note): Change arg from Elf_External_Note
: + to Elf32_Internal_Note, which also turns the function body
: + into little more than a call to printf.
: + (process_corefile_note_segment): Substantially rewritten
: + to properly handle case where target and host are different
: + endianness, handle note sections with padding, and add some
: + cruft to handle notes with unterminated name data.
: +
Thanks for this patch. I do however have a few comments:
* The normal convention is just submit the ChangeLog entry as
straight text, not a context diff. This is because ChangeLogs
change so rapidly that it is often impossible to apply a ChangeLog
patch automatically.
* Your patch contained a potential memory leak, in that if the
malloc of temp failed the code would return without freeing
pnotes. I have fixed this.
* The was also a potential memory corruption bug in that you used
strcpy() to copy the un-null-terminated name string into temp.
This could easily extend over the end of the memory allocated for
temp. I have fixed this by using strncpy() to copy the name and
then forcing the last byte of the array to zero.
Apart from that the patch was fine and I have gone ahead and checked
it in.
Cheers
Nick