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: ELF file consists of several object files, what part in ELFcomes from what ELF file?


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
        


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