This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
PATCH: Fix [0x8000] memory after offset
- From: "H.J. Lu" <hongjiu dot lu at intel dot com>
- To: binutils at sources dot redhat dot com
- Date: Tue, 15 Sep 2009 11:36:22 -0700
- Subject: PATCH: Fix [0x8000] memory after offset
- Reply-to: "H.J. Lu" <hjl dot tools at gmail dot com>
Hi,
When there is
mov eax, offset 0xEE000F0
we set intel_state.has_offset, but never clear it. This patch fixes
it.
H.J.
---
gas/
2009-09-15 H.J. Lu <hongjiu.lu@intel.com>
* config/tc-i386-intel.c (i386_intel_operand): Initialize
intel_state.has_offset to 0.
gas/testsuite/
2009-09-15 H.J. Lu <hongjiu.lu@intel.com>
* gas/i386/disp.s: Add an offset test.
* gas/i386/x86-64-disp.s: Likewise.
* gas/i386/intelbad.s: Comment out "byte ptr [1]" test.
* gas/i386/disp.d: Updated.
* gas/i386/disp-intel.d: Likewise.
* gas/i386/intelbad.l: Likewise.
* gas/i386/x86-64-disp.d: Likewise.
* gas/i386/x86-64-disp-intel.d: Likewise.
Index: testsuite/gas/i386/disp.d
===================================================================
--- testsuite/gas/i386/disp.d (revision 6832)
+++ testsuite/gas/i386/disp.d (working copy)
@@ -16,6 +16,7 @@ Disassembly of section .text:
[ ]*[a-f0-9]+: a1 ff ff ff 7f mov 0x7fffffff,%eax
[ ]*[a-f0-9]+: a1 00 00 00 80 mov 0x80000000,%eax
[ ]*[a-f0-9]+: a1 00 00 00 80 mov 0x80000000,%eax
+[ ]*[a-f0-9]+: b8 f0 00 e0 0e mov \$0xee000f0,%eax
[ ]*[a-f0-9]+: 89 98 f0 00 e0 0e mov %ebx,0xee000f0\(%eax\)
[ ]*[a-f0-9]+: 89 98 f0 00 e0 0e mov %ebx,0xee000f0\(%eax\)
[ ]*[a-f0-9]+: 65 89 98 f0 00 e0 0e mov %ebx,%gs:0xee000f0\(%eax\)
Index: testsuite/gas/i386/disp-intel.d
===================================================================
--- testsuite/gas/i386/disp-intel.d (revision 6832)
+++ testsuite/gas/i386/disp-intel.d (working copy)
@@ -16,6 +16,7 @@ Disassembly of section .text:
[ ]*[a-f0-9]+: a1 ff ff ff 7f mov eax,ds:0x7fffffff
[ ]*[a-f0-9]+: a1 00 00 00 80 mov eax,ds:0x80000000
[ ]*[a-f0-9]+: a1 00 00 00 80 mov eax,ds:0x80000000
+[ ]*[a-f0-9]+: b8 f0 00 e0 0e mov eax,0xee000f0
[ ]*[a-f0-9]+: 89 98 f0 00 e0 0e mov DWORD PTR \[eax\+0xee000f0\],ebx
[ ]*[a-f0-9]+: 89 98 f0 00 e0 0e mov DWORD PTR \[eax\+0xee000f0\],ebx
[ ]*[a-f0-9]+: 65 89 98 f0 00 e0 0e mov DWORD PTR gs:\[eax\+0xee000f0\],ebx
Index: testsuite/gas/i386/x86-64-disp.d
===================================================================
--- testsuite/gas/i386/x86-64-disp.d (revision 6832)
+++ testsuite/gas/i386/x86-64-disp.d (working copy)
@@ -16,6 +16,7 @@ Disassembly of section .text:
[ ]*[a-f0-9]+: 8b 04 25 00 00 00 80 mov 0xffffffff80000000,%eax
[ ]*[a-f0-9]+: 8b 04 25 ff ff ff 7f mov 0x7fffffff,%eax
[ ]*[a-f0-9]+: a1 00 00 00 80 00 00 00 00 mov 0x80000000,%eax
+[ ]*[a-f0-9]+: b8 f0 00 e0 0e mov \$0xee000f0,%eax
[ ]*[a-f0-9]+: 89 98 f0 00 e0 0e mov %ebx,0xee000f0\(%rax\)
[ ]*[a-f0-9]+: 89 98 f0 00 e0 0e mov %ebx,0xee000f0\(%rax\)
[ ]*[a-f0-9]+: 65 89 98 f0 00 e0 0e mov %ebx,%gs:0xee000f0\(%rax\)
Index: testsuite/gas/i386/disp.s
===================================================================
--- testsuite/gas/i386/disp.s (revision 6832)
+++ testsuite/gas/i386/disp.s (working copy)
@@ -10,6 +10,8 @@
mov -0x80000000,%eax
.intel_syntax noprefix
+ mov eax, offset 0xEE000F0
+
mov DWORD PTR [eax+0xEE000F0], ebx
mov [eax+0xEE000F0], ebx
mov DWORD PTR gs:[eax+0xEE000F0], ebx
Index: testsuite/gas/i386/x86-64-disp.s
===================================================================
--- testsuite/gas/i386/x86-64-disp.s (revision 6832)
+++ testsuite/gas/i386/x86-64-disp.s (working copy)
@@ -10,6 +10,8 @@
mov 0x80000000,%eax
.intel_syntax noprefix
+ mov eax, offset 0xEE000F0
+
mov DWORD PTR [rax+0xEE000F0], ebx
mov [rax+0xEE000F0], ebx
mov DWORD PTR gs:[rax+0xEE000F0], ebx
Index: testsuite/gas/i386/intelbad.l
===================================================================
--- testsuite/gas/i386/intelbad.l (revision 6828)
+++ testsuite/gas/i386/intelbad.l (working copy)
@@ -151,5 +151,4 @@
.*:167: Error: .*
.*:168: Error: .*
.*:169: Error: .*
-.*:170: Error: .*
.*:172: Error: .*
Index: testsuite/gas/i386/intelbad.s
===================================================================
--- testsuite/gas/i386/intelbad.s (revision 6828)
+++ testsuite/gas/i386/intelbad.s (working copy)
@@ -167,6 +167,6 @@ start:
movzx eax, byte ptr [gs:eax]
movzx eax, byte gs:ptr [eax]
movzx eax, byte ptr 1
- movzx eax, byte ptr [1]
+#XXX? movzx eax, byte ptr [1]
mov eax, 3:5
Index: testsuite/gas/i386/x86-64-disp-intel.d
===================================================================
--- testsuite/gas/i386/x86-64-disp-intel.d (revision 6832)
+++ testsuite/gas/i386/x86-64-disp-intel.d (working copy)
@@ -17,6 +17,7 @@ Disassembly of section .text:
[ ]*[a-f0-9]+: 8b 04 25 00 00 00 80 mov eax,DWORD PTR ds:0xffffffff80000000
[ ]*[a-f0-9]+: 8b 04 25 ff ff ff 7f mov eax,DWORD PTR ds:0x7fffffff
[ ]*[a-f0-9]+: a1 00 00 00 80 00 00 00 00 mov eax,ds:0x80000000
+[ ]*[a-f0-9]+: b8 f0 00 e0 0e mov eax,0xee000f0
[ ]*[a-f0-9]+: 89 98 f0 00 e0 0e mov DWORD PTR \[rax\+0xee000f0\],ebx
[ ]*[a-f0-9]+: 89 98 f0 00 e0 0e mov DWORD PTR \[rax\+0xee000f0\],ebx
[ ]*[a-f0-9]+: 65 89 98 f0 00 e0 0e mov DWORD PTR gs:\[rax\+0xee000f0\],ebx
Index: config/tc-i386-intel.c
===================================================================
--- config/tc-i386-intel.c (revision 6832)
+++ config/tc-i386-intel.c (working copy)
@@ -466,6 +466,7 @@ i386_intel_operand (char *operand_string
/* Initialize state structure. */
intel_state.op_modifier = O_absent;
intel_state.is_mem = 0;
+ intel_state.has_offset = 0;
intel_state.base = NULL;
intel_state.index = NULL;
intel_state.seg = NULL;