diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2013-03-27 18:49:10 +0000 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2013-03-27 18:49:10 +0000 |
commit | 7789d22fc045990a6bc829bef593c59726514a23 (patch) | |
tree | 7f1366f0be3a2820c2d6bdd172b9edb18cad21c4 /opcodes | |
parent | d3592bbe6f1b875db9c821bc06450551c532f701 (diff) | |
download | gdb-7789d22fc045990a6bc829bef593c59726514a23.tar.gz |
Properly check address mode for SIB
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.
Diffstat (limited to 'opcodes')
-rw-r--r-- | opcodes/ChangeLog | 6 | ||||
-rw-r--r-- | opcodes/i386-dis.c | 8 |
2 files changed, 10 insertions, 4 deletions
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index 533c4a32c7f..39c256e8ae9 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -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 diff --git a/opcodes/i386-dis.c b/opcodes/i386-dis.c index 5a772555f28..eeaf22e45e9 100644 --- a/opcodes/i386-dis.c +++ b/opcodes/i386-dis.c @@ -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]; |