From: Alan Modra Date: Wed, 3 Apr 2019 00:51:36 +0000 (+1030) Subject: PR24411, Division is not accepted in MEMORY length expression X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1c6aafe894645ca1da5c0dd0661bca19caf37ad0;p=binutils-gdb.git PR24411, Division is not accepted in MEMORY length expression Let's hope no one has section names starting with '/' in scripts. If they do, this change to fix parsing of '/' in expressiongs will break their project. PR 24411 ldlex.l (SYMBOLNAMECHAR1): Don't match '/'. ("/DISCARD/"): New. --- diff --git a/ld/ChangeLog b/ld/ChangeLog index 851bffbe86f..bc35b349dcf 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,9 @@ +2019-04-03 Alan Modra + + PR 24411 + ldlex.l (SYMBOLNAMECHAR1): Don't match '/'. + ("/DISCARD/"): New. + 2019-04-03 Alan Modra * ldlex.l: Formatting. diff --git a/ld/ldlex.l b/ld/ldlex.l index 6e73a7fb65b..c2abc59571d 100644 --- a/ld/ldlex.l +++ b/ld/ldlex.l @@ -96,7 +96,7 @@ FILENAMECHAR [_a-zA-Z0-9\/\.\\\$\~\-\+\:\[\]\,\=] NOCFILENAMECHAR [_a-zA-Z0-9\/\.\\\$\~\-\+\:\[\]] SYMBOLNAMECHAR [_a-zA-Z0-9\/\.\\\$\~] FILENAMECHAR1 [_a-zA-Z\/\.\\\$\~] -SYMBOLNAMECHAR1 [_a-zA-Z\/\.\\\$] +SYMBOLNAMECHAR1 [_a-zA-Z\.\\\$] WHITE [ \t\n\r]+ V_TAG [.$_a-zA-Z][._a-zA-Z0-9]* @@ -388,6 +388,10 @@ V_IDENTIFIER [*?.$_a-zA-Z\[\]\-\!\^\\]([*?.$_a-zA-Z0-9\[\]\-\!\^\\]|::)* yylval.name = xstrdup (yytext); return NAME; } +"/DISCARD/" { + yylval.name = xstrdup (yytext); + return NAME; + } "-l"{NOCFILENAMECHAR}+ { yylval.name = xstrdup (yytext + 2); return LNAME;