patch to thumb disassembler to fix ldrsh/ldrsb - whoops 2nd try

Thomas de Lellis tdel@windriver.com
Thu May 11 18:53:00 GMT 2000


how about this time???
Patch to fix objdump disassembly of thumb ldrsh/ldrsb instructions.

Changed thumb objdump disassembly listing of ldsb and ldsh
instructions to ldrsb and ldrsh to make consistent with the
descriptions in the "ARM Architecural Reference Manual".

=======================================================================
2000-05-11  Thomas de Lellis  <tdel@windriver.com>

        * arm-opc.c: Disassembly of thumb ldsb/ldsh
        instructions changed to ldrsb/ldrsh.

TESTCASE ==============================================================
> cat a.s
        .text
a:
        ldrsh   r1,[r2,r3]
        ldrsb   r1,[r2,r3]
        .code   16
b:
        ldrsh   r1,[r2,r3]
        ldrsb   r1,[r2,r3]
> cat test
asarm -o a.o a.s
objdumparm -d a.o
FAIL ==================================================================
> ./test

a.o:     file format elf32-littlearm

Disassembly of section .text:

00000000 <a>:
   0:   e19210f3        ldrsh   r1, [r2, r3]
   4:   e19210d3        ldrsb   r1, [r2, r3]

00000008 <b>:
   8:   5ed1            ldsh    r1, [r2, r3]
   a:   56d1            ldsb    r1, [r2, r3]
PASS ==================================================================
> ./test

a.o:     file format elf32-littlearm

Disassembly of section .text:

00000000 <a>:
   0:   e19210f3        ldrsh   r1, [r2, r3]
   4:   e19210d3        ldrsb   r1, [r2, r3]

00000008 <b>:
   8:   5ed1            ldrsh   r1, [r2, r3]
   a:   56d1            ldrsb   r1, [r2, r3]
=======================================================================
*** arm-opc.h.org	Thu May 11 18:27:56 2000
--- arm-opc.h	Thu May 11 18:27:18 2000
*************** static struct thumb_opcode thumb_opcodes
*** 213,219 ****
    /* format 8 */
    {0x5200, 0xFE00, "strh\t%0-2r, [%3-5r, %6-8r]"},
    {0x5A00, 0xFE00, "ldrh\t%0-2r, [%3-5r, %6-8r]"},
!   {0x5600, 0xF600, "lds%11?hb\t%0-2r, [%3-5r, %6-8r]"},
    /* format 7 */
    {0x5000, 0xFA00, "str%10'b\t%0-2r, [%3-5r, %6-8r]"},
    {0x5800, 0xFA00, "ldr%10'b\t%0-2r, [%3-5r, %6-8r]"},
--- 213,219 ----
    /* format 8 */
    {0x5200, 0xFE00, "strh\t%0-2r, [%3-5r, %6-8r]"},
    {0x5A00, 0xFE00, "ldrh\t%0-2r, [%3-5r, %6-8r]"},
!   {0x5600, 0xF600, "ldrs%11?hb\t%0-2r, [%3-5r, %6-8r]"},
    /* format 7 */
    {0x5000, 0xFA00, "str%10'b\t%0-2r, [%3-5r, %6-8r]"},
    {0x5800, 0xFA00, "ldr%10'b\t%0-2r, [%3-5r, %6-8r]"},


More information about the Binutils mailing list