ELF file consists of several object files, what part in ELF comes from what ELF file?

Nick Clifton nickc@redhat.com
Thu Oct 30 17:57:00 GMT 2003


Hi Torsten,

> The ELF file is linked together from several object
> files.  I'd like to know what part of the .text section
> came from which object file.  Also, .data and .bss
> are of interest.
>
> Is there a portable way to get this information
> from the ELF file?

No - this kind of information is not stored in the file.  In fact the
only simple way to extract this information is to create a map file
when linking the object files together.  (See the linker's -M
option).

The only other way to reconstruct the information would be to perform
a binary pattern match between the linked ELF executable and the
various object files, taking into account the transformations that are
performed by the relocs.

Cheers
        Nick
        



More information about the Binutils mailing list