diff --git a/kernel/module/Kconfig b/kernel/module/Kconfig index 2edb7e82e6a9..45936ca8b83a 100644 --- a/kernel/module/Kconfig +++ b/kernel/module/Kconfig @@ -420,7 +420,7 @@ config UNUSED_KSYMS_WHITELIST exported at all times, even in absence of in-tree users. The value to set here is the path to a text file containing the list of symbols, one per line. The path can be absolute, or relative to the kernel - source tree. + source or obj tree. config MODULES_TREE_LOOKUP def_bool y diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost index 12b7b4fb18dd..99249e4f0cca 100644 --- a/scripts/Makefile.modpost +++ b/scripts/Makefile.modpost @@ -133,7 +133,7 @@ endif ifdef CONFIG_TRIM_UNUSED_KSYMS ksym-wl := $(CONFIG_UNUSED_KSYMS_WHITELIST) -ksym-wl := $(if $(filter-out /%, $(ksym-wl)),$(srctree)/)$(ksym-wl) +ksym-wl := $(if $(filter-out /%, $(ksym-wl)),$(if $(wildcard $(ksym-wl)),,$(srctree)/))$(ksym-wl) modpost-args += -t $(addprefix -u , $(ksym-wl)) modpost-deps += $(ksym-wl) endif