kbuild: refactor cmd_modversions_c
authorMasahiro Yamada <masahiroy@kernel.org>
Tue, 5 Apr 2022 11:33:57 +0000 (20:33 +0900)
committerMasahiro Yamada <masahiroy@kernel.org>
Sat, 7 May 2022 18:16:58 +0000 (03:16 +0900)
commit8017ce50641c303b9b5d96f3c10229ecfd770a70
tree6dd50af7a5b1ff5325c896f35c3e9ced7268c3e5
parent79f646e8654b6b8e4f7dda456ec3eabd51052041
kbuild: refactor cmd_modversions_c

cmd_modversions_c implements two parts; run genksyms to calculate CRCs
of exported symbols, run $(LD) to update the object with the CRCs. The
latter is not executed for CONFIG_LTO_CLANG=y since the object is not
ELF but LLVM bit code at this point.

The first part can be unified because we can always use $(NM) instead
of "$(OBJDUMP) -h" to dump the symbols.

Split the code into the two macros, cmd_gen_symversions_c and
cmd_modversions.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
scripts/Makefile.build