From: H.J. Lu Date: Sat, 3 Feb 2007 00:46:22 +0000 (+0000) Subject: ld/testsuite/ X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=206717e8e57f027995fe89804e11eddec53a52ad;p=binutils-gdb.git ld/testsuite/ 2076-02-02 H.J. Lu * ld-i386/pcrel16.d: Updated. * ld-x86-64/pcrel16.d: Likewise. opcodes/ 2076-02-02 H.J. Lu * i386-dis.c (OP_J): Mask to 16bit only if there is a data16 prefix. --- diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index 461e10ea23a..9814ca30dc3 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2076-02-02 H.J. Lu + + * ld-i386/pcrel16.d: Updated. + * ld-x86-64/pcrel16.d: Likewise. + 2007-02-01 Alan Modra * ld-scripts/default-script.exp: Add "--local-store 0:0" to diff --git a/ld/testsuite/ld-i386/pcrel16.d b/ld/testsuite/ld-i386/pcrel16.d index 3d45afeb42b..3df490797a8 100644 --- a/ld/testsuite/ld-i386/pcrel16.d +++ b/ld/testsuite/ld-i386/pcrel16.d @@ -12,4 +12,4 @@ Disassembly of section .text: 420: cd 42[ ]+int \$0x42 422: ca 02 00[ ]+lret \$0x2 ... - f065: e9 b8 13[ ]+jmp 420 <_start\+0x420> + f065: e9 b8 13[ ]+jmp 10420 <__bss_start\+0x3b8> diff --git a/ld/testsuite/ld-x86-64/pcrel16.d b/ld/testsuite/ld-x86-64/pcrel16.d index f593657271f..0ad5eef4df9 100644 --- a/ld/testsuite/ld-x86-64/pcrel16.d +++ b/ld/testsuite/ld-x86-64/pcrel16.d @@ -12,4 +12,4 @@ Disassembly of section .text: 420: cd 42[ ]+int \$0x42 422: ca 02 00[ ]+lret \$0x2 ... - f065: e9 b8 13[ ]+jmp 420 <_start\+0x420> + f065: e9 b8 13[ ]+jmp 10420 <_start\+0x10420> diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index 532e38f767d..2321dfab3f2 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,3 +1,8 @@ +2076-02-02 H.J. Lu + + * i386-dis.c (OP_J): Mask to 16bit only if there is a data16 + prefix. + 2007-02-02 H.J. Lu * avr-dis.c (avr_operand): Correct PR number in comment. diff --git a/opcodes/i386-dis.c b/opcodes/i386-dis.c index 58f630eac0d..aa206176d68 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;