* BFD and Elf Symbol Size
@ 2007-10-19 11:40 Robert Norton
2007-10-19 15:36 ` Ian Lance Taylor
0 siblings, 1 reply; 4+ messages in thread
From: Robert Norton @ 2007-10-19 11:40 UTC (permalink / raw)
To: binutils
Hi,
Is there any way to get the size of an elf symbol via the BFD?
Thanks,
Robert
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: BFD and Elf Symbol Size
2007-10-19 11:40 BFD and Elf Symbol Size Robert Norton
@ 2007-10-19 15:36 ` Ian Lance Taylor
2007-10-19 16:07 ` Robert Norton
0 siblings, 1 reply; 4+ messages in thread
From: Ian Lance Taylor @ 2007-10-19 15:36 UTC (permalink / raw)
To: Robert Norton; +Cc: binutils
"Robert Norton" <rnorton@broadcom.com> writes:
> Is there any way to get the size of an elf symbol via the BFD?
In general I would have to recommend against using BFD as a general
purpose library.
That said, sure, you can do anything. In this case,
#include "elf-bfd.h"
and then
((elf_symbol_type *) symbol)->internal_elf_sym.st_size;
Ian
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: BFD and Elf Symbol Size
2007-10-19 15:36 ` Ian Lance Taylor
@ 2007-10-19 16:07 ` Robert Norton
2007-10-19 18:55 ` Ian Lance Taylor
0 siblings, 1 reply; 4+ messages in thread
From: Robert Norton @ 2007-10-19 16:07 UTC (permalink / raw)
To: Ian Lance Taylor; +Cc: binutils
> -----Original Message-----
> "Robert Norton" <rnorton@broadcom.com> writes:
>
> > Is there any way to get the size of an elf symbol via the BFD?
>
> In general I would have to recommend against using BFD as a general
> purpose library.
I'm working on gprof which already makes use of the bfd.
> That said, sure, you can do anything. In this case,
>
> #include "elf-bfd.h"
>
> and then
>
> ((elf_symbol_type *) symbol)->internal_elf_sym.st_size;
Great! Thanks.
Robert
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: BFD and Elf Symbol Size
2007-10-19 16:07 ` Robert Norton
@ 2007-10-19 18:55 ` Ian Lance Taylor
0 siblings, 0 replies; 4+ messages in thread
From: Ian Lance Taylor @ 2007-10-19 18:55 UTC (permalink / raw)
To: Robert Norton; +Cc: binutils
"Robert Norton" <rnorton@broadcom.com> writes:
> > -----Original Message-----
> > "Robert Norton" <rnorton@broadcom.com> writes:
> >
> > > Is there any way to get the size of an elf symbol via the BFD?
> >
> > In general I would have to recommend against using BFD as a general
> > purpose library.
>
> I'm working on gprof which already makes use of the bfd.
>
> > That said, sure, you can do anything. In this case,
> >
> > #include "elf-bfd.h"
> >
> > and then
> >
> > ((elf_symbol_type *) symbol)->internal_elf_sym.st_size;
>
> Great! Thanks.
Not to miss the obvious, that is only safe when you know you are
looking at an ELF file. You can check bfd_get_flavour.
Ian
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2007-10-19 17:42 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-10-19 11:40 BFD and Elf Symbol Size Robert Norton
2007-10-19 15:36 ` Ian Lance Taylor
2007-10-19 16:07 ` Robert Norton
2007-10-19 18:55 ` Ian Lance Taylor
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).