NASM behavior with regards to e.g. extern $foo.
Unfortunately this makes yasm start not matching NASM behavior with regards
to the RDF module directive. In NASM, module $foo results in a literal $foo
reference; yasm now requires either a double $ (e.g. $$foo) or quotes (e.g.
"$foo"). The special case for section (section $foo --> literal $foo) is
still present, but keeping this for other directives is extremely difficult.
svn path=/trunk/yasm/; revision=1754
EXTRA_DIST += modules/objfmts/elf/tests/elfvisibility.hex
EXTRA_DIST += modules/objfmts/elf/tests/nasm-sectname.asm
EXTRA_DIST += modules/objfmts/elf/tests/nasm-sectname.hex
+EXTRA_DIST += modules/objfmts/elf/tests/nasm-forceident.asm
+EXTRA_DIST += modules/objfmts/elf/tests/nasm-forceident.hex
EXTRA_DIST += modules/objfmts/elf/tests/amd64/Makefile.inc
EXTRA_DIST += modules/objfmts/elf/tests/gas64/Makefile.inc
--- /dev/null
+section ".text"
+
+section '.text'
+
+section $foo
+
+global $Test
+
+$Test:
+ mov ax, 0
+ ret
+
--- /dev/null
+7f
+45
+4c
+46
+01
+01
+01
+00
+00
+00
+00
+00
+00
+00
+00
+00
+01
+00
+03
+00
+01
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+d0
+00
+00
+00
+00
+00
+00
+00
+34
+00
+00
+00
+00
+00
+28
+00
+06
+00
+01
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+66
+b8
+00
+00
+c3
+00
+00
+00
+00
+2e
+74
+65
+78
+74
+00
+24
+66
+6f
+6f
+00
+2e
+73
+74
+72
+74
+61
+62
+00
+2e
+73
+79
+6d
+74
+61
+62
+00
+2e
+73
+68
+73
+74
+72
+74
+61
+62
+00
+00
+00
+00
+2d
+00
+54
+65
+73
+74
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+01
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+04
+00
+f1
+ff
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+03
+00
+05
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+03
+00
+04
+00
+03
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+10
+00
+05
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+1c
+00
+00
+00
+03
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+48
+00
+00
+00
+26
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+0c
+00
+00
+00
+03
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+70
+00
+00
+00
+08
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+14
+00
+00
+00
+02
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+78
+00
+00
+00
+50
+00
+00
+00
+02
+00
+00
+00
+04
+00
+00
+00
+04
+00
+00
+00
+10
+00
+00
+00
+01
+00
+00
+00
+01
+00
+00
+00
+06
+00
+00
+00
+00
+00
+00
+00
+40
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+10
+00
+00
+00
+00
+00
+00
+00
+07
+00
+00
+00
+01
+00
+00
+00
+02
+00
+00
+00
+00
+00
+00
+00
+40
+00
+00
+00
+05
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+01
+00
+00
+00
+00
+00
+00
+00
module thismodule
-module $thismodule
+module "$thismodule"
global foo:export
global bar:export proc
global bar2:export function
RETURN(s->tok[0]);
}
+ /* forced identifier */
+ "$" [a-zA-Z0-9_$#@~.?]+ {
+ lvalp->str_val = yasm__xstrndup(TOK+1, TOKLEN-1);
+ RETURN(ID);
+ }
+
/* identifier; within directive, no local label mechanism */
- [a-zA-Z_$.?][a-zA-Z0-9_$#@~.?]* {
+ [a-zA-Z_.?][a-zA-Z0-9_$#@~.?]* {
lvalp->str_val = yasm__xstrndup(TOK, TOKLEN);
RETURN(ID);
}