This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [patch] Add external symbol table file support for gprof
- From: Nick Clifton <nickc at redhat dot com>
- To: Dongsheng Xing <homer dot xing at yahoo dot com>
- Cc: binutils at sourceware dot org
- Date: Tue, 05 May 2009 10:04:54 +0100
- Subject: Re: [patch] Add external symbol table file support for gprof
- References: <649291.29334.qm@web43409.mail.sp1.yahoo.com>
Hi Homer,
The attached patch adds support for external symbol table file in gprof.
"external symbol table file" is a file such as /proc/kallsyms , or a
file generated by "nm a.out".
Thanks very much for submitting this patch. There are a few issues with
it however that need to be addressed before we can accept it into the
binutils sources:
* You need a binutils copyright assignment on file with the FSF.
* The code needs to be more paranoid:
Check the return values of all system calls.
Never read information into fixed length buffers without passing
the buffer size as a parameter to the function performing the read.
Plus, put fixed length buffers into the data section rather than
on the stack.
* The "nm" program can produce output in several different formats.
It would be useful if your code could handle all of these formats, or
failing that, that it could detect the formats that it does not handle
and issue a warning message.
* You open the same file twice, which is inefficient. It would be
better to open it only once even if it is still necessary to scan it twice.
* A new feature like this needs to be described in the
gprof/gprof.texi file. It would also be helpful to add an entry to the
binutils/NEWS file mentioning this new feature.
Cheers
Nick