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: extracting size of a symbol


On Mon, Aug 23, 2004 at 10:51:50PM -0700, diz rael wrote:
> I was wondering if someone knows how to do this, or if
> there is a more appropriate mailing list for this kind
> of question.

Have you looked at nm source?  That will give you the general way to
find symbol sizes.  Simpler methods might be available on certain
targets, but you didn't say which target.

> --- diz rael <dizraelus@yahoo.com> wrote:
> 
> > What is the easiest way of extracting the size of a
> > symbol (eg. global variable/function)?
> > 
> > bfd_print_symbol produces this info. but I want to
> > extract just the size, and not print it to a stream.
> > 
> > Currently, I'm just sorting symbols within their
> > sections and subtracting addresses of consecutive
> > entries to calculate their sizes.
> > 
> > I'm sure there is a better way to do this, so any
> > suggestions would be appreciated.
> > 
> > Thanks!

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre


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