public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* objdump -d / -D behavior
@ 2005-10-07 17:58 Bryce Schober
  2005-10-10  8:37 ` Nick Clifton
  0 siblings, 1 reply; 2+ messages in thread
From: Bryce Schober @ 2005-10-07 17:58 UTC (permalink / raw)
  To: binutils

First, I'm using:
$ arm-elf-objdump -V
GNU objdump 2.16.1

I'm a bit cunfused about the relative behavior of objdump -d vs.
objdump -D. It seems like the implementation is not what the user
would want (read: not what I want). When I use -d, the disassembler is
smart enough not to disassemble non-executable objects, but instead
does a hex dump. When I use -D (because I want to include all sections
in the disassembly), it loses this intelligence. I see no reason why
this should be necessary, or at least if it is necessary to force
disassembly of all data, to have an option that does include sections
with no executable, AND does a hex dump of non-executable sections /
objects.
--
Bryce Schober

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

* Re: objdump -d / -D behavior
  2005-10-07 17:58 objdump -d / -D behavior Bryce Schober
@ 2005-10-10  8:37 ` Nick Clifton
  0 siblings, 0 replies; 2+ messages in thread
From: Nick Clifton @ 2005-10-10  8:37 UTC (permalink / raw)
  To: Bryce Schober; +Cc: binutils

Hi Bryce,

> I'm a bit cunfused about the relative behavior of objdump -d vs.
> objdump -D. It seems like the implementation is not what the user
> would want (read: not what I want). When I use -d, the disassembler is
> smart enough not to disassemble non-executable objects, but instead
> does a hex dump. When I use -D (because I want to include all sections
> in the disassembly), it loses this intelligence. I see no reason why
> this should be necessary, 

The point of the -D switch is that it is intended to be used when the 
assumption about "only non-empty, executable sections contain code" is 
not valid.  In this case objdump has to assume that the file it is 
disassembling is special in some way and that it cannot make any 
assumptions about which sections do or do not contain code.

There do exist programs which for example contain co-processor code in 
non-executable but loadable sections which the user may want to see 
disassembled.

> or at least if it is necessary to force
> disassembly of all data, to have an option that does include sections
> with no executable, AND does a hex dump of non-executable sections /
> objects.

Have you tried the "-s" switch ?

This will give you hex dumps of the non-executable sections, but it will 
also dump the executable sections which may not be what you want.  Of 
course you can always write a patch to give you exactly the features you 
want.

Cheers
   Nick

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

end of thread, other threads:[~2005-10-10  8:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-10-07 17:58 objdump -d / -D behavior Bryce Schober
2005-10-10  8:37 ` Nick Clifton

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