diff --git a/gas/ChangeLog b/gas/ChangeLog index 436f84b44b..13750e00c4 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,8 @@ +2009-06-01 H.J. Lu + + PR gas/10198 + * config/tc-i386-intel.c (i386_intel_operand): Check '$' as '.'. + 2009-05-26 Catherine Moore * 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 e76e527546..64d83e3648 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 5b63819f1c..734e19cde2 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,3 +1,12 @@ +2009-06-01 H.J. Lu + + 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 * gas/mips/eret.s: Remove. diff --git a/gas/testsuite/gas/i386/jump.d b/gas/testsuite/gas/i386/jump.d index 92e74bef68..69426f02b3 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 b7608255c1..71693ce4f1 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 b2903d764a..db5d44ab86 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 d6238b8639..7ad9c6bb91 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