public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: "H.J. Lu" <hjl.tools@gmail.com>
To: Alex Coplan <Alex.Coplan@arm.com>
Cc: Alan Modra <amodra@gmail.com>,
	"binutils@sourceware.org" <binutils@sourceware.org>
Subject: Re: [PATCH] gas: Fix internal error on long local labels
Date: Fri, 7 Aug 2020 06:44:17 -0700	[thread overview]
Message-ID: <CAMe9rOqw62kA6fYLH438Wn=-3_=KS7HR6Um7p_0Ux7wvH7srEg@mail.gmail.com> (raw)
In-Reply-To: <VI1PR08MB40297AF7B8B39A32F8D7AC41EA480@VI1PR08MB4029.eurprd08.prod.outlook.com>

On Thu, Aug 6, 2020 at 9:49 AM Alex Coplan <Alex.Coplan@arm.com> wrote:
>
> > -----Original Message-----
> > From: Alan Modra <amodra@gmail.com>
> > Sent: 06 August 2020 14:56
> > To: Alex Coplan <Alex.Coplan@arm.com>
> > Cc: binutils@sourceware.org
> > Subject: Re: [PATCH] gas: Fix internal error on long local labels
> >
> > On Wed, Aug 05, 2020 at 02:51:05PM +0100, Alex Coplan wrote:
> > >     * read.c (read_a_source_file): Use long for local labels, detect
> > >     overflow and raise an error for overly-long labels.
> > >     * testsuite/gas/all/gas.exp: Add local-label-overflow test.
> > >     * testsuite/gas/all/local-label-overflow.d: New test.
> > >     * testsuite/gas/all/local-label-overflow.l: Error output.
> > >     * testsuite/gas/all/local-label-overflow.s: Input.
> >
> > OK, but fix the following nits please.
>
> Thanks. Pushed to master with nits fixed as
> d27aad4ec307d91a6b9056127c6c248044391d7f.

The test failed on 32-bit hosts:

./as-new -o x.o
/export/gnu/import/git/sources/binutils-gdb/gas/testsuite/gas/all/local-label-overflow.s
/export/gnu/import/git/sources/binutils-gdb/gas/testsuite/gas/all/local-label-overflow.s:
Assembler messages:
/export/gnu/import/git/sources/binutils-gdb/gas/testsuite/gas/all/local-label-overflow.s:1:
Error: local label too large near 888888888888888888888888888:

/export/gnu/import/git/sources/binutils-gdb/gas/testsuite/gas/all/local-label-overflow.s:1:
Error: local label too large near 888888888888888888:

/export/gnu/import/git/sources/binutils-gdb/gas/testsuite/gas/all/local-label-overflow.s:1:
Error: local label too large near 888888888:

I am checking in this to fix it:

diff --git a/gas/read.c b/gas/read.c
index bd896580e5..cb41cc0685 100644
--- a/gas/read.c
+++ b/gas/read.c
@@ -1227,7 +1227,10 @@ read_a_source_file (const char *name)

         /* Overflow: stop processing the label.  */
         if (temp == -1)
-     continue;
+     {
+       ignore_rest_of_line ();
+       continue;
+     }

         if (LOCAL_LABELS_DOLLAR
        && *input_line_pointer == '$'

> Is it worth backporting?
>
> Alex



-- 
H.J.

  reply	other threads:[~2020-08-07 13:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-05 13:51 Alex Coplan
2020-08-06 13:56 ` Alan Modra
2020-08-06 16:48   ` Alex Coplan
2020-08-07 13:44     ` H.J. Lu [this message]
2020-08-17 17:22       ` Alex Coplan
2020-08-17 17:34         ` H.J. Lu
2020-09-01 10:43           ` Alex Coplan

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='CAMe9rOqw62kA6fYLH438Wn=-3_=KS7HR6Um7p_0Ux7wvH7srEg@mail.gmail.com' \
    --to=hjl.tools@gmail.com \
    --cc=Alex.Coplan@arm.com \
    --cc=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).