[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CABCJKucG4dOLm9pPWrACc+YReBXG4GNM9V0djsy0YTp8pRGmaw@mail.gmail.com>
Date: Mon, 9 May 2022 14:52:21 -0700
From: Sami Tolvanen <samitolvanen@...gle.com>
To: Masahiro Yamada <masahiroy@...nel.org>
Cc: linux-kbuild <linux-kbuild@...r.kernel.org>,
LKML <linux-kernel@...r.kernel.org>,
Nathan Chancellor <nathan@...nel.org>,
Nick Desaulniers <ndesaulniers@...gle.com>,
Nicolas Schier <nicolas@...sle.eu>,
Peter Zijlstra <peterz@...radead.org>,
linux-modules@...r.kernel.org, linux-s390@...r.kernel.org,
linuxppc-dev <linuxppc-dev@...ts.ozlabs.org>,
clang-built-linux <clang-built-linux@...glegroups.com>,
Ard Biesheuvel <ardb@...nel.org>
Subject: Re: [PATCH v4 05/14] modpost: extract symbol versions from *.cmd files
On Sun, May 8, 2022 at 12:09 PM Masahiro Yamada <masahiroy@...nel.org> wrote:
>
> Currently, CONFIG_MODVERSIONS needs extra link to embed the symbol
> versions into ELF objects. Then, modpost extracts the version CRCs
> from them.
>
> The following figures show how it currently works, and how I am trying
> to change it.
>
> Current implementation
> ======================
> |----------|
> embed CRC -------------------------->| final |
> $(CC) $(LD) / |---------| | link for |
> -----> *.o -------> *.o -->| modpost | | vmlinux |
> / / | |-- *.mod.c -->| or |
> / genksyms / |---------| | module |
> *.c ------> *.symversions |----------|
>
> Genksyms outputs the calculated CRCs in the form of linker script
> (*.symversions), which is used by $(LD) to update the object.
>
> If CONFIG_LTO_CLANG=y, the build process is much more complex. Embedding
> the CRCs is postponed until the LLVM bitcode is converted into ELF,
> creating another intermediate *.prelink.o.
>
> However, this complexity is unneeded. There is no reason why we must
> embed version CRCs in objects so early.
>
> There is final link stage for vmlinux (scripts/link-vmlinux.sh) and
> modules (scripts/Makefile.modfinal). We can link CRCs at the very last
> moment.
>
> New implementation
> ==================
> |----------|
> --------------------------------------->| final |
> $(CC) / |---------| | link for |
> -----> *.o ---->| | | vmlinux |
> / | modpost |--- .vmlinux.export.c -->| or |
> / genksyms | |--- *.mod.c ------------>| module |
> *.c ------> *.cmd -->|---------| |----------|
>
> Pass the symbol versions to modpost as separate text data, which are
> available in *.cmd files.
>
> This commit changes modpost to extract CRCs from *.cmd files instead of
> from ELF objects.
>
> Signed-off-by: Masahiro Yamada <masahiroy@...nel.org>
> Reviewed-by: Nicolas Schier <nicolas@...sle.eu>
> Tested-by: Nathan Chancellor <nathan@...nel.org>
This looks good to me, it's great to get rid of the .symversions files!
Reviewed-by: Sami Tolvanen <samitolvanen@...gle.com>
Sami
Powered by blists - more mailing lists