public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* objdump --syms -j .text
@ 2005-03-31 15:58 Andy Chittenden
  2005-03-31 21:06 ` Dave Korn
  0 siblings, 1 reply; 6+ messages in thread
From: Andy Chittenden @ 2005-03-31 15:58 UTC (permalink / raw)
  To: binutils

I want to dump out just the symbols in the .text section. Is that
possible? The "obvious" invocation of using "-j .text --syms" seems to
ignore the -j option and dumps the symbols for all sections.

-- 
Andy, BlueArc Engineering 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: objdump --syms -j .text
  2005-03-31 15:58 objdump --syms -j .text Andy Chittenden
@ 2005-03-31 21:06 ` Dave Korn
  0 siblings, 0 replies; 6+ messages in thread
From: Dave Korn @ 2005-03-31 21:06 UTC (permalink / raw)
  To: 'Andy Chittenden', binutils

----Original Message----
>From: Andy Chittenden
>Sent: 31 March 2005 15:27

> I want to dump out just the symbols in the .text section. Is that
> possible? The "obvious" invocation of using "-j .text --syms" seems to
> ignore the -j option and dumps the symbols for all sections.

  Yes, I see that behaviour too.  You can work-around by using "objcopy -j
.text <infile> <tempfile>" to extract just the text section to a temporary
file and then run "objdump --syms" on that.



    cheers,
      DaveK
-- 
Can't think of a witty .sigline today....

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: objdump --syms -j .text
  2005-04-04  0:50   ` Alan Modra
@ 2005-04-04  9:07     ` Dave Korn
  0 siblings, 0 replies; 6+ messages in thread
From: Dave Korn @ 2005-04-04  9:07 UTC (permalink / raw)
  To: 'Alan Modra'
  Cc: 'Andy Chittenden', 'Pieter Arnout', binutils

----Original Message----
>From: Alan Modra
>Sent: 04 April 2005 01:51

> On Fri, Apr 01, 2005 at 10:58:50AM +0100, Dave Korn wrote:
>>> 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).
>> 
>>   On the face of it this sounds like a real bug; I'll file a bugzilla on
>> it, so as to make sure it doesn't get forgotten.
> 
> Even better would be filing a *patch*.  :)


  Well, yes, but first things first!


    cheers,
      DaveK
-- 
Can't think of a witty .sigline today....

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: objdump --syms -j .text
  2005-04-01  9:59 ` Dave Korn
@ 2005-04-04  0:50   ` Alan Modra
  2005-04-04  9:07     ` Dave Korn
  0 siblings, 1 reply; 6+ messages in thread
From: Alan Modra @ 2005-04-04  0:50 UTC (permalink / raw)
  To: Dave Korn; +Cc: 'Andy Chittenden', 'Pieter Arnout', binutils

On Fri, Apr 01, 2005 at 10:58:50AM +0100, Dave Korn wrote:
> > 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).
> 
>   On the face of it this sounds like a real bug; I'll file a bugzilla on it,
> so as to make sure it doesn't get forgotten.

Even better would be filing a *patch*.  :)

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: objdump --syms -j .text
  2005-04-01  9:23 Andy Chittenden
@ 2005-04-01  9:59 ` Dave Korn
  2005-04-04  0:50   ` Alan Modra
  0 siblings, 1 reply; 6+ messages in thread
From: Dave Korn @ 2005-04-01  9:59 UTC (permalink / raw)
  To: 'Andy Chittenden', 'Pieter Arnout'; +Cc: binutils

----Original Message----
>From: Andy Chittenden
>Sent: 01 April 2005 10:23

 
> 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).


  On the face of it this sounds like a real bug; I'll file a bugzilla on it,
so as to make sure it doesn't get forgotten.



    cheers,
      DaveK
-- 
Can't think of a witty .sigline today....

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: objdump --syms -j .text
@ 2005-04-01  9:23 Andy Chittenden
  2005-04-01  9:59 ` Dave Korn
  0 siblings, 1 reply; 6+ messages in thread
From: Andy Chittenden @ 2005-04-01  9:23 UTC (permalink / raw)
  To: Dave Korn, Pieter Arnout; +Cc: binutils

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....

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2005-04-04  9:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-31 15:58 objdump --syms -j .text Andy Chittenden
2005-03-31 21:06 ` Dave Korn
2005-04-01  9:23 Andy Chittenden
2005-04-01  9:59 ` Dave Korn
2005-04-04  0:50   ` Alan Modra
2005-04-04  9:07     ` Dave Korn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).