tc-i386.c fix for oss-fuzz gas fuzzing

Alan Modra amodra@gmail.com
Mon Feb 10 11:30:36 GMT 2025


On Mon, Feb 10, 2025 at 09:45:48AM +0100, Jan Beulich wrote:
> On 10.02.2025 04:01, Alan Modra wrote:
> > oss-fuzz fuzz_as is seriously broken with respect to gas static
> > variables, so much so that most fuzz_as reports should simply be
> > ignored.  This patch is a fix for
> > https://oss-fuzz.com/testcase-detail/6268463220654080
> > 
> > 	* config/tc-i386.c (i386_md_end): Clear GOT_symbol.
> > 
> > diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
> > index 62058f7e993..538e3fb06ad 100644
> > --- a/gas/config/tc-i386.c
> > +++ b/gas/config/tc-i386.c
> > @@ -3612,6 +3612,7 @@ i386_md_end (void)
> >  {
> >    htab_delete (op_hash);
> >    htab_delete (reg_hash);
> > +  GOT_symbol = NULL;
> >  }
> 
> For the future, may I ask that such seemingly unnecessary statements be
> accompanied by a brief comment. Without such a comment, I (for example)
> might be tempted to make a patch to remove them again.

OK.  I wouldn't be too fussed if you did remove it.  The only reason
to have this in gas is to cut down the number of silly oss-fuzz gas
reports.

-- 
Alan Modra


More information about the Binutils mailing list