Skip to content

Commit

Permalink
genksyms: adjust the output format to modpost
Browse files Browse the repository at this point in the history
Make genksyms output symbol versions in the format modpost expects,
so the 'sed' is unneeded.

This commit makes *.symversions completely unneeded.

I will keep *.symversions in .gitignore and 'make clean' for a while.
Otherwise, 'git status' might be surprising.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Nicolas Schier <nicolas@fjasle.eu>
Tested-by: Nathan Chancellor <nathan@kernel.org>
Tested-by: Sedat Dilek <sedat.dilek@gmail.com> # LLVM-14 (x86-64)
  • Loading branch information
masahir0y committed May 24, 2022
1 parent 7375cbc commit 5ce2176
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
6 changes: 0 additions & 6 deletions scripts/Makefile.build
Original file line number Diff line number Diff line change
Expand Up @@ -165,16 +165,10 @@ ifdef CONFIG_MODVERSIONS
# o modpost will extract versions from that file and create *.c files that will
# be compiled and linked to the kernel and/or modules.

genksyms_format := __crc_\(.*\) = \(.*\);

gen_symversions = \
if $(NM) $@ 2>/dev/null | grep -q __ksymtab; then \
$(call cmd_gensymtypes_$(1),$(KBUILD_SYMTYPES),$(@:.o=.symtypes)) \
> $@.symversions; \
sed -n 's/$(genksyms_format)/$(pound)SYMVER \1 \2/p' $@.symversions \
>> $(dot-target).cmd; \
else \
rm -f $@.symversions; \
fi

cmd_gen_symversions_c = $(call gen_symversions,c)
Expand Down
2 changes: 1 addition & 1 deletion scripts/genksyms/genksyms.c
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,7 @@ void export_symbol(const char *name)
if (flag_dump_defs)
fputs(">\n", debugfile);

printf("__crc_%s = 0x%08lx;\n", name, crc);
printf("#SYMVER %s 0x%08lx\n", name, crc);
}
}

Expand Down

0 comments on commit 5ce2176

Please sign in to comment.