bug-binutils
[Top][All Lists]
Advanced

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

[Bug gas/5457] New: INTOUCH instruction incorrectly disassembled.


From: shap at eros-os dot com
Subject: [Bug gas/5457] New: INTOUCH instruction incorrectly disassembled.
Date: 7 Dec 2007 21:59:43 -0000

The "intouch" instruction is incorrectly disassembled as cpushl on platforms
supporting mcfisa_b or mcfisa_c. A patch correcting this is attached.

Repeat by compiling an assembly file containing use of an intouch instruction:

  intouch %a0

then attempt to disassemble. The disassembly will report:

  cpushl nc,%a0@

The error lies in the fact that the 'cc' field of cpush* and cinv* is
incorrectly decoded. A value of 0 in this field is illegal, and the code point
was reused for the INTOUCH instruction on the coldfire. In consequence, ANY
disassembly result reporting "nc" indicates an illegal opcode.

As of binutils-2.18, the specifications for both cpush* and cinv* use mask
fields that incorrectly match a cc field value of 0. This has the effect of
preventing disassembly of INTOUCH, (which is entered correctly, but is never
matched).

The attached patch corrects the mask values for CPUSH*. I left the CINV*
instructions alone, because (1) there are no conflicting instruction patterns to
be decoded, and (2) I don't have an m68040 manual to confirm that a cc field
value of zero is reserved for that instruction.

I would be happy to supply a regression test, but I'm not sure how to go about
that. I have confirmed that the attached patch corrects the disassembly error by
testing it against Coyotos kernel bootstrap code.

-- 
           Summary: INTOUCH instruction incorrectly disassembled.
           Product: binutils
           Version: 2.18
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gas
        AssignedTo: unassigned at sources dot redhat dot com
        ReportedBy: shap at eros-os dot com
                CC: bug-binutils at gnu dot org
GCC target triplet: any m68k mcfisa_b or mcfisa_c target


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

------- 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]