bug-binutils
[Top][All Lists]
Advanced

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

[Bug binutils/19157] New: GNURL78 "Objdump": Incorrect disassembler outp


From: vinay.g at kpit dot com
Subject: [Bug binutils/19157] New: GNURL78 "Objdump": Incorrect disassembler output generated by objdump for base addressing using SP register.
Date: Wed, 21 Oct 2015 05:26:27 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=19157

            Bug ID: 19157
           Summary: GNURL78 "Objdump": Incorrect disassembler output
                    generated by objdump for base addressing  using SP
                    register.
           Product: binutils
           Version: 2.25
            Status: NEW
          Severity: critical
          Priority: P2
         Component: binutils
          Assignee: unassigned at sourceware dot org
          Reporter: vinay.g at kpit dot com
  Target Milestone: ---

Description of the problem :
The GNURL78 objdump utility generated incorrect 
output for base addressing using stack pointer (SP) register.

// testcase test.s
.text
mov a, [sp]
mov a, [sp + 0]
mov a, [sp + 1]
movw ax, [sp]
movw ax, [sp + 0]
movw ax, [sp + 2]
mov [sp], # 9
mov [sp + 0], # 9
mov [sp + 1], # 9
.end

Command:
$rl78-elf-as test.s -o test.o -aln
$rl78-elf-objdump -d test.o

List file output :

   1                                    .text
   2 0000 88 00                         mov a, [sp]
   3 0002 88 00                         mov a, [sp + 0]
   4 0004 88 01                         mov a, [sp + 1]
   8 000c A8 00                         movw ax, [sp]
   9 000e A8 00                         movw ax, [sp + 0]
  10 0010 A8 02                         movw ax, [sp + 2]
  14 0018 C8 00 09                      mov [sp], # 9
  15 001b C8 00 09                      mov [sp + 0], # 9
  16 001e C8 01 09                      mov [sp + 1], # 9
  17                                    .end

Actual objdump disassembly output:

Disassembly of section .text:
00000000 <.text>:
   0:   88 00                           mov     a, [sp]
   2:   88 00                           mov     a, [sp]
   4:   88 01                           mov     a, [sp+1]
   c:   a8 00                           movw    ax, [sp]
   e:   a8 00                           movw    ax, [sp]
  10:   a8 02                           movw    ax, [sp+2]
  18:   c8 00 09                        mov     [sp], #9
  1b:   c8 00 09                        mov     [sp], #9
  1e:   c8 01 09                        mov     [sp+1], #9

Expected objdump disassembly output :
00000000 <.text>:
   0:   88 00                           mov     a, [sp+0]
   2:   88 00                           mov     a, [sp+0]
   4:   88 01                           mov     a, [sp+1]
   c:   a8 00                           movw    ax, [sp+0]
   e:   a8 00                           movw    ax, [sp+0]
  10:   a8 02                           movw    ax, [sp+2]
  18:   c8 00 09                        mov     [sp+0], #9
  1b:   c8 00 09                        mov     [sp+0], #9
  1e:   c8 01 09                        mov     [sp+1], #9      

For example,
the instruction "mov a, [sp + 0]" was disassembled as "mov a, [sp]", here "+0"
was omitted.

-- 
You are receiving this mail because:
You are on the CC list for the bug.



reply via email to

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