Re: upcoming elfdump refactoring

From: Luigi Rizzo <rizzo_at_iet.unipi.it>
Date: Mon, 5 Jan 2009 02:01:05 +0100
On Sun, Jan 04, 2009 at 04:29:41PM -0800, Maxim Sobolev wrote:
> Luigi Rizzo wrote:
> >I need to extract value and size of some symbols from an ELF file,
> >and make them available to a C program, something like
> > 
> >    nm -S /boot/kernel/kernel | grep -E "(kernload|kernbase|uscanner_devs)"
> >
> >Rather than using the above tools plus popen() and some parsing code,
> >I have refactored src/usr.bin/elfdump/elfdump.c ,
> >making the main routine externally callable, returning the
> >desired info in a struct rather than print them out.
> >
> >I don't know if/how other programs might need to call elfdump(),
> >but given that the changes I made have no functional or performance
> >drawback, I would like to commit them to the tree.
> >Objections ?
> >
> >(note, the diff will be large because in the process I also removed
> >global variables and staticize/constify things)
> 
> Why not make this function part of libelf?

because i was not aware of its existance (also a reason why I posted
the request - i didn't want to reinvent the wheel).
Thanks for the pointer, I will look at libelf and see if it already
contains soemthing that does what i need.

cheers
luigi
Received on Sun Jan 04 2009 - 23:56:10 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:40 UTC