aboutsummaryrefslogtreecommitdiff
path: root/opcodes
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2007-04-26 18:15:47 +0000
committerH.J. Lu <hjl.tools@gmail.com>2007-04-26 18:15:47 +0000
commit185b11630d33f088749f6cce0daa9f19f03957e2 (patch)
treeb8c10a695325a5806e034689b572fe4424249de0 /opcodes
parent8eb2af8ecda64d720abcd2f55a39e85827dfcfe9 (diff)
downloadgdb-185b11630d33f088749f6cce0daa9f19f03957e2.zip
gdb-185b11630d33f088749f6cce0daa9f19f03957e2.tar.gz
gdb-185b11630d33f088749f6cce0daa9f19f03957e2.tar.bz2
gas/testsuite/
2007-04-26 H.J. Lu <hongjiu.lu@intel.com> PR binutils/4429 * gas/i386/i386.exp: Run "x86-64-addr32-intel" and "x86-64-rip-intel". * gas/i386/intelok.d: Updated. * gas/i386/x86-64-addr32-intel.d: New file. * gas/i386/x86-64-rip-intel.d: Likewise. opcodes/ 2007-04-26 H.J. Lu <hongjiu.lu@intel.com> PR binutils/4429 * i386-dis.c (print_insn): Also swap the order of op_riprel when swapping op_index. Break when the RIP relative address is printed. (OP_E): Properly handle RIP relative addressing and print the explicit zero displacement for Intel mode.
Diffstat (limited to 'opcodes')
-rw-r--r--opcodes/ChangeLog9
-rw-r--r--opcodes/i386-dis.c20
2 files changed, 25 insertions, 4 deletions
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog
index 7e30c27..3521979 100644
--- a/opcodes/ChangeLog
+++ b/opcodes/ChangeLog
@@ -1,3 +1,12 @@
+2007-04-26 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR binutils/4429
+ * i386-dis.c (print_insn): Also swap the order of op_riprel
+ when swapping op_index. Break when the RIP relative address
+ is printed.
+ (OP_E): Properly handle RIP relative addressing and print the
+ explicit zero displacement for Intel mode.
+
2007-04-27 Alan Modra <amodra@bigpond.net.au>
* Makefile.am: Run "make dep-am".
diff --git a/opcodes/i386-dis.c b/opcodes/i386-dis.c
index 7f73705..9fd62f2 100644
--- a/opcodes/i386-dis.c
+++ b/opcodes/i386-dis.c
@@ -3773,6 +3773,8 @@ print_insn (bfd_vma pc, disassemble_info *info)
order as the intel book; everything else is printed in reverse order. */
if (intel_syntax || two_source_ops)
{
+ bfd_vma riprel;
+
for (i = 0; i < MAX_OPERANDS; ++i)
op_txt[i] = op_out[i];
@@ -3781,6 +3783,9 @@ print_insn (bfd_vma pc, disassemble_info *info)
op_ad = op_index[i];
op_index[i] = op_index[MAX_OPERANDS - 1 - i];
op_index[MAX_OPERANDS - 1 - i] = op_ad;
+ riprel = op_riprel[i];
+ op_riprel[i] = op_riprel [MAX_OPERANDS - 1 - i];
+ op_riprel[MAX_OPERANDS - 1 - i] = riprel;
}
}
else
@@ -3808,6 +3813,7 @@ print_insn (bfd_vma pc, disassemble_info *info)
(*info->fprintf_func) (info->stream, " # ");
(*info->print_address_func) ((bfd_vma) (start_pc + codep - start_codep
+ op_address[op_index[i]]), info);
+ break;
}
return codep - priv.the_buffer;
}
@@ -4835,11 +4841,16 @@ OP_E (int bytemode, int sizeflag)
}
}
- if (havebase || (havesib && (index != 4 || scale != 0)))
+ if (havebase
+ || (intel_syntax && riprel)
+ || (havesib && (index != 4 || scale != 0)))
{
*obufp++ = open_char;
if (intel_syntax && riprel)
- oappend ("rip + ");
+ {
+ set_op (disp, 1);
+ oappend ("rip");
+ }
*obufp = '\0';
if (havebase)
oappend (address_mode == mode_64bit && (sizeflag & AFLAG)
@@ -4864,9 +4875,10 @@ OP_E (int bytemode, int sizeflag)
oappend (scratchbuf);
}
}
- if (intel_syntax && disp)
+ if (intel_syntax
+ && (disp || modrm.mod != 0 || (base & 7) == 5))
{
- if ((bfd_signed_vma) disp > 0)
+ if ((bfd_signed_vma) disp >= 0)
{
*obufp++ = '+';
*obufp = '\0';