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: Info about struct members in ELF?


Hi Torsten,

> from an ELF file i can get some info about a const struct,
> for example its address, its size and its content.
>
> Does ELF support me somehow in interpreting the content?

No - the ELF format does not contain this kind of information.

What you need is debugging information.  The two most common kinds of
debug format are STABS and DWARF, both of which are supported by ELF
format files.

So you need to make sure that your binaries have been compiled with
debugging enabled (usually by adding the "-g" switch to the compiler's
command line) and then find out which kind of debug format is being
used and how to decode it.  You may find the code in the
binutils/readelf.c file helpful for seeing how to examine DWARF format
debug information and the code in binutils/debug.c useful for decoding
STABS information.

Cheers
        Nick


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