This is the mail archive of the binutils@sourceware.cygnus.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: AM33 disassembler: fix for long-standing bug


As written in the previous message, AM30 insns are *not* supposed to
be accepted on AM33.  However, I'd still like to install a patch like
this, to keep the platform-detection code identical to that in gas.
Ok to install?

Index: opcodes/ChangeLog
by  Alexandre Oliva  <aoliva@cygnus.com>

	* m10300-dis.c (HAVE_AM30, HAVE_AM33): Define.
	(disassemble): Use them.

Index: opcodes/m10300-dis.c
===================================================================
RCS file: /cvs/src/src/opcodes/m10300-dis.c,v
retrieving revision 1.3
diff -u -r1.3 m10300-dis.c
--- opcodes/m10300-dis.c	2000/04/14 04:16:58	1.3
+++ opcodes/m10300-dis.c	2000/04/19 07:50:16
@@ -26,6 +26,9 @@
 static void disassemble PARAMS ((bfd_vma, struct disassemble_info *,
 				 unsigned long insn, unsigned int));
 
+#define HAVE_AM33 (info->mach == AM33)
+#define HAVE_AM30 (info->mach == AM30)
+
 int 
 print_insn_mn10300 (memaddr, info)
      bfd_vma memaddr;
@@ -250,7 +253,8 @@
       if ((op->mask & insn) == op->opcode
 	  && size == (unsigned int) mysize
 	  && (op->machine == 0
-	      || op->machine == info->mach))
+	      || (op->machine == AM33 && HAVE_AM33)
+	      || (op->machine == AM30 && HAVE_AM30)))
 	{
 	  const unsigned char *opindex_ptr;
 	  unsigned int nocomma;

-- 
Alexandre Oliva    Enjoy Guaranį, see http://www.ic.unicamp.br/~oliva/
Cygnus Solutions, a Red Hat company        aoliva@{redhat, cygnus}.com
Free Software Developer and Evangelist    CS PhD student at IC-Unicamp
oliva@{lsd.ic.unicamp.br, gnu.org}   Write to mailing lists, not to me

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]