public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* PR24411, Division is not accepted in MEMORY length expression
@ 2019-04-03  2:29 Alan Modra
  0 siblings, 0 replies; only message in thread
From: Alan Modra @ 2019-04-03  2:29 UTC (permalink / raw)
  To: binutils

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 '/'.
	(<EXPRESSION>"/DISCARD/"): New.

diff --git a/ld/ldlex.l b/ld/ldlex.l
index 6e73a7fb65..c2abc59571 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;
 				}
+<EXPRESSION>"/DISCARD/"		{
+				  yylval.name = xstrdup (yytext);
+				  return NAME;
+				}
 <EXPRESSION>"-l"{NOCFILENAMECHAR}+ {
 				  yylval.name = xstrdup (yytext + 2);
 				  return LNAME;

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-04-03  2:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-03  2:29 PR24411, Division is not accepted in MEMORY length expression Alan Modra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).