aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2009-06-01 16:31:00 +0000
committerH.J. Lu <hjl.tools@gmail.com>2009-06-01 16:31:00 +0000
commitd160e0350800d373c906f5fecd0bf0f61c61519c (patch)
tree2f16738179764e49dbb9ed42456755ca3937a956 /gas
parent51a5d0aaac0184ff3da2852d3804b20eb6ca3ff4 (diff)
downloadgdb-d160e0350800d373c906f5fecd0bf0f61c61519c.zip
gdb-d160e0350800d373c906f5fecd0bf0f61c61519c.tar.gz
gdb-d160e0350800d373c906f5fecd0bf0f61c61519c.tar.bz2
gas/
2009-06-01 H.J. Lu <hongjiu.lu@intel.com> PR gas/10198 * config/tc-i386-intel.c (i386_intel_operand): Check '$' as '.'. gas/testsuite/ 2009-06-01 H.J. Lu <hongjiu.lu@intel.com> PR gas/10198 * gas/i386/jump.s: Add test for "jmp $+2". * gas/i386/jump16.s: Likewise. * gas/i386/jump.d: Updated. * gas/i386/jump16.d: Likewise.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog5
-rw-r--r--gas/config/tc-i386-intel.c5
-rw-r--r--gas/testsuite/ChangeLog9
-rw-r--r--gas/testsuite/gas/i386/jump.d4
-rw-r--r--gas/testsuite/gas/i386/jump.s4
-rw-r--r--gas/testsuite/gas/i386/jump16.d18
-rw-r--r--gas/testsuite/gas/i386/jump16.s4
7 files changed, 42 insertions, 7 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 436f84b..13750e0 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,8 @@
+2009-06-01 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR gas/10198
+ * config/tc-i386-intel.c (i386_intel_operand): Check '$' as '.'.
+
2009-05-26 Catherine Moore <clm@codesourcery.com>
* config/tc-mips.c (check_for_24k_errata): Remove.
diff --git a/gas/config/tc-i386-intel.c b/gas/config/tc-i386-intel.c
index e76e527..64d83e3 100644
--- a/gas/config/tc-i386-intel.c
+++ b/gas/config/tc-i386-intel.c
@@ -475,6 +475,11 @@ i386_intel_operand (char *operand_string, int got_a_float)
saved_input_line_pointer = input_line_pointer;
input_line_pointer = buf = xstrdup (operand_string);
+ /* A '$' followed by an identifier char is an identifier. Otherwise,
+ it's operator '.' followed by an expression. */
+ if (*buf == '$' && !is_identifier_char (buf[1]))
+ *buf = '.';
+
intel_syntax = -1;
memset (&exp, 0, sizeof(exp));
exp_seg = expression (&exp);
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog
index 5b63819..734e19c 100644
--- a/gas/testsuite/ChangeLog
+++ b/gas/testsuite/ChangeLog
@@ -1,3 +1,12 @@
+2009-06-01 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR gas/10198
+ * gas/i386/jump.s: Add test for "jmp $+2".
+ * gas/i386/jump16.s: Likewise.
+
+ * gas/i386/jump.d: Updated.
+ * gas/i386/jump16.d: Likewise.
+
2009-05-26 Catherine Moore <clm@codesourcery.com>
* gas/mips/eret.s: Remove.
diff --git a/gas/testsuite/gas/i386/jump.d b/gas/testsuite/gas/i386/jump.d
index 92e74be..69426f0 100644
--- a/gas/testsuite/gas/i386/jump.d
+++ b/gas/testsuite/gas/i386/jump.d
@@ -32,4 +32,8 @@ Disassembly of section .text:
[ ]*[a-f0-9]+: 66 ff 23 jmpw \*\(%ebx\)
[ ]*[a-f0-9]+: ff 23 jmp \*\(%ebx\)
[ ]*[a-f0-9]+: ff 2b ljmp \*\(%ebx\)
+[ ]*[a-f0-9]+: eb 00 jmp 0x7b
+[ ]*[a-f0-9]+: 90 nop
+[ ]*[a-f0-9]+: eb 00 jmp 0x7e
+[ ]*[a-f0-9]+: 90 nop
#pass
diff --git a/gas/testsuite/gas/i386/jump.s b/gas/testsuite/gas/i386/jump.s
index b760825..71693ce 100644
--- a/gas/testsuite/gas/i386/jump.s
+++ b/gas/testsuite/gas/i386/jump.s
@@ -31,3 +31,7 @@
jmp word ptr [ebx]
jmp dword ptr [ebx]
jmp fword ptr [ebx]
+ jmp $+2
+ nop
+ jmp .+2
+ nop
diff --git a/gas/testsuite/gas/i386/jump16.d b/gas/testsuite/gas/i386/jump16.d
index b2903d7..db5d44a 100644
--- a/gas/testsuite/gas/i386/jump16.d
+++ b/gas/testsuite/gas/i386/jump16.d
@@ -6,23 +6,23 @@
Disassembly of section .text:
0+ <.text>:
-[ ]*[a-f0-9]+: eb fe jmp 0x0
+[ ]*[a-f0-9]+: eb fe jmp (0x0|0 <.text>)
[ ]*[a-f0-9]+: e9 fe ff jmp 0x3 3: R_386_PC16 xxx
[ ]*[a-f0-9]+: ff 26 00 00 jmp \*0x0 7: R_386_16 xxx
[ ]*[a-f0-9]+: 66 ff e7 jmpl \*%edi
[ ]*[a-f0-9]+: 67 ff 27 addr32 jmp \*\(%edi\)
-[ ]*[a-f0-9]+: 67 ff af 00 00 00 00 addr32 ljmp \*0x0\(%edi\) 12: R_386_32 xxx
+[ ]*[a-f0-9]+: 67 ff af 00 00 00 00 addr32 ljmp \*0x0\(%edi\) 12: (R_386_)?(dir)?32 xxx
[ ]*[a-f0-9]+: ff 2e 00 00 ljmp \*0x0 18: R_386_16 xxx
[ ]*[a-f0-9]+: ea 00 00 34 12 ljmp \$0x1234,\$0x0 1b: R_386_16 xxx
[ ]*[a-f0-9]+: 66 e8 db ff ff ff calll 0x0
-[ ]*[a-f0-9]+: 66 e8 fc ff ff ff calll 0x27 27: R_386_PC32 xxx
+[ ]*[a-f0-9]+: 66 e8 fc ff ff ff calll 0x27 27: (R_386_PC)?(DISP)?32 xxx
[ ]*[a-f0-9]+: 66 ff 16 00 00 calll \*0x0 2e: R_386_16 xxx
[ ]*[a-f0-9]+: 66 ff d7 calll \*%edi
[ ]*[a-f0-9]+: 67 66 ff 17 addr32 calll \*\(%edi\)
-[ ]*[a-f0-9]+: 67 66 ff 9f 00 00 00 00 addr32 lcalll \*0x0\(%edi\) 3b: R_386_32 xxx
+[ ]*[a-f0-9]+: 67 66 ff 9f 00 00 00 00 addr32 lcalll \*0x0\(%edi\) 3b: (R_386_)?(dir)?32 xxx
[ ]*[a-f0-9]+: 66 ff 1e 00 00 lcalll \*0x0 42: R_386_16 xxx
-[ ]*[a-f0-9]+: 66 9a 00 00 00 00 34 12 lcalll \$0x1234,\$0x0 46: R_386_32 xxx
-[ ]*[a-f0-9]+: eb b2 jmp 0x0
+[ ]*[a-f0-9]+: 66 9a 00 00 00 00 34 12 lcalll \$0x1234,\$0x0 46: (R_386_)?(dir)?32 xxx
+[ ]*[a-f0-9]+: eb b2 jmp (0x0|0 <.text>)
[ ]*[a-f0-9]+: ff 26 00 00 jmp \*0x0 50: R_386_16 xxx
[ ]*[a-f0-9]+: ff e7 jmp \*%di
[ ]*[a-f0-9]+: ff 25 jmp \*\(%di\)
@@ -31,7 +31,7 @@ Disassembly of section .text:
[ ]*[a-f0-9]+: ff 2e 00 00 ljmp \*0x0 61: R_386_16 xxx
[ ]*[a-f0-9]+: 66 ff 2e 00 00 ljmpl \*0x0 66: R_386_16 xxx
[ ]*[a-f0-9]+: ea 00 00 34 12 ljmp \$0x1234,\$0x0 69: R_386_16 xxx
-[ ]*[a-f0-9]+: e8 90 ff call 0x0
+[ ]*[a-f0-9]+: e8 90 ff call (0x0|0 <.text>)
[ ]*[a-f0-9]+: e8 fe ff call 0x71 71: R_386_PC16 xxx
[ ]*[a-f0-9]+: ff 16 00 00 call \*0x0 75: R_386_16 xxx
[ ]*[a-f0-9]+: ff d7 call \*%di
@@ -47,4 +47,8 @@ Disassembly of section .text:
[ ]*[a-f0-9]+: ff 27 jmp \*\(%bx\)
[ ]*[a-f0-9]+: ff 2f ljmp \*\(%bx\)
[ ]*[a-f0-9]+: 66 ff 2f ljmpl \*\(%bx\)
+[ ]*[a-f0-9]+: eb 00 jmp 0xa2
+[ ]*[a-f0-9]+: 90 nop
+[ ]*[a-f0-9]+: eb 00 jmp 0xa5
+[ ]*[a-f0-9]+: 90 nop
#pass
diff --git a/gas/testsuite/gas/i386/jump16.s b/gas/testsuite/gas/i386/jump16.s
index d6238b8..7ad9c6b 100644
--- a/gas/testsuite/gas/i386/jump16.s
+++ b/gas/testsuite/gas/i386/jump16.s
@@ -50,3 +50,7 @@
jmp word ptr [bx]
jmp dword ptr [bx]
jmp fword ptr [bx]
+ jmp $+2
+ nop
+ jmp .+2
+ nop