[patch] Add external symbol table file support for gprof

Nick Clifton nickc@redhat.com
Tue May 5 09:05:00 GMT 2009


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




More information about the Binutils mailing list