summaryrefslogtreecommitdiffstats
path: root/scripts/mod
diff options
context:
space:
mode:
authorMasahiro Yamada <masahiroy@kernel.org>2022-04-07 00:30:20 +0900
committerMasahiro Yamada <masahiroy@kernel.org>2022-05-08 03:16:59 +0900
commit9413e7640564fe70b24ea1a9ff3fb92c5bb52fcb (patch)
treeefb106529373b6c24577df146c8e3afc90fe0e8e /scripts/mod
parentb3591e061919c837c14680c1ceff8f009ed0afb4 (diff)
downloadlinux-stable-9413e7640564fe70b24ea1a9ff3fb92c5bb52fcb.tar.gz
linux-stable-9413e7640564fe70b24ea1a9ff3fb92c5bb52fcb.tar.bz2
linux-stable-9413e7640564fe70b24ea1a9ff3fb92c5bb52fcb.zip
kbuild: split the second line of *.mod into *.usyms
The *.mod files have two lines; the first line lists the member objects of the module, and the second line, if CONFIG_TRIM_UNUSED_KSYMS=y, lists the undefined symbols. Currently, we generate *.mod after constructing composite modules, otherwise, we cannot compute the second line. No prerequisite is required to print the first line. They are orthogonal. Splitting them into separate commands will ease further cleanups. This commit splits the list of undefined symbols out to *.usyms files. Previously, the list of undefined symbols ended up with a very long line, but now it has one symbol per line. Use sed like we did before commit 7d32358be8ac ("kbuild: avoid split lines in .mod files"). Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Reviewed-by: Nicolas Schier <nicolas@fjasle.eu>
Diffstat (limited to 'scripts/mod')
-rw-r--r--scripts/mod/sumversion.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/scripts/mod/sumversion.c b/scripts/mod/sumversion.c
index 905c0ec291e1..0125698f2037 100644
--- a/scripts/mod/sumversion.c
+++ b/scripts/mod/sumversion.c
@@ -387,7 +387,7 @@ out_file:
/* Calc and record src checksum. */
void get_src_version(const char *modname, char sum[], unsigned sumlen)
{
- char *buf, *pos, *firstline;
+ char *buf;
struct md4_ctx md;
char *fname;
char filelist[PATH_MAX + 1];
@@ -397,15 +397,8 @@ void get_src_version(const char *modname, char sum[], unsigned sumlen)
buf = read_text_file(filelist);
- pos = buf;
- firstline = get_line(&pos);
- if (!firstline) {
- warn("bad ending versions file for %s\n", modname);
- goto free;
- }
-
md4_init(&md);
- while ((fname = strsep(&firstline, " "))) {
+ while ((fname = strsep(&buf, " \n"))) {
if (!*fname)
continue;
if (!(is_static_library(fname)) &&