+2017-10-09 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR ld/22267
+ * ldlex.l (SYMBOLNAMECHAR1) New.
+ (DEFSYMEXP): Replace FILENAMECHAR1 with SYMBOLNAMECHAR1.
+ (EXPRESSION): Likewise.
+ * testsuite/ld-scripts/expr.exp: Run pr22267.
+ * testsuite/ld-scripts/pr22267.d: New file.
+ * testsuite/ld-scripts/pr22267.s: Likewise.
+ * testsuite/ld-scripts/pr22267.t: Likewise.
+
2017-10-07 H.J. Lu <hongjiu.lu@intel.com>
* testsuite/ld-elf/merge.d: Don't expect to fail for sparc.
CMDFILENAMECHAR [_a-zA-Z0-9\/\.\\_\+\$\:\[\]\\\,\=\&\!\<\>\-\~]
CMDFILENAMECHAR1 [_a-zA-Z0-9\/\.\\_\+\$\:\[\]\\\,\=\&\!\<\>\~]
FILENAMECHAR1 [_a-zA-Z\/\.\\\$\_\~]
+SYMBOLNAMECHAR1 [_a-zA-Z\/\.\\\$\_]
SYMBOLCHARN [_a-zA-Z\/\.\\\$\_\~0-9]
FILENAMECHAR [_a-zA-Z0-9\/\.\-\_\+\=\$\:\[\]\\\,\~]
WILDCHAR [_a-zA-Z0-9\/\.\-\_\+\=\$\:\[\]\\\,\~\?\*\^\!]
<DEFSYMEXP>"-" { RTOKEN('-');}
<DEFSYMEXP>"+" { RTOKEN('+');}
-<DEFSYMEXP>{FILENAMECHAR1}{SYMBOLCHARN}* { yylval.name = xstrdup (yytext); return NAME; }
+<DEFSYMEXP>{SYMBOLNAMECHAR1}{SYMBOLCHARN}* { yylval.name = xstrdup (yytext); return NAME; }
<DEFSYMEXP>"=" { RTOKEN('='); }
<MRI,EXPRESSION>"$"([0-9A-Fa-f])+ {
yylval.name = xstrdup (yytext + 2);
return LNAME;
}
-<EXPRESSION>{FILENAMECHAR1}{NOCFILENAMECHAR}* {
+<EXPRESSION>{SYMBOLNAMECHAR1}{NOCFILENAMECHAR}* {
yylval.name = xstrdup (yytext);
return NAME;
}