Properly check address mode for SIB
authorH.J. Lu <hjl.tools@gmail.com>
Wed, 27 Mar 2013 18:49:10 +0000 (18:49 +0000)
committerH.J. Lu <hjl.tools@gmail.com>
Wed, 27 Mar 2013 18:49:10 +0000 (18:49 +0000)
gas/testsuite/

* gas/i386/addr32.s: Add an SIB test.
* gas/i386/addr32.d: Updated.

opcodes/

* i386-dis.c (get_sib): Add the sizeflag argument.  Properly
check address mode.
(print_insn): Pass sizeflag to get_sib.

gas/testsuite/ChangeLog
gas/testsuite/gas/i386/addr32.d
gas/testsuite/gas/i386/addr32.s
opcodes/ChangeLog
opcodes/i386-dis.c

index 58fb22f8cb46fd375304b8e9e86754dc8fa2aeef..82062823a4cb8e4f788275daa031d3fa1039d149 100644 (file)
@@ -1,3 +1,8 @@
+2013-03-27  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * gas/i386/addr32.s: Add an SIB test.
+       * gas/i386/addr32.d: Updated.
+
 2013-03-27  Alexis Deruelle  <alexis.deruelle@gmail.com>
 
        PR binutils/15068
index 5866a30c7927477b57f510991f937db11840f0f8..8553fc3e0cf8890b805ecf3b2c9a924a9caded24 100644 (file)
@@ -12,4 +12,5 @@ Disassembly of section .text:
 [       ]*13:[  ]+67 a2 98 08 60 00[    ]+addr32[       ]+mov[         ]+%al,0x600898
 [       ]*19:[  ]+67 a3 98 08 60 00[    ]+addr32[       ]+mov[         ]+%ax,0x600898
 [       ]*1f:[  ]+67 66 a3 98 08 60 00[         ]+addr32[       ]+mov[         ]+%eax,0x600898
+[       ]*26:[  ]+67 66 c7 04 24 01 00 00 00[   ]+movl[         ]+\$0x1,\(%esp\)
 #pass
index 3dab339dc256840c44132427a61e37a8d19ad9b6..b899ebd5a38fb4fe5cc4b71b0169926763044364 100644 (file)
@@ -6,3 +6,4 @@
        addr32 mov      %al,0x600898
        addr32 mov      %ax,0x600898
        addr32 mov      %eax,0x600898
+       addr32 movl     $0x1,(%esp)
index 533c4a32c7f5ee58de33d631cacfd00cf7dcbe0d..39c256e8ae96333ead4d4d93cb64d357a7baa8f6 100644 (file)
@@ -1,3 +1,9 @@
+2013-03-27  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * i386-dis.c (get_sib): Add the sizeflag argument.  Properly
+       check address mode.
+       (print_insn): Pass sizeflag to get_sib.
+
 2013-03-27  Alexis Deruelle  <alexis.deruelle@gmail.com>
 
        PR binutils/15068
index 5a772555f287463390482b1a8b0eb662e05262ac..eeaf22e45e9fc698ce07da5bf51038c4bc1ec855 100644 (file)
@@ -11285,11 +11285,11 @@ get_valid_dis386 (const struct dis386 *dp, disassemble_info *info)
 }
 
 static void
-get_sib (disassemble_info *info)
+get_sib (disassemble_info *info, int sizeflag)
 {
   /* If modrm.mod == 3, operand must be register.  */
   if (need_modrm
-      && address_mode != mode_16bit
+      && ((sizeflag & AFLAG) || address_mode == mode_64bit)
       && modrm.mod != 3
       && modrm.rm == 4)
     {
@@ -11574,7 +11574,7 @@ print_insn (bfd_vma pc, disassemble_info *info)
 
   if (dp->name == NULL && dp->op[0].bytemode == FLOATCODE)
     {
-      get_sib (info);
+      get_sib (info, sizeflag);
       dofloat (sizeflag);
     }
   else
@@ -11582,7 +11582,7 @@ print_insn (bfd_vma pc, disassemble_info *info)
       dp = get_valid_dis386 (dp, info);
       if (dp != NULL && putop (dp->name, sizeflag) == 0)
        {
-         get_sib (info);
+         get_sib (info, sizeflag);
          for (i = 0; i < MAX_OPERANDS; ++i)
            {
              obufp = op_out[i];
This page took 0.034128 seconds and 4 git commands to generate.