[PATCH] Add no_sanitize_coverage attribute.

Richard Biener richard.guenther@gmail.com
Tue May 25 09:55:13 GMT 2021


On Mon, May 24, 2021 at 10:27 AM Martin Liška <mliska@suse.cz> wrote:
>
> On 5/21/21 2:39 PM, Marco Elver wrote:
> > On Fri, May 21, 2021 at 10:50AM +0200, Martin Liška wrote:
> >> On 5/20/21 12:55 PM, Marco Elver wrote:
> >>> I think this came up with other no_sanitize [1] based on what I had
> >>> written to you last year [2].
> >>>
> >>> [1]https://gcc.gnu.org/pipermail/gcc-patches/2020-June/547618.html
> >>> [2]https://lore.kernel.org/lkml/CANpmjNNRz5OVKb6PE7K6GjfoGbht_ZhyPkNG9aD+KjNDzK7hGg@mail.gmail.com/
> >>
> >> Ah, you're right. I've just updated the patch to address that.
> >>
> >> Patch can bootstrap on x86_64-linux-gnu and survives regression tests.
> >>
> >> Ready to be installed?
> >
> > Looks good, I also just built a kernel with the no_sanitize_coverage
> > attribute (without the objtool nop-workaround) and works as expected.
>
> Good, thanks!
>
> >
> > Not sure if required, but would such an additional test be useful:
>
> Yes, it is, thanks for it.
>
> >
> > ---
> >
> > diff --git a/gcc/testsuite/gcc.dg/sancov/attribute.c b/gcc/testsuite/gcc.dg/sancov/attribute.c
> > index bf6dbd4bae7..7cfa9134ff1 100644
> > --- a/gcc/testsuite/gcc.dg/sancov/attribute.c
> > +++ b/gcc/testsuite/gcc.dg/sancov/attribute.c
> > @@ -11,5 +11,17 @@ bar(void)
> >   {
> >   }
> >
> > +static void inline
> > +__attribute__((always_inline))
> > +inline_fn(void)
> > +{
> > +}
> > +
> > +void
> > +__attribute__((no_sanitize_coverage))
> > +baz(void)
> > +{
> > +  inline_fn();
> > +}
> >
> >   /* { dg-final { scan-tree-dump-times "__builtin___sanitizer_cov_trace_pc \\(\\)" 1 "optimized" } } */
> >
> > ---
> >
> > Otherwise, please go ahead. I assume this is targeting GCC 12?
>
> Yep.
>
> There's V3 I'm sending.
>
> Ready for master?

OK.

Thanks,
Richard.

> Thanks,
> Martin
>
> >
> > Thanks,
> > -- Marco
> >
>


More information about the Gcc-patches mailing list