tags:

views:

285

answers:

2

Hello! I care about the success of GNU very much and wanted some feedback on what to do about a potential bug in objdump for ARM....

I'm examining the output of "objdump -D --target=binary -m arm7tdmi" and seeing instructions that do not exist on the ancient ARM7TDMI cores.

(I'm looking at a file of random bits and treating it as a raw binary not an ELF file.)

For example, mrcc, blx and ldc2 only appeared in ARMv5 or later but I see them in the output with command line switches above.

(I see same problems with "-m armv4t".)

I'm using version 2.19.1-multiarch from Ubuntu 9.04.

Is this a genuine bug or must I use different switches?

Sincerely,

chris

+1  A: 

Well it's not a bug exactly, since if you were viewing an old binary, you would not expect to see such instructions in the instruction stream, so they wouldn't appear.

Hence it would still display correct code correctly.

If you forced the objdump disassembler to disassemble memory regions which did not include code, but data of other types (for instance, using the flag -D), then you might expect the following anomalous results:

  • data which are not instructions are displayed as instructions that are valid on that architecture
  • data which are not instructions are displayed as instructions that are not valid on that architecture.
  • data which are not instructions are displayed as illegal instructions (oh no!)

I find it hard to get worked up about any of these, since you did specify -D, and that's what it does.

If you could point out an example of a correct and valid instruction stream being decoded differently due to a re-definition of an instruction encoding having a different effect, then I think that would be a genuine bug.

Has your example caused some problem (including inconvenience) to your work?

Alex Brown
+2  A: 

I get caught on these things for some other architectures too (non-ARM). Objdump does not know if you are disassembling code or data portions and will try its best to disassemble it - including constants and other data portions.

sybreon