Re: [PATCH v2 16/19] objtool: Implement noinstr validation

From: Peter Zijlstra
Date: Wed Mar 18 2020 - 06:06:11 EST


On Wed, Mar 18, 2020 at 10:03:09AM +0100, Peter Zijlstra wrote:
> On Tue, Mar 17, 2020 at 04:00:08PM -0500, Josh Poimboeuf wrote:
> > On Tue, Mar 17, 2020 at 06:02:50PM +0100, Peter Zijlstra wrote:

> > > @@ -46,5 +49,9 @@ int cmd_check(int argc, const char **arg
> > >
> > > objname = argv[0];
> > >
> > > + s = strstr(objname, "vmlinux.o");
> > > + if (s && !s[9])
> > > + vmlinux = true;
> > > +
> >
> > I think this would be slightly cleaner:
> >
> > if (!strcmp(basename(objname), "vmlinux.o"))
> > vmlinux = true;
>
> Ah, indeed. I totally forgot userspace coding it seems..

Of course that doesn't compile... someone went overboard with const.

For some obscure reason, the stupid thing even thinks that:

note: expected âconst char **â but argument is of type âchar **â

is a warning and then -Werror's on it. That's bloody insane.