[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200403222458.GA49554@ubuntu-m2-xlarge-x86>
Date: Fri, 3 Apr 2020 15:24:58 -0700
From: Nathan Chancellor <natechancellor@...il.com>
To: Nick Desaulniers <ndesaulniers@...gle.com>
Cc: Thomas Gleixner <tglx@...utronix.de>,
Andrew Morton <akpm@...ux-foundation.org>,
clang-built-linux <clang-built-linux@...glegroups.com>,
Ilie Halip <ilie.halip@...il.com>,
Vincenzo Frascino <vincenzo.frascino@....com>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] elfnote: mark all .note sections SHF_ALLOC
On Fri, Apr 03, 2020 at 03:13:34PM -0700, 'Nick Desaulniers' via Clang Built Linux wrote:
> dropping Jeremy; I got bounceback from the email address. Ping for review?
>
> On Wed, Mar 25, 2020 at 4:13 PM Nick Desaulniers
> <ndesaulniers@...gle.com> wrote:
> >
> > ELFNOTE_START allows callers to specify flags for .pushsection assembler
> > directives. All callsites but ELF_NOTE use "a" for SHF_ALLOC. For
> > vdso's that explicitly use ELF_NOTE_START and BUILD_SALT, the same
> > section is specified twice after preprocessing, once with "a" flag, once
> > without. Example:
> >
> > .pushsection .note.Linux, "a", @note ;
> > .pushsection .note.Linux, "", @note ;
> >
> > While GNU as allows this ordering, it warns for the opposite ordering,
> > making these directives position dependent. We'd prefer not to precisely
> > match this behavior in Clang's integrated assembler. Instead, the non
> > __ASSEMBLY__ definition of ELF_NOTE uses
> > __attribute__((section(".note.Linux"))) which is created with SHF_ALLOC,
> > so let's make the __ASSEMBLY__ definition of ELF_NOTE consistent with C
> > and just always use "a" flag.
> >
> > This allows Clang to assemble a working mainline (5.6) kernel via:
> > $ make CC=clang AS=clang
> >
> > Link: https://github.com/ClangBuiltLinux/linux/issues/913
> > Cc: Jeremy Fitzhardinge <jeremy@...source.com>
> > Debugged-by: Ilie Halip <ilie.halip@...il.com>
> > Signed-off-by: Nick Desaulniers <ndesaulniers@...gle.com>
Reviewed-by: Nathan Chancellor <natechancellor@...il.com>
> > ---
> > Ilie has further treewide cleanups:
> > https://github.com/ihalip/linux/commits/elfnote
> > This patch is the simplest to move us forwards.
> >
> > include/linux/elfnote.h | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/include/linux/elfnote.h b/include/linux/elfnote.h
> > index 594d4e78654f..69b136e4dd2b 100644
> > --- a/include/linux/elfnote.h
> > +++ b/include/linux/elfnote.h
> > @@ -54,7 +54,7 @@
> > .popsection ;
> >
> > #define ELFNOTE(name, type, desc) \
> > - ELFNOTE_START(name, type, "") \
> > + ELFNOTE_START(name, type, "a") \
> > desc ; \
> > ELFNOTE_END
> >
> > --
> > 2.26.0.rc2.310.g2932bb562d-goog
> >
>
>
> --
> Thanks,
> ~Nick Desaulniers
Powered by blists - more mailing lists