aboutsummaryrefslogtreecommitdiff
path: root/opcodes
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2007-02-03 00:46:22 +0000
committerH.J. Lu <hjl.tools@gmail.com>2007-02-03 00:46:22 +0000
commit206717e8e57f027995fe89804e11eddec53a52ad (patch)
tree9d8a1920baa40d4d8f3ae6ef22eb395583cd97ad /opcodes
parent60242db2b7907f57e173809c0dfd36f10823d5c5 (diff)
downloadgdb-206717e8e57f027995fe89804e11eddec53a52ad.zip
gdb-206717e8e57f027995fe89804e11eddec53a52ad.tar.gz
gdb-206717e8e57f027995fe89804e11eddec53a52ad.tar.bz2
ld/testsuite/
2076-02-02 H.J. Lu <hongjiu.lu@intel.com> * ld-i386/pcrel16.d: Updated. * ld-x86-64/pcrel16.d: Likewise. opcodes/ 2076-02-02 H.J. Lu <hongjiu.lu@intel.com> * i386-dis.c (OP_J): Mask to 16bit only if there is a data16 prefix.
Diffstat (limited to 'opcodes')
-rw-r--r--opcodes/ChangeLog5
-rw-r--r--opcodes/i386-dis.c5
2 files changed, 9 insertions, 1 deletions
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog
index 532e38f..2321dfa 100644
--- a/opcodes/ChangeLog
+++ b/opcodes/ChangeLog
@@ -1,3 +1,8 @@
+2076-02-02 H.J. Lu <hongjiu.lu@intel.com>
+
+ * i386-dis.c (OP_J): Mask to 16bit only if there is a data16
+ prefix.
+
2007-02-02 H.J. Lu <hongjiu.lu@intel.com>
* avr-dis.c (avr_operand): Correct PR number in comment.
diff --git a/opcodes/i386-dis.c b/opcodes/i386-dis.c
index 58f630e..aa20617 100644
--- a/opcodes/i386-dis.c
+++ b/opcodes/i386-dis.c
@@ -4916,10 +4916,13 @@ OP_J (int bytemode, int sizeflag)
else
{
disp = get16 ();
+ if ((disp & 0x8000) != 0)
+ disp -= 0x10000;
/* For some reason, a data16 prefix on a jump instruction
means that the pc is masked to 16 bits after the
displacement is added! */
- mask = 0xffff;
+ if ((prefixes & PREFIX_DATA))
+ mask = 0xffff;
}
used_prefixes |= (prefixes & PREFIX_DATA);
break;