bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug binutils/10263] objdump does not disassemble ARM code entered with


From: nickc at redhat dot com
Subject: [Bug binutils/10263] objdump does not disassemble ARM code entered with .word directives
Date: 12 Jun 2009 12:22:03 -0000

------- Additional Comments From nickc at redhat dot com  2009-06-12 12:22 
-------
Subject: Re:  New: objdump does not disassemble ARM code
 entered with .word directives

Hi Mike,

> It used to be possible to enter instructions with .word directives and then
> disassemble them with objdump -d, but that no longer works. Example:

>         mov     r0, r1
>         .word   0xe1a00001
>         bx      lr

>    0:   e1a00001        mov     r0, r1
>    4:   e1a00001        .word   0xe1a00001
>    8:   e12fff1e        bx      lr

This is actually the intended behaviour.  The .word directive is used to 
enter data not instructions and the ARM port of GAS makes a note of this 
by emitting a local mapping symbol.  For example if you run:

   armv5tel-unknown-linux-gnueabi-readelf --syms test.o

You will see:

   Symbol table '.symtab' contains 9 entries:
    Num:    Value  Size Type    Bind   Vis      Ndx Name
      0: 00000000     0 NOTYPE  LOCAL  DEFAULT  UND
      1: 00000000     0 SECTION LOCAL  DEFAULT    1
      2: 00000000     0 SECTION LOCAL  DEFAULT    3
      3: 00000000     0 SECTION LOCAL  DEFAULT    4
      4: 00000000     0 NOTYPE  LOCAL  DEFAULT    1 $a
      5: 00000004     0 NOTYPE  LOCAL  DEFAULT    1 $d
      6: 00000008     0 NOTYPE  LOCAL  DEFAULT    1 $a


It is the $d symbol, entry number 5 in the symbol table, which is 
telling the disassemble that the word at 0x00000004 is not an 
instruction but data and so it should not attempt to disassemble it.


It would be possible to add a new pseudo-op, say ".insn", to insert a 
numeric value into the output and have it be labelled as in instruction, 
but why bother ?  Do you really need this functionality.  Why not just 
assemble the instruction normally ?

Cheers
   Nick


-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=10263

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]