summaryrefslogtreecommitdiff
path: root/scripts/sorttable.c
diff options
context:
space:
mode:
authorNathan Chancellor <nathan@kernel.org>2026-10-11 01:22:02 +0100
committerNathan Chancellor <nathan@kernel.org>2026-10-11 01:22:02 +0100
commitfd26cc1da1ec4dbe4ca19d0c94f802ff4300a788 (patch)
treef343bf7e191d0567d77f8f352fdd53111b75e8e1 /scripts/sorttable.c
parent185b2c6a021ac46c62342fa814e5e2393f8396c5 (diff)
parentae5f6044c4cdffe2b3361b15c1d6fc67b339f2a4 (diff)
downloadlinux-next-fd26cc1da1ec4dbe4ca19d0c94f802ff4300a788.tar.gz
linux-next-fd26cc1da1ec4dbe4ca19d0c94f802ff4300a788.zip
Merge branch 'kbuild-next-speedups' into kbuild-for-next
* kbuild-next-speedups: kbuild: Mark the initcall ordering recipe as recursive kbuild: Mark the gzip recipes as recursive kconfig: Improve ergonomics around disabling warnings with cc-option scripts/Kconfig.toolchain: Drop compiler symbols from dependencies kbuild: keep .modinfo when vmlinux is linked with --gc-sections kbuild: compress the kernel with pigz if available kbuild: avoid re-running compiler and linker probes kbuild: move the toolchain checks into scripts/Kconfig.toolchain kallsyms: reimplement mksysmap in C elf-parse: add section flags, symbol binding and mapping helpers kbuild: only emit vmlinux relocations when required kbuild: do not sort nm output where the order is irrelevant sorttable: parse nm output correctly kallsyms: output binary data to speed output and kallsyms assembly kallsyms: index symbols by token to speed up table compression kbuild: do not allocate .modinfo in vmlinux Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Diffstat (limited to 'scripts/sorttable.c')
-rw-r--r--scripts/sorttable.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/scripts/sorttable.c b/scripts/sorttable.c
index d7b50581c732..88e49a5c4251 100644
--- a/scripts/sorttable.c
+++ b/scripts/sorttable.c
@@ -322,10 +322,23 @@ static int parse_symbols(const char *fname)
return -1;
}
- while (fscanf(fp, "%16s %16s %c %*s\n", addr_str, size_str, &type) == 3) {
+ while (fscanf(fp, "%16s %16s %c%*[^\n]", addr_str, size_str, &type) == 3) {
uint64_t addr;
uint64_t size;
+ /*
+ * nm outputs size-less entries with a missing 2nd value, which
+ * means fscanf() just misread its fields.
+ *
+ * These don't matter as a call site cannot be in an empty
+ * function, so just skip them.
+ *
+ * nm pads address and size to the same width, so if their
+ * widths differ, this is a misread.
+ */
+ if (strlen(size_str) != strlen(addr_str))
+ continue;
+
/* Only care about functions */
if (type != 't' && type != 'T' && type != 'W')
continue;