public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Alan Modra <amodra@gmail.com>
To: binutils@sourceware.org
Subject: PR24411, Division is not accepted in MEMORY length expression
Date: Wed, 03 Apr 2019 02:29:00 -0000	[thread overview]
Message-ID: <20190403022939.GC8657@bubble.grove.modra.org> (raw)

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

                 reply	other threads:[~2019-04-03  2:29 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190403022939.GC8657@bubble.grove.modra.org \
    --to=amodra@gmail.com \
    --cc=binutils@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).