Re: How to list objects files in an executable
- From: Pascal Bourguignon <pjb@xxxxxxxxxxxxxxxxx>
- Date: Fri, 08 Dec 2006 00:00:25 +0100
"Sashi" <smalladi@xxxxxxxxx> writes:
Måns Rullgård wrote:
"Sashi" <smalladi@xxxxxxxxx> writes:
vasudevram wrote:
Sashi wrote:
Hello All,
I have an executable file that was generated by make. How can I see
what all object files have been linked into this executable?
I'm using Solaris 5.8.
Thanks,
Sashi
Hi,
I'm not at a Linux machine right now, so can't check this first, but
try runnng the nm command (the name nm stands for "name" - since it
displays names of items in an executable file).
Syntax should be something like:
nm exe_filename
I've already investigated nm but it doesn't suit my purpose. It gives
information about the symbols therein but I'd like a clear listing of
all the object files linked into this executable.
Maybe I need to spend a little more time on nm and see if I can parse
nm's output and glean what I need.
What you are asking for is impossible in general. If your executable
has debugging symbols, a debugger should be able to tell you the
source files that were used. These need of course not correspond
directly to object files used in the final link.
--
Måns Rullgård
mru@xxxxxxxxxxxxx
Perhaps my question is such but this is the first ever time that I've
heard someone say "impossible" for something in UNIX.
Nothing is impossible, if you accept to do what it takes.
If you want to know what source files were used in building an
executable, you'll have to do something to record that information.
For example, you could put in each source a literal string containing
the path to the source file, and ensure that this string is linked in,
then use a command such as:
$ strings /usr/local/bin/BpClassTest | grep '$Id:'
$Id: BcExcept.c,v 1.2 2004/01/02 00:59:24 pjbpjb Exp $
$Id: BcMem.c,v 1.2 2004/01/02 00:59:24 pjbpjb Exp $
Or you could add to the Makefile commands to record the input files to
each rules and deliver the executable with a bill of materials.
But if you want to "magically" retrieve information that has been
destroyed, no, it's not possible.
--
__Pascal Bourguignon__ http://www.informatimago.com/
This is a signature virus. Add me to your signature and help me to live.
.
- Follow-Ups:
- Re: How to list objects files in an executable
- From: Paul Pluzhnikov
- Re: How to list objects files in an executable
- References:
- How to list objects files in an executable
- From: Sashi
- Re: How to list objects files in an executable
- From: vasudevram
- Re: How to list objects files in an executable
- From: Sashi
- Re: How to list objects files in an executable
- From: Måns Rullgård
- Re: How to list objects files in an executable
- From: Sashi
- How to list objects files in an executable
- Prev by Date: Re: How do you make a prog wait for a file to be ready before reading?
- Next by Date: Re: How do you make a prog wait for a file to be ready before reading?
- Previous by thread: Re: How to list objects files in an executable
- Next by thread: Re: How to list objects files in an executable
- Index(es):
Relevant Pages
|