This is the mail archive of the
mailing list for the binutils project.
Re: BFD and Elf Symbol Size
"Robert Norton" <email@example.com> writes:
> > -----Original Message-----
> > "Robert Norton" <firstname.lastname@example.org> 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.