[PATCH] gas: Fix internal error on long local labels

H.J. Lu hjl.tools@gmail.com
Mon Aug 17 17:34:51 GMT 2020


On Mon, Aug 17, 2020 at 10:22 AM Alex Coplan <Alex.Coplan@arm.com> wrote:
>
> Thanks for the fix, H.J.
>
> This has now been on master for 10 days. I've tested the original patch,
> together with this fix, on the 2.35 branch and it looks good.
>
> OK to backport to 2.35 branch?
>
> If so, should the backport squash these two commits together or
> cherry-pick them separately?

When you do backport, you should backport 2 commits together with
a single commit.

> Cheers,
> Alex
>
> > -----Original Message-----
> > From: H.J. Lu <hjl.tools@gmail.com>
> > Sent: 07 August 2020 14:44
> > To: Alex Coplan <Alex.Coplan@arm.com>
> > Cc: Alan Modra <amodra@gmail.com>; binutils@sourceware.org
> > Subject: Re: [PATCH] gas: Fix internal error on long local labels
> >
> > 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.



-- 
H.J.


More information about the Binutils mailing list