This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
RE: objdump --syms -j .text
- From: "Andy Chittenden" <AChittenden at bluearc dot com>
- To: "Dave Korn" <dave dot korn at artimi dot com>,"Pieter Arnout" <pieter at powerescape dot com>
- Cc: <binutils at sources dot redhat dot com>
- Date: Fri, 1 Apr 2005 10:23:26 +0100
- Subject: RE: objdump --syms -j .text
At the moment we do use grep. The reason why I'd prefer not to use grep
is for performance: we process the output using perl and have to throw
away two-thirds of the output of the objdump. Thanks for the suggestion
to use objcopy: on the elf file in question, it is quicker to use
objcopy and then use objdump to dump the symbols than do a grep:
with objdump/grep:
real 0m4.347s
user 0m4.134s
sys 0m0.207s
with objcopy/objdump:
real 0m2.632s
user 0m2.341s
sys 0m0.287s
It would be great if we didn't have to do that objcopy as well (ie for
objdump to take note of the -j .text option when dumping symbols).
--
Andy, BlueArc Engineering
-----Original Message-----
From: Dave Korn [mailto:dave.korn@artimi.com]
Sent: 31 March 2005 18:39
To: 'Pieter Arnout'; Andy Chittenden
Cc: binutils@sources.redhat.com
Subject: RE: objdump --syms -j .text
----Original Message----
>From: Pieter Arnout
>Sent: 31 March 2005 18:28
> Forgive me for asking, but why don't you just grep out the .text
symbols
> from a normal objdump? Is it because you still need the object file
> format?
>
> If not, you could do something like this:
>
> objdump -x <infile> | grep ".text" > <tempfile>
>
.... although of course '.' is a regex metachar meaning 'any
character',
and there's nothing that says that won't match symbol names etc, because
it's not really doing any checking to be sure the match is occurring on
the
symbol-section field of the objdump output.....
I do agree it's a reasonable first approximation, but splitting out
the
.text section and objdumping that without grep is just as easy, and even
more correct.
cheers,
DaveK
--
Can't think of a witty .sigline today....