From owner-freebsd-current@FreeBSD.ORG Mon Jan 5 09:16:40 2009 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 010DE106564A; Mon, 5 Jan 2009 09:16:40 +0000 (UTC) (envelope-from danny@cs.huji.ac.il) Received: from kabab.cs.huji.ac.il (kabab.cs.huji.ac.il [132.65.16.84]) by mx1.freebsd.org (Postfix) with ESMTP id AB1F08FC08; Mon, 5 Jan 2009 09:16:39 +0000 (UTC) (envelope-from danny@cs.huji.ac.il) Received: from pampa.cs.huji.ac.il ([132.65.80.32]) by kabab.cs.huji.ac.il with esmtp id 1LJlF1-000L2y-Cv; Mon, 05 Jan 2009 10:55:19 +0200 X-Mailer: exmh version 2.7.2 01/07/2005 with nmh-1.2 To: Luigi Rizzo In-reply-to: <20090105010105.GA47387@onelab2.iet.unipi.it> References: <20090104234238.GA44381@onelab2.iet.unipi.it> <49615475.2030803@FreeBSD.org> <20090105010105.GA47387@onelab2.iet.unipi.it> Comments: In-reply-to Luigi Rizzo message dated "Mon, 05 Jan 2009 02:01:05 +0100." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Mon, 05 Jan 2009 10:55:19 +0200 From: Danny Braniss Message-ID: Cc: current@freebsd.org Subject: Re: upcoming elfdump refactoring X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Jan 2009 09:16:40 -0000 > 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. > while you are at it, can you check why there is a null when you do: config -x kernel ie: sunfire> config -x /boot/kernel/kernel | grep device Binary file (standard input) matches sunfire> config -x /boot/kernel/kernel | cat -v| tail device cue device kue device rue device firewire device sbp device fwe device fwip device dcons device dcons_crom ^@sunfire> i think the libelf is involved. > cheers > luigi > _______________________________________________ > freebsd-current@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org" >