kbuild: Add support for CONFIG_UNUSED_KSYMS_WHITELIST_ONLY

CONFIG_UNUSED_KSYMS_WHITELIST_ONLY extends the support for the
existing CONFIG_UNUSED_KSYMS_WHITELIST in a way that, if enabled,
it would allow the kbuild to export ONLY the symbols that are
supplied as a part of whitelist (and of course the ones exported
by modules). That is, the build would break for modules during
modpost with:
ERROR: "<symbol>" [<module>.ko] undefined!

When enabled, the option is quite useful in build integration
systems to detect if the whitelist file needs an update.

Change-Id: Ica0a270214d4d51f6e2269fdc591fb86acbc4f97
Signed-off-by: Raghavendra Rao Ananta <[email protected]>
This commit is contained in:
Raghavendra Rao Ananta 2020-04-14 22:31:15 -07:00
commit 9ec36c01e0
4 changed files with 56 additions and 8 deletions

View file

@ -2250,6 +2250,17 @@ config UNUSED_KSYMS_WHITELIST
one per line. The path can be absolute, or relative to the kernel
source tree.
config UNUSED_KSYMS_WHITELIST_ONLY
bool "Export ONLY the symbols that are a part of whitelist"
depends on UNUSED_KSYMS_WHITELIST != ""
help
Keep ONLY the symbols that are defined in the whitelist. The
CONFIG works on top of CONFIG_UNUSED_KSYMS_WHITELIST which takes
whitelist file(s) as its settings, and would export only the
symbols listed in these file(s).
This is mainly used to detect if drivers are using the symbols
outside of the whitelist.
endif # MODULES
config MODULES_TREE_LOOKUP