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


_______________________________________________
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils

Reply via email to