This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
Re: nlist using bfd
- To: phdm at macqel dot be
- Subject: Re: nlist using bfd
- From: Ian Lance Taylor <ian at zembu dot com>
- Date: 6 Apr 2000 14:26:51 -0700
- CC: binutils at sourceware dot cygnus dot com
- References: <200004061655.SAA31889@mail.macqel.be>
Date: Thu, 6 Apr 2000 18:55:54 +0200 (CEST)
From: "Philippe De Muyter" <phdm@macqel.be>
I noticed that the startup of my gdb is slow, and found out that it uses
nlist() to find the value of the `u' kernel symbol. The native `nlist'
is slow, because it does a `read' system call for each `COFF' entry.
I think we should rather use `bfd' for that purpose, but I do not want
to reinvent the wheel, so here is my question :
Can somebody point me to an already written a `nlist' replacement
using bfd, or sketch one off-hand ?
BFD doesn't provide an nlist replacement. BFD provides a generic
interface to object files. A specific nlist interface is generally
specific to a particular object file format.
The closest equivalent BFD has is bfd_get_symtab_upper_bound followed
by bfd_canonicalize_symtab. You can then look through the list of
asymbol structures for the one named 'u'.
Ian