Bug 10964 - objdump disassembles "lpm rX, Z" wrongly
Summary: objdump disassembles "lpm rX, Z" wrongly
Status: RESOLVED INVALID
Alias: None
Product: binutils
Classification: Unclassified
Component: binutils (show other bugs)
Version: 2.20
: P2 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-11-15 17:16 UTC by Elrond
Modified: 2009-11-28 01:15 UTC (History)
1 user (show)

See Also:
Host: i686-pc-linux-gnu
Target: avr-*-*
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Elrond 2009-11-15 17:16:24 UTC
objdump disassemble "lpm rX, Z" as "lpm rX, Z+".

  avr% cat bug-lpm.c
  void try_asm(void) {
        __asm__ __volatile__(
        "lpm r18, Z+\n\t"
        "lpm r18, Z\n\t"
        ::);
  }
  avr% avr-gcc -Wall -mmcu=atmega8515 -O3 -Os -c bug-lpm.c
  avr% avr-objdump -d bug-lpm.o
  bug-lpm.o:     file format elf32-avr
  Disassembly of section .text:
  00000000 <try_asm>:
   0:   25 91           lpm     r18, Z+
   2:   24 91           lpm     r18, Z+
   4:   08 95           ret

Note the different opcodes (25 91 and 24 91).

Please fix the disassembly.
Comment 1 Nick Clifton 2009-11-20 14:45:02 UTC
Hi Elrond,

  I think that you must be using an old version of the binutils.  With the
latest release (2.20) the disassembly works:

   % avr-objdump -d bug-lpm.o
   Disassembly of section .text:

   00000000 <try_asm>:
     0:   25 91           lpm     r18, Z+
     2:   24 91           lpm     r18, Z
     4:   08 95           ret

Cheers
  Nick
Comment 2 Elrond 2009-11-20 22:02:43 UTC
Hi Nick,

I just redownloaded and reinstalled the binutils-avr 2.20-2 package for
Debian/testing on i386.

  avr% avr-objdump -d bug-lpm.o
  00000000 <try_asm>:
    0:   25 91           lpm     r18, Z+
    2:   24 91           lpm     r18, Z+
    4:   08 95           ret
  avr% avr-objdump --version   
  GNU objdump (GNU Binutils) 2.20

So you suggest, that this is a bug in the debian packaging?
Comment 3 Nick Clifton 2009-11-26 13:56:05 UTC
Hi Elrond,

> So you suggest, that this is a bug in the debian packaging?

I would have to say yes, although it does seem rather strange.  Perhaps you
could try downloading a snapshot of the current development sources from here:

  ftp://sourceware.org/pub/binutils/snapshots/

See if an objdump built from these sources shows the same problem.

Cheers
  Nick
Comment 4 Elrond 2009-11-28 01:15:37 UTC
I currently don't have the time to build complex packages straight from source.

For the time being, I've filed a bug with debian: http://bugs.debian.org/558335
I hope, the debian maintainer can put some light on this.