mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] kbuild: Ignore __this_module in gen_autoksyms.sh
@ 2022-06-16 19:57 Sami Tolvanen
  2022-06-16 22:19 ` Steve Muckle
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Sami Tolvanen @ 2022-06-16 19:57 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: Nicolas Schier, Alexander Lobakin, Nick Desaulniers,
	Steve Muckle, linux-kbuild, linux-kernel, Sami Tolvanen

Module object files can contain an undefined reference to __this_module,
which isn't resolved until we link the final .ko. The kernel doesn't
export this symbol, so ignore it in gen_autoksyms.sh. This avoids an
unnecessary vmlinux rebuild with UNUSED_KSYMS_WHITELIST when we have a
symbol list that already contains all the module dependencies.

Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
---
 scripts/gen_autoksyms.sh | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/scripts/gen_autoksyms.sh b/scripts/gen_autoksyms.sh
index faacf7062122..653fadbad302 100755
--- a/scripts/gen_autoksyms.sh
+++ b/scripts/gen_autoksyms.sh
@@ -56,4 +56,7 @@ EOT
 # point addresses.
 sed -e 's/^\.//' |
 sort -u |
+# Ignore __this_module. It's not an exported symbol, and will be resolved
+# when the final .ko's are linked.
+grep -v '^__this_module$' |
 sed -e 's/\(.*\)/#define __KSYM_\1 1/' >> "$output_file"
-- 
2.36.1.476.g0c4daa206d-goog


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-06-23 19:44 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-16 19:57 [PATCH] kbuild: Ignore __this_module in gen_autoksyms.sh Sami Tolvanen
2022-06-16 22:19 ` Steve Muckle
2022-06-17 17:28 ` Nick Desaulniers
2022-06-17 18:14   ` Ramji Jiyani
2022-06-18  6:17   ` Sedat Dilek
2022-06-18 22:59 ` Masahiro Yamada
2022-06-21 15:37   ` Sami Tolvanen
2022-06-23 19:34     ` Masahiro Yamada

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®