public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* RE: objdump --syms -j .text
@ 2005-04-01  9:23 Andy Chittenden
  2005-04-01  9:59 ` Dave Korn
  0 siblings, 1 reply; 11+ 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] 11+ messages in thread

* RE: objdump --syms -j .text
  2005-04-01  9:23 objdump --syms -j .text Andy Chittenden
@ 2005-04-01  9:59 ` Dave Korn
  2005-04-04  0:50   ` Alan Modra
  0 siblings, 1 reply; 11+ 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] 11+ 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
  2005-04-04 10:06     ` [PATCH] PR 813 (was Re: objdump --syms -j .text ) Ramana Radhakrishnan
  0 siblings, 2 replies; 11+ 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] 11+ messages in thread

* RE: objdump --syms -j .text
  2005-04-04  0:50   ` Alan Modra
@ 2005-04-04  9:07     ` Dave Korn
  2005-04-04 10:06     ` [PATCH] PR 813 (was Re: objdump --syms -j .text ) Ramana Radhakrishnan
  1 sibling, 0 replies; 11+ 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] 11+ messages in thread

* [PATCH] PR 813 (was Re: objdump --syms -j .text )
  2005-04-04  0:50   ` Alan Modra
  2005-04-04  9:07     ` Dave Korn
@ 2005-04-04 10:06     ` Ramana Radhakrishnan
  2005-04-04 10:35       ` Nick Clifton
  1 sibling, 1 reply; 11+ messages in thread
From: Ramana Radhakrishnan @ 2005-04-04 10:06 UTC (permalink / raw)
  To: Alan Modra
  Cc: Dave Korn, 'Andy Chittenden', 'Pieter Arnout', binutils

[-- Attachment #1: Type: text/plain, Size: 208 bytes --]

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

Tested with i386-linux native . No extra failures. Ok to 
commit ?

cheers
Ramana


-- 
Ramana Radhakrishnan
GNU Tools
codito ergo sum (www.codito.com)


[-- Attachment #2: objdump-prfsf-813-patch --]
[-- Type: text/plain, Size: 1415 bytes --]

Index: ChangeLog
===================================================================
RCS file: /cvs/src/src/binutils/ChangeLog,v
retrieving revision 1.902
diff -c -3 -p -r1.902 ChangeLog
*** ChangeLog	1 Apr 2005 15:09:43 -0000	1.902
--- ChangeLog	4 Apr 2005 10:04:02 -0000
***************
*** 1,3 ****
--- 1,9 ----
+ 2005-04-04  Ramana Radhakrishnan  <ramana.radhakrishnan@codito.com>
+ 
+ 	PR binutils/813
+ 	* objdump.c(dump_symbols):Add a check if the section for the symbol
+ 	is chosen using process_section_p.
+ 
  2005-04-01  H.J. Lu  <hongjiu.lu@intel.com>
  
  	* NEWS: Mention new readelf options, "-N/--full-section-name"
Index: objdump.c
===================================================================
RCS file: /cvs/src/src/binutils/objdump.c,v
retrieving revision 1.103
diff -c -3 -p -r1.103 objdump.c
*** objdump.c	28 Mar 2005 12:28:17 -0000	1.103
--- objdump.c	4 Apr 2005 10:04:09 -0000
*************** dump_symbols (bfd *abfd ATTRIBUTE_UNUSED
*** 2365,2372 ****
  	      free (alloc);
  	    }
  	  else
! 	    bfd_print_symbol (cur_bfd, stdout, *current,
! 			      bfd_print_symbol_all);
  	  printf ("\n");
  	}
        current++;
--- 2365,2375 ----
  	      free (alloc);
  	    }
  	  else
! 	    {
! 		  if(process_section_p((*current)->section))
! 		    bfd_print_symbol (cur_bfd, stdout, *current,
! 				      bfd_print_symbol_all);
! 	    }
  	  printf ("\n");
  	}
        current++;

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

* Re: [PATCH] PR 813 (was Re: objdump --syms -j .text )
  2005-04-04 10:06     ` [PATCH] PR 813 (was Re: objdump --syms -j .text ) Ramana Radhakrishnan
