[<prev] [next>] [day] [month] [year] [list]
Message-ID: <176060839079.709179.15078148436703060232.tip-bot2@tip-bot2>
Date: Thu, 16 Oct 2025 09:53:10 -0000
From: "tip-bot2 for Josh Poimboeuf" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: Masahiro Yamada <masahiroy@...nel.org>, Petr Mladek <pmladek@...e.com>,
Joe Lawrence <joe.lawrence@...hat.com>, Josh Poimboeuf <jpoimboe@...nel.org>,
x86@...nel.org, linux-kernel@...r.kernel.org
Subject:
[tip: objtool/core] kbuild: Remove 'kmod_' prefix from __KBUILD_MODNAME
The following commit has been merged into the objtool/core branch of tip:
Commit-ID: 6717e8f91db71641cb52855ed14c7900972ed0bc
Gitweb: https://git.kernel.org/tip/6717e8f91db71641cb52855ed14c7900972ed0bc
Author: Josh Poimboeuf <jpoimboe@...nel.org>
AuthorDate: Wed, 17 Sep 2025 09:03:16 -07:00
Committer: Josh Poimboeuf <jpoimboe@...nel.org>
CommitterDate: Tue, 14 Oct 2025 14:45:22 -07:00
kbuild: Remove 'kmod_' prefix from __KBUILD_MODNAME
In preparation for the objtool klp diff subcommand, remove the arbitrary
'kmod_' prefix from __KBUILD_MODNAME and instead add it explicitly in
the __initcall_id() macro.
This change supports the standardization of "unique" symbol naming by
ensuring the non-unique portion of the name comes before the unique
part. That will enable objtool to properly correlate symbols across
builds.
Cc: Masahiro Yamada <masahiroy@...nel.org>
Acked-by: Petr Mladek <pmladek@...e.com>
Tested-by: Joe Lawrence <joe.lawrence@...hat.com>
Signed-off-by: Josh Poimboeuf <jpoimboe@...nel.org>
---
include/linux/init.h | 3 ++-
scripts/Makefile.lib | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/include/linux/init.h b/include/linux/init.h
index 17c1bc7..4033192 100644
--- a/include/linux/init.h
+++ b/include/linux/init.h
@@ -200,12 +200,13 @@ extern struct module __this_module;
/* Format: <modname>__<counter>_<line>_<fn> */
#define __initcall_id(fn) \
+ __PASTE(kmod_, \
__PASTE(__KBUILD_MODNAME, \
__PASTE(__, \
__PASTE(__COUNTER__, \
__PASTE(_, \
__PASTE(__LINE__, \
- __PASTE(_, fn))))))
+ __PASTE(_, fn)))))))
/* Format: __<prefix>__<iid><id> */
#define __initcall_name(prefix, __iid, id) \
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 1d581ba..b955602 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -20,7 +20,7 @@ name-fix-token = $(subst $(comma),_,$(subst -,_,$1))
name-fix = $(call stringify,$(call name-fix-token,$1))
basename_flags = -DKBUILD_BASENAME=$(call name-fix,$(basetarget))
modname_flags = -DKBUILD_MODNAME=$(call name-fix,$(modname)) \
- -D__KBUILD_MODNAME=kmod_$(call name-fix-token,$(modname))
+ -D__KBUILD_MODNAME=$(call name-fix-token,$(modname))
modfile_flags = -DKBUILD_MODFILE=$(call stringify,$(modfile))
_c_flags = $(filter-out $(CFLAGS_REMOVE_$(target-stem).o), \
Powered by blists - more mailing lists