From: James Lee Date: Thu, 4 Jun 2026 06:03:00 +0000 (+0800) Subject: modpost: Add __llvm_covfun and __llvm_covmap to section_white_list X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=29c52907334a8e50ba1ee5fbaa53407dec28d876;p=thirdparty%2Flinux.git modpost: Add __llvm_covfun and __llvm_covmap to section_white_list Modpost emits hundreds of warnings when using Clang to build for ARCH=um and CONFIG_GCOV=y. e.g.: vmlinux (__llvm_covfun): unexpected non-allocatable section. Did you forget to use "ax"/"aw" in a .S file? Note that for example contains section definitions for use in .S files. For example, when we use LLVM for a kunit user mode build with coverage: python3 tools/testing/kunit/kunit.py build --make_options LLVM=1 \ --kunitconfig=tools/testing/kunit/configs/default.config \ --kunitconfig=tools/testing/kunit/configs/coverage_uml.config The behaviour occurs when building the kernel for ARCH=um with code coverage enabled. The warnings come from modpost's check_sec_ref function, which ensures no sections reference others that will be discarded. covfun and covmap sections must reference __init and __exit sections to collect coverage data, triggering the modpost warning. To suppress these warnings, these section names have been added to modpost's whitelist. This is unlikely to suppress legitimate warnings as Clang will only insert these sections when building with coverage, and can be assumed to manage these references safely. Signed-off-by: James Lee Link: https://patch.msgid.link/20260604-dev-coverage-patch-v1-1-9f9368253cb4@codeconstruct.com.au Signed-off-by: Nathan Chancellor --- diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index da0f4bc755094..d592548cbd60f 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -765,6 +765,8 @@ static const char *const section_white_list[] = ".gnu.lto*", ".discard.*", ".llvm.call-graph-profile", /* call graph */ + "__llvm_covfun", + "__llvm_covmap", NULL };