@ 2005-04-04 10:35       ` Nick Clifton
  2005-04-04 10:40         ` Ramana Radhakrishnan
  2005-04-04 13:24         ` Daniel Jacobowitz
  0 siblings, 2 replies; 11+ messages in thread
From: Nick Clifton @ 2005-04-04 10:35 UTC (permalink / raw)
  To: Ramana Radhakrishnan, Daniel Jacobowitz
  Cc: Dave Korn, 'Andy Chittenden', 'Pieter Arnout', binutils

Hi Ramana,

> Tested with i386-linux native . No extra failures. Ok to commit ?

Almost - the patch would not work if the dumping of special symbols was 
enabled (--special-syms) as well.  So I have applied the following 
variation of your patch instead.

Daniel - would you like this patch in the 2.16 branch ?

Cheers
   Nick

Index: binutils/objdump.c
===================================================================
RCS file: /cvs/src/src/binutils/objdump.c,v
retrieving revision 1.102
retrieving revision 1.104
diff -c -3 -p -r1.102 -r1.104
*** binutils/objdump.c	18 Mar 2005 16:28:13 -0000	1.102
--- binutils/objdump.c	4 Apr 2005 10:32:28 -0000	1.104
*************** dump_symbols (bfd *abfd ATTRIBUTE_UNUSED
*** 2345,2352 ****
   	printf (_("could not determine the type of symbol number %ld\n"),
   		count);

!       else if (dump_special_syms
! 	       || !bfd_is_target_special_symbol (cur_bfd, *current))
   	{
   	  const char *name = (*current)->name;

--- 2345,2353 ----
   	printf (_("could not determine the type of symbol number %ld\n"),
   		count);

!       else if (process_section_p ((* current)->section)
! 	       && (dump_special_syms
! 		   || !bfd_is_target_special_symbol (cur_bfd, *current)))
   	{
   	  const char *name = (*current)->name;

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

* Re: [PATCH] PR 813 (was Re: objdump --syms -j .text )
  2005-04-04 10:35       ` Nick Clifton
@ 2005-04-04 10:40         ` Ramana Radhakrishnan
  2005-04-04 13:24         ` Daniel Jacobowitz
  1 sibling, 0 replies; 11+ messages in thread
From: Ramana Radhakrishnan @ 2005-04-04 10:40 UTC (permalink / raw)
  To: Nick Clifton
  Cc: Daniel Jacobowitz, Dave Korn, 'Andy Chittenden',
	'Pieter Arnout',
	binutils

Hi Nick,

> Hi Ramana,
> 
>> Tested with i386-linux native . No extra failures. Ok to commit ?
> 
> 
> Almost - the patch would not work if the dumping of special symbols was 
> enabled (--special-syms) as well.  So I have applied the following 
> variation of your patch instead.
> 
Oops yes. Thanks.

cheers
Ramana

-- 
Ramana Radhakrishnan
GNU Tools
codito ergo sum (www.codito.com)

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

* Re: [PATCH] PR 813 (was Re: objdump --syms -j .text )
  2005-04-04 10:35       ` Nick Clifton
  2005-04-04 10:40         ` Ramana Radhakrishnan
@ 2005-04-04 13:24         ` Daniel Jacobowitz
  2005-04-04 14:45           ` Nick Clifton
  1 sibling, 1 reply; 11+ messages in thread
From: Daniel Jacobowitz @ 2005-04-04 13:24 UTC (permalink / raw)
  To: Nick Clifton
  Cc: Ramana Radhakrishnan, Dave Korn, 'Andy Chittenden',
	'Pieter Arnout',
	binutils

On Mon, Apr 04, 2005 at 11:32:53AM +0100, Nick Clifton wrote:
> Hi Ramana,
> 
> >Tested with i386-linux native . No extra failures. Ok to commit ?
> 
> Almost - the patch would not work if the dumping of special symbols was 
> enabled (--special-syms) as well.  So I have applied the following 
> variation of your patch instead.
> 
> Daniel - would you like this patch in the 2.16 branch ?

Up to you - I have no objection.


-- 
Daniel Jacobowitz
CodeSourcery, LLC

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

* Re: [PATCH] PR 813 (was Re: objdump --syms -j .text )
  2005-04-04 13:24         ` Daniel Jacobowitz
@ 2005-04-04 14:45           ` Nick Clifton
  0 siblings, 0 replies; 11+ messages in thread
From: Nick Clifton @ 2005-04-04 14:45 UTC (permalink / raw)
  To: Daniel Jacobowitz
  Cc: Ramana Radhakrishnan, Dave Korn, 'Andy Chittenden',
	'Pieter Arnout',
	binutils

Hi Daniel,

>>Almost - the patch would not work if the dumping of special symbols was 
>>enabled (--special-syms) as well.  So I have applied the following 
>>variation of your patch instead.
>>
>>Daniel - would you like this patch in the 2.16 branch ?
> 
> Up to you - I have no objection.

Great - in which I have checked it in - thanks.

Cheers
   Nick


^ permalink raw reply	[flat|nested] 11+ 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; 11+ 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] 11+ messages in thread

* objdump --syms -j .text
@ 2005-03-31 15:58 Andy Chittenden
  2005-03-31 21:06 ` Dave Korn
  0 siblings, 1 reply; 11+ 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] 11+ messages in thread

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

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-04-01  9:23 objdump --syms -j .text Andy Chittenden
2005-04-01  9:59 ` Dave Korn
2005-04-04  0:50   ` Alan Modra
2005-04-04  9:07     ` Dave Korn
2005-04-04 10:06     ` [PATCH] PR 813 (was Re: objdump --syms -j .text ) Ramana Radhakrishnan
2005-04-04 10:35       ` Nick Clifton
2005-04-04 10:40         ` Ramana Radhakrishnan
2005-04-04 13:24         ` Daniel Jacobowitz
2005-04-04 14:45           ` Nick Clifton
  -- strict thread matches above, loose matches on Subject: below --
2005-03-31 15:58 objdump --syms -j .text Andy Chittenden
2005-03-31 21:06 ` 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).