This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: ELF file consists of several object files, what part in ELFcomes from what ELF file?
- From: Nick Clifton <nickc at redhat dot com>
- To: Torsten Mohr <tmohr at s dot netic dot de>
- Cc: binutils at sources dot redhat dot com
- Date: Thu, 30 Oct 2003 17:48:14 +0000
- Subject: Re: ELF file consists of several object files, what part in ELFcomes from what ELF file?
- References: <200310301802.02611.tmohr@s.netic.de>
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