This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: Add archive support to ELF


On Fri, Aug 08, 2003 at 11:16:22PM -0700, Ian Lance Taylor wrote:
> "H. J. Lu" <hjl@lucon.org> writes:
> 
> > On Fri, Aug 08, 2003 at 10:32:15PM -0700, Ian Lance Taylor wrote:
> > > "H. J. Lu" <hjl@lucon.org> writes:
> > > 
> > > > This patch supports "readelf -s libfoo.a".
> > > 
> > > But the whole point of readelf is that it *doesn't* use the BFD
> > > library.
> > 
> > Can you compile readelf without including "bfd.h"? Claiming readelf
> > doesn't use BFD is misleading.
> 
> It uses bfd.h, but it doesn't call any routines from the BFD library.
> 
> It only uses bfd.h as a simple way to get 64-bit types when
> available.
> 
> > But since readelf is the part of binutils, why do I have to reinvent
> > the wheel?
> 
> Because the whole point of readelf is that it doesn't use the BFD
> library.  In a very real sense, the entire readelf program is a
> reinvention of the wheel.

I don't think so. readelf provides much more and detailed ELF specific
information than objdump or nm.

What harm will readelf using libbfd do? Is someone planning to remove
libbfd one day and still want to keep readelf.

> 
> Note that you don't need to use readelf to read archives.  You can use
> ar, objdump, or nm.

I don't want to do

# ar -x libfoo.a

before using readelf. By the same token, objdump and nm don't have to
read archives.


H.J.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]