From: Peter Johnson Date: Fri, 2 Jan 2009 08:33:21 +0000 (-0000) Subject: Allow @ signs in identifiers in win32/win64 only. X-Git-Tag: v0.8.0~23 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b7a38ed4fdb71dd6b9f16614b2f015a0051e8ae2;p=yasm Allow @ signs in identifiers in win32/win64 only. In ELF, @ is used to indicate special relocations. Fixes #164. Reported by: Gregory McGarry on yasm-devel@ Testcase by: Gregory McGarry We don't allow identifiers to start with @; doing so conflicts with use of e.g. "@function" in some directives. Need to look into what GAS does. svn path=/trunk/yasm/; revision=2166 --- diff --git a/libyasm/objfmt.h b/libyasm/objfmt.h index c65e76c1..d30e75e2 100644 --- a/libyasm/objfmt.h +++ b/libyasm/objfmt.h @@ -62,6 +62,9 @@ struct yasm_objfmt_module { */ const unsigned char default_x86_mode_bits; + /** If @ signs should be legal in identifiers. */ + const unsigned char id_at_ok; + /** NULL-terminated list of debug format (yasm_dbgfmt) keywords that are * valid to use with this object format. The null debug format * (null_dbgfmt, "null") should always be in this list so it's possible to diff --git a/modules/objfmts/bin/bin-objfmt.c b/modules/objfmts/bin/bin-objfmt.c index e05a5acb..3a64429d 100644 --- a/modules/objfmts/bin/bin-objfmt.c +++ b/modules/objfmts/bin/bin-objfmt.c @@ -1798,6 +1798,7 @@ yasm_objfmt_module yasm_bin_LTX_objfmt = { "bin", NULL, 16, + 0, bin_objfmt_dbgfmt_keywords, "null", bin_objfmt_directives, @@ -1949,6 +1950,7 @@ yasm_objfmt_module yasm_dosexe_LTX_objfmt = { "dosexe", "exe", 16, + 0, bin_objfmt_dbgfmt_keywords, "null", bin_objfmt_directives, diff --git a/modules/objfmts/coff/coff-objfmt.c b/modules/objfmts/coff/coff-objfmt.c index 448682e2..b9f4494e 100644 --- a/modules/objfmts/coff/coff-objfmt.c +++ b/modules/objfmts/coff/coff-objfmt.c @@ -2199,6 +2199,7 @@ yasm_objfmt_module yasm_coff_LTX_objfmt = { "coff", "o", 32, + 0, coff_objfmt_dbgfmt_keywords, "null", coff_objfmt_directives, @@ -2250,6 +2251,7 @@ yasm_objfmt_module yasm_win32_LTX_objfmt = { "win32", "obj", 32, + 1, winXX_objfmt_dbgfmt_keywords, "null", win32_objfmt_directives, @@ -2303,6 +2305,7 @@ yasm_objfmt_module yasm_win64_LTX_objfmt = { "win64", "obj", 64, + 1, winXX_objfmt_dbgfmt_keywords, "null", win64_objfmt_directives, @@ -2319,6 +2322,7 @@ yasm_objfmt_module yasm_x64_LTX_objfmt = { "x64", "obj", 64, + 1, winXX_objfmt_dbgfmt_keywords, "null", win64_objfmt_directives, diff --git a/modules/objfmts/dbg/dbg-objfmt.c b/modules/objfmts/dbg/dbg-objfmt.c index ad5f14a1..5a71c4f1 100644 --- a/modules/objfmts/dbg/dbg-objfmt.c +++ b/modules/objfmts/dbg/dbg-objfmt.c @@ -162,6 +162,7 @@ yasm_objfmt_module yasm_dbg_LTX_objfmt = { "dbg", "dbg", 32, + 0, dbg_objfmt_dbgfmt_keywords, "null", NULL, /* no directives */ diff --git a/modules/objfmts/elf/elf-objfmt.c b/modules/objfmts/elf/elf-objfmt.c index 02051de1..4ceccc25 100644 --- a/modules/objfmts/elf/elf-objfmt.c +++ b/modules/objfmts/elf/elf-objfmt.c @@ -1347,6 +1347,7 @@ yasm_objfmt_module yasm_elf_LTX_objfmt = { "elf", "o", 32, + 0, elf_objfmt_dbgfmt_keywords, "null", elf_objfmt_directives, @@ -1364,6 +1365,7 @@ yasm_objfmt_module yasm_elf32_LTX_objfmt = { "elf32", "o", 32, + 0, elf_objfmt_dbgfmt_keywords, "null", elf_objfmt_directives, @@ -1381,6 +1383,7 @@ yasm_objfmt_module yasm_elf64_LTX_objfmt = { "elf64", "o", 64, + 0, elf_objfmt_dbgfmt_keywords, "null", elf_objfmt_directives, diff --git a/modules/objfmts/macho/macho-objfmt.c b/modules/objfmts/macho/macho-objfmt.c index e825dbef..a57c4c73 100644 --- a/modules/objfmts/macho/macho-objfmt.c +++ b/modules/objfmts/macho/macho-objfmt.c @@ -1555,6 +1555,7 @@ yasm_objfmt_module yasm_macho_LTX_objfmt = { "macho", "o", 32, + 0, macho_objfmt_dbgfmt_keywords, "null", NULL, /* no directives */ @@ -1572,6 +1573,7 @@ yasm_objfmt_module yasm_macho32_LTX_objfmt = { "macho32", "o", 32, + 0, macho_objfmt_dbgfmt_keywords, "null", NULL, /* no directives */ @@ -1589,6 +1591,7 @@ yasm_objfmt_module yasm_macho64_LTX_objfmt = { "macho64", "o", 64, + 0, macho_objfmt_dbgfmt_keywords, "null", NULL, /* no directives */ diff --git a/modules/objfmts/rdf/rdf-objfmt.c b/modules/objfmts/rdf/rdf-objfmt.c index 962f02f6..8b704a54 100644 --- a/modules/objfmts/rdf/rdf-objfmt.c +++ b/modules/objfmts/rdf/rdf-objfmt.c @@ -1079,6 +1079,7 @@ yasm_objfmt_module yasm_rdf_LTX_objfmt = { "rdf", "rdf", 32, + 0, rdf_objfmt_dbgfmt_keywords, "null", rdf_objfmt_directives, diff --git a/modules/objfmts/win32/tests/Makefile.inc b/modules/objfmts/win32/tests/Makefile.inc index 3b16d3db..b2b6800c 100644 --- a/modules/objfmts/win32/tests/Makefile.inc +++ b/modules/objfmts/win32/tests/Makefile.inc @@ -17,3 +17,7 @@ EXTRA_DIST += modules/objfmts/win32/tests/win32-segof.hex EXTRA_DIST += modules/objfmts/win32/tests/win32test.c EXTRA_DIST += modules/objfmts/win32/tests/win32test.asm EXTRA_DIST += modules/objfmts/win32/tests/win32test.hex + +EXTRA_DIST += modules/objfmts/win32/tests/gas/Makefile.inc + +include modules/objfmts/win32/tests/gas/Makefile.inc diff --git a/modules/objfmts/win32/tests/gas/Makefile.inc b/modules/objfmts/win32/tests/gas/Makefile.inc new file mode 100644 index 00000000..fb319233 --- /dev/null +++ b/modules/objfmts/win32/tests/gas/Makefile.inc @@ -0,0 +1,7 @@ +# $Id$ + +TESTS += modules/objfmts/win32/tests/gas/win32_gas_test.sh + +EXTRA_DIST += modules/objfmts/win32/tests/gas/win32_gas_test.sh +EXTRA_DIST += modules/objfmts/win32/tests/gas/win32at.asm +EXTRA_DIST += modules/objfmts/win32/tests/gas/win32at.hex diff --git a/modules/objfmts/win32/tests/gas/win32_gas_test.sh b/modules/objfmts/win32/tests/gas/win32_gas_test.sh new file mode 100755 index 00000000..ed5e3c32 --- /dev/null +++ b/modules/objfmts/win32/tests/gas/win32_gas_test.sh @@ -0,0 +1,4 @@ +#! /bin/sh +# $Id$ +${srcdir}/out_test.sh win32_gas_test modules/objfmts/win32/tests/gas "win32 objfmt" "-f win32 -p gas" ".obj" +exit $? diff --git a/modules/objfmts/win32/tests/gas/win32at.asm b/modules/objfmts/win32/tests/gas/win32at.asm new file mode 100644 index 00000000..f56520a2 --- /dev/null +++ b/modules/objfmts/win32/tests/gas/win32at.asm @@ -0,0 +1,167 @@ +.section .rodata +L2586: +.ascii "myWindowClass\0" +.globl _g_szClassName +_g_szClassName: +.byte 109 +.byte 121 +.byte 87 +.byte 105 +.byte 110 +.byte 100 +.byte 111 +.byte 119 +.byte 67 +.byte 108 +.byte 97 +.byte 115 +.byte 115 +.byte 0 +.text +.align 4 +.globl _WndProc@16 +_WndProc@16: +pushl %ebp +movl %esp,%ebp +subl $8,%esp +L2588: +L2590: +movl 12(%ebp),%eax +movl %eax,-4(%ebp) +jmp L2592 +L2593: +pushl 8(%ebp) +call _DestroyWindow@4 +jmp L2591 +L2594: +pushl $0 +call _PostQuitMessage@4 +jmp L2591 +L2595: +pushl 20(%ebp) +pushl 16(%ebp) +pushl 12(%ebp) +pushl 8(%ebp) +call _DefWindowProcA@16 +movl %eax,-8(%ebp) +jmp L2589 +L2592: +cmpl $2,-4(%ebp) +je L2594 +cmpl $16,-4(%ebp) +je L2593 +jmp L2595 +L2591: +movl $0,-8(%ebp) +jmp L2589 +L2589: +movl -8(%ebp),%eax +leave +ret $16 +.section .rodata +L2600: +.ascii "Window Registration Failed!\0" +L2601: +.ascii "Error!\0" +L2602: +.ascii "The title of my window\0" +L2604: +.ascii "Window Creation Failed!\0" +.text +.align 4 +.globl _WinMain@16 +_WinMain@16: +pushl %ebp +movl %esp,%ebp +subl $84,%esp +L2596: +L2598: +movl $48,-48(%ebp) +movl $0,-44(%ebp) +movl $_WndProc@16,-40(%ebp) +movl $0,-36(%ebp) +movl $0,-32(%ebp) +movl 8(%ebp),%eax +movl %eax,-28(%ebp) +pushl $32512 +pushl $0 +call _LoadIconA@8 +movl %eax,-24(%ebp) +pushl $32512 +pushl $0 +call _LoadCursorA@8 +movl %eax,-20(%ebp) +movl $6,-16(%ebp) +movl $0,-12(%ebp) +movl $_g_szClassName,-8(%ebp) +pushl $32512 +pushl $0 +call _LoadIconA@8 +movl %eax,-4(%ebp) +leal -48(%ebp),%edx +pushl %edx +call _RegisterClassExA@4 +cmpw $0,%ax +jne L2599 +pushl $48 +pushl $L2601 +pushl $L2600 +pushl $0 +call _MessageBoxA@16 +movl $0,-84(%ebp) +jmp L2597 +L2599: +pushl $0 +pushl 8(%ebp) +pushl $0 +pushl $0 +pushl $120 +pushl $240 +pushl $-2147483648 +pushl $-2147483648 +pushl $13565952 +pushl $L2602 +pushl $_g_szClassName +pushl $512 +call _CreateWindowExA@48 +movl %eax,-52(%ebp) +cmpl $0,-52(%ebp) +jne L2603 +pushl $48 +pushl $L2601 +pushl $L2604 +pushl $0 +call _MessageBoxA@16 +movl $0,-84(%ebp) +jmp L2597 +L2603: +pushl 20(%ebp) +pushl -52(%ebp) +call _ShowWindow@8 +pushl -52(%ebp) +call _UpdateWindow@4 +L2605: +pushl $0 +pushl $0 +pushl $0 +leal -80(%ebp),%edx +pushl %edx +call _GetMessageA@16 +cmpl $0,%eax +jle L2606 +leal -80(%ebp),%eax +pushl %eax +call _TranslateMessage@4 +leal -80(%ebp),%eax +pushl %eax +call _DispatchMessageA@4 +jmp L2605 +L2606: +movl -72(%ebp),%eax +movl %eax,-84(%ebp) +jmp L2597 +L2597: +movl -84(%ebp),%eax +leave +ret $16 +.ident "PCC: pcc 0.9.9 (win32)" diff --git a/modules/objfmts/win32/tests/gas/win32at.hex b/modules/objfmts/win32/tests/gas/win32at.hex new file mode 100644 index 00000000..22a9f128 --- /dev/null +++ b/modules/objfmts/win32/tests/gas/win32at.hex @@ -0,0 +1,1635 @@ +4c +01 +03 +00 +00 +00 +00 +00 +91 +03 +00 +00 +18 +00 +00 +00 +00 +00 +0c +01 +2e +74 +65 +78 +74 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +99 +01 +00 +00 +8c +00 +00 +00 +25 +02 +00 +00 +00 +00 +00 +00 +17 +00 +00 +00 +20 +00 +50 +60 +2e +72 +6f +64 +61 +74 +61 +00 +99 +01 +00 +00 +00 +00 +00 +00 +6e +00 +00 +00 +0b +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +40 +00 +40 +40 +2f +34 +00 +00 +00 +00 +00 +00 +07 +02 +00 +00 +00 +00 +00 +00 +18 +00 +00 +00 +79 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +40 +00 +40 +40 +55 +89 +e5 +83 +ec +08 +8b +45 +0c +89 +45 +fc +eb +29 +ff +75 +08 +e8 +00 +00 +00 +00 +eb +2d +6a +00 +e8 +00 +00 +00 +00 +eb +24 +ff +75 +14 +ff +75 +10 +ff +75 +0c +ff +75 +08 +e8 +00 +00 +00 +00 +89 +45 +f8 +eb +17 +83 +7d +fc +02 +74 +db +83 +7d +fc +10 +74 +cb +eb +dc +c7 +45 +f8 +00 +00 +00 +00 +eb +00 +8b +45 +f8 +c9 +c2 +10 +00 +8d +76 +00 +55 +89 +e5 +83 +ec +54 +c7 +45 +d0 +30 +00 +00 +00 +c7 +45 +d4 +00 +00 +00 +00 +c7 +45 +d8 +00 +00 +00 +00 +c7 +45 +dc +00 +00 +00 +00 +c7 +45 +e0 +00 +00 +00 +00 +8b +45 +08 +89 +45 +e4 +68 +00 +7f +00 +00 +6a +00 +e8 +00 +00 +00 +00 +89 +45 +e8 +68 +00 +7f +00 +00 +6a +00 +e8 +00 +00 +00 +00 +89 +45 +ec +c7 +45 +f0 +06 +00 +00 +00 +c7 +45 +f4 +00 +00 +00 +00 +c7 +45 +f8 +0e +00 +00 +00 +68 +00 +7f +00 +00 +6a +00 +e8 +00 +00 +00 +00 +89 +45 +fc +8d +55 +d0 +52 +e8 +00 +00 +00 +00 +66 +83 +f8 +00 +75 +1f +6a +30 +68 +38 +00 +00 +00 +68 +1c +00 +00 +00 +6a +00 +e8 +00 +00 +00 +00 +c7 +45 +ac +00 +00 +00 +00 +e9 +9b +00 +00 +00 +6a +00 +ff +75 +08 +6a +00 +6a +00 +6a +78 +68 +f0 +00 +00 +00 +68 +00 +00 +00 +80 +68 +00 +00 +00 +80 +68 +00 +00 +cf +00 +68 +3f +00 +00 +00 +68 +0e +00 +00 +00 +68 +00 +02 +00 +00 +e8 +00 +00 +00 +00 +89 +45 +cc +83 +7d +cc +00 +75 +1c +6a +30 +68 +38 +00 +00 +00 +68 +56 +00 +00 +00 +6a +00 +e8 +00 +00 +00 +00 +c7 +45 +ac +00 +00 +00 +00 +eb +43 +ff +75 +14 +ff +75 +cc +e8 +00 +00 +00 +00 +ff +75 +cc +e8 +00 +00 +00 +00 +6a +00 +6a +00 +6a +00 +8d +55 +b0 +52 +e8 +00 +00 +00 +00 +83 +f8 +00 +7e +14 +8d +45 +b0 +50 +e8 +00 +00 +00 +00 +8d +45 +b0 +50 +e8 +00 +00 +00 +00 +eb +d8 +8b +45 +b8 +89 +45 +ac +eb +00 +8b +45 +ac +c9 +c2 +10 +00 +12 +00 +00 +00 +08 +00 +00 +00 +14 +00 +1b +00 +00 +00 +09 +00 +00 +00 +14 +00 +2e +00 +00 +00 +0a +00 +00 +00 +14 +00 +6f +00 +00 +00 +02 +00 +00 +00 +06 +00 +8f +00 +00 +00 +0c +00 +00 +00 +14 +00 +9e +00 +00 +00 +0d +00 +00 +00 +14 +00 +b6 +00 +00 +00 +04 +00 +00 +00 +06 +00 +c2 +00 +00 +00 +0c +00 +00 +00 +14 +00 +ce +00 +00 +00 +0e +00 +00 +00 +14 +00 +db +00 +00 +00 +04 +00 +00 +00 +06 +00 +e0 +00 +00 +00 +04 +00 +00 +00 +06 +00 +e7 +00 +00 +00 +0f +00 +00 +00 +14 +00 +17 +01 +00 +00 +04 +00 +00 +00 +06 +00 +1c +01 +00 +00 +04 +00 +00 +00 +06 +00 +26 +01 +00 +00 +10 +00 +00 +00 +14 +00 +36 +01 +00 +00 +04 +00 +00 +00 +06 +00 +3b +01 +00 +00 +04 +00 +00 +00 +06 +00 +42 +01 +00 +00 +0f +00 +00 +00 +14 +00 +56 +01 +00 +00 +11 +00 +00 +00 +14 +00 +5e +01 +00 +00 +12 +00 +00 +00 +14 +00 +6d +01 +00 +00 +13 +00 +00 +00 +14 +00 +7b +01 +00 +00 +14 +00 +00 +00 +14 +00 +84 +01 +00 +00 +15 +00 +00 +00 +14 +00 +6d +79 +57 +69 +6e +64 +6f +77 +43 +6c +61 +73 +73 +00 +6d +79 +57 +69 +6e +64 +6f +77 +43 +6c +61 +73 +73 +00 +57 +69 +6e +64 +6f +77 +20 +52 +65 +67 +69 +73 +74 +72 +61 +74 +69 +6f +6e +20 +46 +61 +69 +6c +65 +64 +21 +00 +45 +72 +72 +6f +72 +21 +00 +54 +68 +65 +20 +74 +69 +74 +6c +65 +20 +6f +66 +20 +6d +79 +20 +77 +69 +6e +64 +6f +77 +00 +57 +69 +6e +64 +6f +77 +20 +43 +72 +65 +61 +74 +69 +6f +6e +20 +46 +61 +69 +6c +65 +64 +21 +00 +00 +50 +43 +43 +3a +20 +70 +63 +63 +20 +30 +2e +39 +2e +39 +20 +28 +77 +69 +6e +33 +32 +29 +00 +2e +66 +69 +6c +65 +00 +00 +00 +00 +00 +00 +00 +fe +ff +00 +00 +67 +01 +2d +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +2e +74 +65 +78 +74 +00 +00 +00 +00 +00 +00 +00 +01 +00 +00 +00 +03 +01 +99 +01 +00 +00 +17 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +2e +72 +6f +64 +61 +74 +61 +00 +00 +00 +00 +00 +02 +00 +00 +00 +03 +01 +6e +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +0f +00 +00 +00 +0e +00 +00 +00 +02 +00 +00 +00 +02 +00 +00 +00 +00 +00 +1e +00 +00 +00 +00 +00 +00 +00 +01 +00 +00 +00 +02 +00 +00 +00 +00 +00 +2a +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +02 +00 +00 +00 +00 +00 +3b +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +02 +00 +00 +00 +00 +00 +4e +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +02 +00 +00 +00 +00 +00 +61 +00 +00 +00 +58 +00 +00 +00 +01 +00 +00 +00 +02 +00 +00 +00 +00 +00 +6d +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +02 +00 +00 +00 +00 +00 +7a +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +02 +00 +00 +00 +00 +00 +89 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +02 +00 +00 +00 +00 +00 +9d +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +02 +00 +00 +00 +00 +00 +ad +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +02 +00 +00 +00 +00 +00 +c1 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +02 +00 +00 +00 +00 +00 +cf +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +02 +00 +00 +00 +00 +00 +df +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +02 +00 +00 +00 +00 +00 +ef +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +02 +00 +00 +00 +00 +00 +03 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +02 +00 +00 +00 +00 +00 +17 +01 +00 +00 +00 +00 +00 +00 +03 +00 +00 +00 +03 +01 +18 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +22 +01 +00 +00 +2e +72 +64 +61 +74 +61 +24 +7a +7a +7a +00 +5f +67 +5f +73 +7a +43 +6c +61 +73 +73 +4e +61 +6d +65 +00 +5f +57 +6e +64 +50 +72 +6f +63 +40 +31 +36 +00 +5f +44 +65 +73 +74 +72 +6f +79 +57 +69 +6e +64 +6f +77 +40 +34 +00 +5f +50 +6f +73 +74 +51 +75 +69 +74 +4d +65 +73 +73 +61 +67 +65 +40 +34 +00 +5f +44 +65 +66 +57 +69 +6e +64 +6f +77 +50 +72 +6f +63 +41 +40 +31 +36 +00 +5f +57 +69 +6e +4d +61 +69 +6e +40 +31 +36 +00 +5f +4c +6f +61 +64 +49 +63 +6f +6e +41 +40 +38 +00 +5f +4c +6f +61 +64 +43 +75 +72 +73 +6f +72 +41 +40 +38 +00 +5f +52 +65 +67 +69 +73 +74 +65 +72 +43 +6c +61 +73 +73 +45 +78 +41 +40 +34 +00 +5f +4d +65 +73 +73 +61 +67 +65 +42 +6f +78 +41 +40 +31 +36 +00 +5f +43 +72 +65 +61 +74 +65 +57 +69 +6e +64 +6f +77 +45 +78 +41 +40 +34 +38 +00 +5f +53 +68 +6f +77 +57 +69 +6e +64 +6f +77 +40 +38 +00 +5f +55 +70 +64 +61 +74 +65 +57 +69 +6e +64 +6f +77 +40 +34 +00 +5f +47 +65 +74 +4d +65 +73 +73 +61 +67 +65 +41 +40 +31 +36 +00 +5f +54 +72 +61 +6e +73 +6c +61 +74 +65 +4d +65 +73 +73 +61 +67 +65 +40 +34 +00 +5f +44 +69 +73 +70 +61 +74 +63 +68 +4d +65 +73 +73 +61 +67 +65 +41 +40 +34 +00 +2e +72 +64 +61 +74 +61 +24 +7a +7a +7a +00 diff --git a/modules/objfmts/xdf/xdf-objfmt.c b/modules/objfmts/xdf/xdf-objfmt.c index bae43525..8f109d20 100644 --- a/modules/objfmts/xdf/xdf-objfmt.c +++ b/modules/objfmts/xdf/xdf-objfmt.c @@ -838,6 +838,7 @@ yasm_objfmt_module yasm_xdf_LTX_objfmt = { "xdf", "xdf", 32, + 0, xdf_objfmt_dbgfmt_keywords, "null", NULL, /* no directives */ diff --git a/modules/parsers/gas/gas-token.re b/modules/parsers/gas/gas-token.re index 0a68af59..a4ce5bba 100644 --- a/modules/parsers/gas/gas-token.re +++ b/modules/parsers/gas/gas-token.re @@ -400,6 +400,16 @@ scan: RETURN(ID); } + /* identifier with @ */ + [a-zA-Z_.]([a-zA-Z0-9_$.]*[@][a-zA-Z0-9_$.]*)+ { + /* if @ not part of ID, move the scanner cursor to the first @ */ + if (!((yasm_objfmt_base *)p_object->objfmt)->module->id_at_ok) + cursor = (unsigned char *)strchr(TOK, '@'); + lvalp->str.contents = yasm__xstrndup(TOK, TOKLEN); + lvalp->str.len = TOKLEN; + RETURN(ID); + } + /* register or segment register */ [%][a-zA-Z0-9]+ { savech = s->tok[TOKLEN];