From nobody Mon Oct 6 04:55:33 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 715D72DCF5B; Thu, 24 Jul 2025 13:50:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753365011; cv=none; b=O/Z3akrrDEtCYfPsUX5uu0so+H7wOV+yfQty9Rwc5zIzMe7Kcq4HpNgho1erYezWipTwA2cahYaEkDacGJ/E77z2lPo/oC4ak7FtL20AEcQWlfcB4ziqyr5pzxh8vv3BzdD+upzpCDcMBjKpi/C+PkSKkCYsoA9CT4PHYc6JqLY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753365011; c=relaxed/simple; bh=Hll4fVoXdJiq0X8QlG0YQhLfV/cpQXX8ezdfihEc0eg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=a65eLcKCkIjBAawoxCIrLI9lR/HYSjtyUWndAD1sD3jsX3oLZVvrhGSxwzwo3RRpCgGQ8O/71wZJ3jdKas1jToxYreazSrbxX46jO6PsAx+V+iTGn616xqv/3cJjem1H/7Mmj7VdaEqK52xjAlNePqPS314oLH5N0t8xJ61MypY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=bx2ypPIu; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="bx2ypPIu" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6A9B7C4CEF6; Thu, 24 Jul 2025 13:50:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1753365010; bh=Hll4fVoXdJiq0X8QlG0YQhLfV/cpQXX8ezdfihEc0eg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bx2ypPIuGqXHVPE/2FRq7dBRR94C4tTFkXL3aH3WOEUyyUzZN7IpsUFYnYzPmZFKY dW/3+k6zDelSOKkpLLsAlTqW6N4k7Mo+JNyb1ZGhhvV3PDsnutTY1Li7QKWaLn8b3n BVHFf7OMyS4q8G27T5jzrX3+KfL1JkU3rbLaY2jjQfyklvcr//EApBPwmZBt7mLo/l LesdIYozdg7hojFtVKvDJn93KHw+ia9nboq4ebmuHfbmsHeucjhJRPqwLswzxBYsWh gKRRnyb3Ot945VlXL+TeNUpdR7RwDdbkxyUHuX4ye4JZEGaLkkGSzmMit+R4BZcdV3 Trp5J8a0HNlAw== From: Alexey Gladkov To: Masahiro Yamada , Petr Pavlu , Luis Chamberlain , Sami Tolvanen , Daniel Gomez , Nathan Chancellor , Nicolas Schier Cc: linux-kernel@vger.kernel.org, linux-modules@vger.kernel.org, linux-kbuild@vger.kernel.org, Herbert Xu , "David S. Miller" Subject: [PATCH v5 01/10] module: remove meaningless 'name' parameter from __MODULE_INFO() Date: Thu, 24 Jul 2025 15:49:38 +0200 Message-ID: X-Mailer: git-send-email 2.50.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Masahiro Yamada The symbol names in the .modinfo section are never used and already randomized by the __UNIQUE_ID() macro. Therefore, the second parameter of __MODULE_INFO() is meaningless and can be removed to simplify the code. With this change, the symbol names in the .modinfo section will be prefixed with __UNIQUE_ID_modinfo, making it clearer that they originate from MODULE_INFO(). [Before] $ objcopy -j .modinfo vmlinux.o modinfo.o $ nm -n modinfo.o | head -n10 0000000000000000 r __UNIQUE_ID_license560 0000000000000011 r __UNIQUE_ID_file559 0000000000000030 r __UNIQUE_ID_description558 0000000000000074 r __UNIQUE_ID_license580 000000000000008e r __UNIQUE_ID_file579 00000000000000bd r __UNIQUE_ID_description578 00000000000000e6 r __UNIQUE_ID_license581 00000000000000ff r __UNIQUE_ID_file580 0000000000000134 r __UNIQUE_ID_description579 0000000000000179 r __UNIQUE_ID_uncore_no_discover578 [After] $ objcopy -j .modinfo vmlinux.o modinfo.o $ nm -n modinfo.o | head -n10 0000000000000000 r __UNIQUE_ID_modinfo560 0000000000000011 r __UNIQUE_ID_modinfo559 0000000000000030 r __UNIQUE_ID_modinfo558 0000000000000074 r __UNIQUE_ID_modinfo580 000000000000008e r __UNIQUE_ID_modinfo579 00000000000000bd r __UNIQUE_ID_modinfo578 00000000000000e6 r __UNIQUE_ID_modinfo581 00000000000000ff r __UNIQUE_ID_modinfo580 0000000000000134 r __UNIQUE_ID_modinfo579 0000000000000179 r __UNIQUE_ID_modinfo578 Cc: Herbert Xu Cc: "David S. Miller" Signed-off-by: Masahiro Yamada --- include/crypto/algapi.h | 4 ++-- include/linux/module.h | 3 --- include/linux/moduleparam.h | 9 +++++---- include/net/tcp.h | 4 ++-- 4 files changed, 9 insertions(+), 11 deletions(-) diff --git a/include/crypto/algapi.h b/include/crypto/algapi.h index 188eface0a11..fc4574940636 100644 --- a/include/crypto/algapi.h +++ b/include/crypto/algapi.h @@ -43,8 +43,8 @@ * alias. */ #define MODULE_ALIAS_CRYPTO(name) \ - __MODULE_INFO(alias, alias_userspace, name); \ - __MODULE_INFO(alias, alias_crypto, "crypto-" name) + MODULE_INFO(alias, name); \ + MODULE_INFO(alias, "crypto-" name) =20 struct crypto_aead; struct crypto_instance; diff --git a/include/linux/module.h b/include/linux/module.h index 5faa1fb1f4b4..4689852d7b18 100644 --- a/include/linux/module.h +++ b/include/linux/module.h @@ -164,9 +164,6 @@ extern void cleanup_module(void); =20 struct module_kobject *lookup_or_create_module_kobject(const char *name); =20 -/* Generic info of form tag =3D "info" */ -#define MODULE_INFO(tag, info) __MODULE_INFO(tag, tag, info) - /* For userspace: you can also call me... */ #define MODULE_ALIAS(_alias) MODULE_INFO(alias, _alias) =20 diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h index bfb85fd13e1f..00166f747e27 100644 --- a/include/linux/moduleparam.h +++ b/include/linux/moduleparam.h @@ -20,18 +20,19 @@ /* Chosen so that structs with an unsigned long line up. */ #define MAX_PARAM_PREFIX_LEN (64 - sizeof(unsigned long)) =20 -#define __MODULE_INFO(tag, name, info) \ - static const char __UNIQUE_ID(name)[] \ +/* Generic info of form tag =3D "info" */ +#define MODULE_INFO(tag, info) \ + static const char __UNIQUE_ID(modinfo)[] \ __used __section(".modinfo") __aligned(1) \ =3D __MODULE_INFO_PREFIX __stringify(tag) "=3D" info =20 #define __MODULE_PARM_TYPE(name, _type) \ - __MODULE_INFO(parmtype, name##type, #name ":" _type) + MODULE_INFO(parmtype, #name ":" _type) =20 /* One for each parameter, describing how to use it. Some files do multiple of these per line, so can't just use MODULE_INFO. */ #define MODULE_PARM_DESC(_parm, desc) \ - __MODULE_INFO(parm, _parm, #_parm ":" desc) + MODULE_INFO(parm, #_parm ":" desc) =20 struct kernel_param; =20 diff --git a/include/net/tcp.h b/include/net/tcp.h index 5078ad868fee..9b39ef630c92 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h @@ -2662,8 +2662,8 @@ void tcp_update_ulp(struct sock *sk, struct proto *p, void (*write_space)(struct sock *sk)); =20 #define MODULE_ALIAS_TCP_ULP(name) \ - __MODULE_INFO(alias, alias_userspace, name); \ - __MODULE_INFO(alias, alias_tcp_ulp, "tcp-ulp-" name) + MODULE_INFO(alias, name); \ + MODULE_INFO(alias, "tcp-ulp-" name) =20 #ifdef CONFIG_NET_SOCK_MSG struct sk_msg; --=20 2.50.1 From nobody Mon Oct 6 04:55:33 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0BD9A2DECCA; Thu, 24 Jul 2025 13:50:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753365014; cv=none; b=j1nYvjrj0bFnw1DPy1Df0sWfxGXIGmYnMqj8sgEX9ebR+FZxfIzktBu6sbfiYlvTrL3o3CGiB0bMOza+BEiect44JHk0z+K9O6y1IhjCNMAdEjL/m2WzYbYUWNRFK+i1Tpwu7QYxoAj0gGPD7iCUS/pZ7I5efFP0mzsDX61w1VQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753365014; c=relaxed/simple; bh=l4XLlaq+sgrse0xJUWH72xDUED3ph1VPSIT0SUNZVi8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=gBM7wLdcu0TZAr0BKpfl3y492fovCOsU6jOYzgDLCB2cUrHVeGpeh48oUSfHaMXbTG3d2qhnKYkk3IhFejmHw+eYL10peoWer1/eQIKT9pp23Zc56O1pIDGBTg/bjxsAFbO8rzBK0afH+P4169VbNvee0qVQ9snYgdWXTQ3PL0I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=uyrGC4Ay; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="uyrGC4Ay" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5E56AC4CEED; Thu, 24 Jul 2025 13:50:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1753365013; bh=l4XLlaq+sgrse0xJUWH72xDUED3ph1VPSIT0SUNZVi8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uyrGC4AyPpUlsfyEdga5U5jvg7kTlpr+uwhOqlCQaPT6OuYRvTv1+ysApROZRhzgL yv16ZLJ7OdWfNrU4+JyTfvjxeZjpXFcdOKXpB6TAxmOSRHGsyWIhasFrzxiHlZTI/5 TNWEzbGVVbFfcowVcBze3NokLf6z46dYRbdsm1vQprdW6vih3aIgT6KhZFgN7K6x4g BAHuKax/mcF5dGjY44IKfWF/D1D4Q7Dio2i8r+7lY4YeUpmbW/WAjwtYm8WS+s+F5R qsx7ZStKyWHL4NcDiHmWbIUAn1eNWGKnj43xUjGcfjy5KJ0cAw8LhJzNZ4Yap+ZhXy Gpxix4w5sp1fw== From: Alexey Gladkov To: Masahiro Yamada , Petr Pavlu , Luis Chamberlain , Sami Tolvanen , Daniel Gomez , Nathan Chancellor , Nicolas Schier Cc: linux-kernel@vger.kernel.org, linux-modules@vger.kernel.org, linux-kbuild@vger.kernel.org Subject: [PATCH v5 02/10] kbuild: always create intermediate vmlinux.unstripped Date: Thu, 24 Jul 2025 15:49:39 +0200 Message-ID: <63a14a14f1a1083cdb62aa687301c1a8e472185f.1753354215.git.legion@kernel.org> X-Mailer: git-send-email 2.50.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Masahiro Yamada Generate the intermediate vmlinux.unstripped regardless of CONFIG_ARCH_VMLINUX_NEEDS_RELOCS. If CONFIG_ARCH_VMLINUX_NEEDS_RELOCS is unset, vmlinux.unstripped and vmlinux are identiacal. This simplifies the build rule, and allows to strip more sections by adding them to remove-section-y. Signed-off-by: Masahiro Yamada --- scripts/Makefile.vmlinux | 45 ++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/scripts/Makefile.vmlinux b/scripts/Makefile.vmlinux index b64862dc6f08..4f2d4c3fb737 100644 --- a/scripts/Makefile.vmlinux +++ b/scripts/Makefile.vmlinux @@ -9,20 +9,6 @@ include $(srctree)/scripts/Makefile.lib =20 targets :=3D =20 -ifdef CONFIG_ARCH_VMLINUX_NEEDS_RELOCS -vmlinux-final :=3D vmlinux.unstripped - -quiet_cmd_strip_relocs =3D RSTRIP $@ - cmd_strip_relocs =3D $(OBJCOPY) --remove-section=3D'.rel*' --remove-= section=3D!'.rel*.dyn' $< $@ - -vmlinux: $(vmlinux-final) FORCE - $(call if_changed,strip_relocs) - -targets +=3D vmlinux -else -vmlinux-final :=3D vmlinux -endif - %.o: %.c FORCE $(call if_changed_rule,cc_o_c) =20 @@ -61,19 +47,19 @@ targets +=3D .builtin-dtbs-list =20 ifdef CONFIG_GENERIC_BUILTIN_DTB targets +=3D .builtin-dtbs.S .builtin-dtbs.o -$(vmlinux-final): .builtin-dtbs.o +vmlinux.unstripped: .builtin-dtbs.o endif =20 -# vmlinux +# vmlinux.unstripped # ------------------------------------------------------------------------= --- =20 ifdef CONFIG_MODULES targets +=3D .vmlinux.export.o -$(vmlinux-final): .vmlinux.export.o +vmlinux.unstripped: .vmlinux.export.o endif =20 ifdef CONFIG_ARCH_WANTS_PRE_LINK_VMLINUX -$(vmlinux-final): arch/$(SRCARCH)/tools/vmlinux.arch.o +vmlinux.unstripped: arch/$(SRCARCH)/tools/vmlinux.arch.o =20 arch/$(SRCARCH)/tools/vmlinux.arch.o: vmlinux.o FORCE $(Q)$(MAKE) $(build)=3Darch/$(SRCARCH)/tools $@ @@ -86,17 +72,30 @@ cmd_link_vmlinux =3D \ $< "$(LD)" "$(KBUILD_LDFLAGS)" "$(LDFLAGS_vmlinux)" "$@"; \ $(if $(ARCH_POSTLINK), $(MAKE) -f $(ARCH_POSTLINK) $@, true) =20 -targets +=3D $(vmlinux-final) -$(vmlinux-final): scripts/link-vmlinux.sh vmlinux.o $(KBUILD_LDS) FORCE +targets +=3D vmlinux.unstripped +vmlinux.unstripped: scripts/link-vmlinux.sh vmlinux.o $(KBUILD_LDS) FORCE +$(call if_changed_dep,link_vmlinux) ifdef CONFIG_DEBUG_INFO_BTF -$(vmlinux-final): $(RESOLVE_BTFIDS) +vmlinux.unstripped: $(RESOLVE_BTFIDS) endif =20 ifdef CONFIG_BUILDTIME_TABLE_SORT -$(vmlinux-final): scripts/sorttable +vmlinux.unstripped: scripts/sorttable endif =20 +# vmlinux +# ------------------------------------------------------------------------= --- + +remove-section-y :=3D +remove-section-$(CONFIG_ARCH_VMLINUX_NEEDS_RELOCS) +=3D '.rel*' + +quiet_cmd_strip_relocs =3D OBJCOPY $@ + cmd_strip_relocs =3D $(OBJCOPY) $(addprefix --remove-section=3D,$(re= move-section-y)) $< $@ + +targets +=3D vmlinux +vmlinux: vmlinux.unstripped FORCE + $(call if_changed,strip_relocs) + # modules.builtin.ranges # ------------------------------------------------------------------------= --- ifdef CONFIG_BUILTIN_MODULE_RANGES @@ -110,7 +109,7 @@ modules.builtin.ranges: $(srctree)/scripts/generate_bui= ltin_ranges.awk \ modules.builtin vmlinux.map vmlinux.o.map FORCE $(call if_changed,modules_builtin_ranges) =20 -vmlinux.map: $(vmlinux-final) +vmlinux.map: vmlinux.unstripped @: =20 endif --=20 2.50.1 From nobody Mon Oct 6 04:55:33 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A3E562DC347; Thu, 24 Jul 2025 13:50:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753365016; cv=none; b=RyX5aQLnCD/o7vloJCROCKQV2GDaIG4K8bs3Mjn0j7ws/9mOO+SPhOMrCClu+dAL2S08iuqcJlNaguXwDTYWpNS/uuHrK+zd+27hALSj13fNHQTJnoDtLT39l1RsRjcMWn1SnmKMzkDAF+62vz1h91svZ//kQLTZkZ1kkRsS7fU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753365016; c=relaxed/simple; bh=6Uahpcn0qMSHeFT4Ck6YJPepsBL+WJAqsNKhS9PQYgg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=TlGoy5DiF4oPAN2N3X9ANrd9hzuj1OHQQ8le0KSpVfCgS72tvMiztcK6fwGLXwakujpyXTjTWujbujK/VhiWfXH2P/DrEc/D6eu+ylu0cVH+IUkMTXm1ykfQa8hRFKrEgkUvhNGW+vaQOPt2YvfmenNkWlNzomnEf65JRsw3UIc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=jPDY2RvE; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="jPDY2RvE" Received: by smtp.kernel.org (Postfix) with ESMTPSA id EC6FEC4CEF5; Thu, 24 Jul 2025 13:50:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1753365016; bh=6Uahpcn0qMSHeFT4Ck6YJPepsBL+WJAqsNKhS9PQYgg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jPDY2RvE2g44xCQzLEgoi41z8kS52Y583ijdvyl1ATow5Bririr6ILosHp7JNDbGx EVCvyF+bi7qewHlSDtJr+cxQrTJel5oGjyN0uFFK7JmrVrfgRTc3cn67hGmzL+YfZA eioDVZY6tMPVwbCUaWSjcnOcpIOqumlBfb76u12gZbXY+IX9vWhaGbIHl/ajihs063 2r04PSgiKOR5Ne+8fqKvK/cxXsk6J1Wbld+aUtGoH+0DgWEW1MiGKTodj6ZT/a16dM QHs8iqX9ZOAe6x+dxlac3C2U+yKk4zqPCEx0qEM52VsU5gtzIHmK8iul2ccUEhWKG1 bvGRbZ5SqrmgQ== From: Alexey Gladkov To: Masahiro Yamada , Petr Pavlu , Luis Chamberlain , Sami Tolvanen , Daniel Gomez , Nathan Chancellor , Nicolas Schier Cc: linux-kernel@vger.kernel.org, linux-modules@vger.kernel.org, linux-kbuild@vger.kernel.org Subject: [PATCH v5 03/10] kbuild: keep .modinfo section in vmlinux.unstripped Date: Thu, 24 Jul 2025 15:49:40 +0200 Message-ID: X-Mailer: git-send-email 2.50.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Masahiro Yamada Keep the .modinfo section during linking, but strip it from the final vmlinux. Adjust scripts/mksysmap to exclude modinfo symbols from kallsyms. This change will allow the next commit to extract the .modinfo section from the vmlinux.unstripped intermediate. Signed-off-by: Masahiro Yamada --- include/asm-generic/vmlinux.lds.h | 2 +- scripts/Makefile.vmlinux | 2 +- scripts/mksysmap | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinu= x.lds.h index fa5f19b8d53a..1791665006f9 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -831,6 +831,7 @@ defined(CONFIG_AUTOFDO_CLANG) || defined(CONFIG_PROPELL= ER_CLANG) =20 /* Required sections not related to debugging. */ #define ELF_DETAILS \ + .modinfo : { *(.modinfo) } \ .comment 0 : { *(.comment) } \ .symtab 0 : { *(.symtab) } \ .strtab 0 : { *(.strtab) } \ @@ -1044,7 +1045,6 @@ defined(CONFIG_AUTOFDO_CLANG) || defined(CONFIG_PROPE= LLER_CLANG) *(.discard.*) \ *(.export_symbol) \ *(.no_trim_symbol) \ - *(.modinfo) \ /* ld.bfd warns about .gnu.version* even when not emitted */ \ *(.gnu.version*) \ =20 diff --git a/scripts/Makefile.vmlinux b/scripts/Makefile.vmlinux index 4f2d4c3fb737..e2ceeb9e168d 100644 --- a/scripts/Makefile.vmlinux +++ b/scripts/Makefile.vmlinux @@ -86,7 +86,7 @@ endif # vmlinux # ------------------------------------------------------------------------= --- =20 -remove-section-y :=3D +remove-section-y :=3D .modinfo remove-section-$(CONFIG_ARCH_VMLINUX_NEEDS_RELOCS) +=3D '.rel*' =20 quiet_cmd_strip_relocs =3D OBJCOPY $@ diff --git a/scripts/mksysmap b/scripts/mksysmap index 3accbdb269ac..a607a0059d11 100755 --- a/scripts/mksysmap +++ b/scripts/mksysmap @@ -79,6 +79,9 @@ / _SDA_BASE_$/d / _SDA2_BASE_$/d =20 +# MODULE_INFO() +/ __UNIQUE_ID_modinfo[0-9]*$/d + # ------------------------------------------------------------------------= --- # Ignored patterns # (symbols that contain the pattern are ignored) --=20 2.50.1 From nobody Mon Oct 6 04:55:33 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7B2732DC347; Thu, 24 Jul 2025 13:50:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753365020; cv=none; b=DFU+uyLU2uE1lrkyPnK+REQ8Vx11D58/0hrpvRt+GjvAa5URbgtJZobMrqCoBdpXb74vVhaXFkC/4ZLuGgbocBUBnHNrfWqvAIUkZ/lDBHkx2vUQ+jH/lgex7naAm5/BluJB2L3NSOTCjnNc4uxlPMPHl7orMKVwEOk0h7Oq/LQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753365020; c=relaxed/simple; bh=CQahKUZNepr3ndoD9y9Pqz4UQWbQPmtI3It1pqtZh4I=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Ohiz7rTf28/cbZhe5dGkkzaS65MBXEQvB7nUDxCJX517xZ+F+3CSo0sWzsh5KBdsvnlQZC8s61BK2cdng5ZMM/LjY0at8EUteMckc0cJAUvWta/yTALRm73BHtAqVuezMv30JVNU6LD3mOOlpgQqc4MULIbP7I4UxpK6xxZcNRM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=g0NkHpsQ; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="g0NkHpsQ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 85030C4CEF6; Thu, 24 Jul 2025 13:50:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1753365018; bh=CQahKUZNepr3ndoD9y9Pqz4UQWbQPmtI3It1pqtZh4I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=g0NkHpsQ6hH9+WTPzDtFQjpRxexs48vt9YpnHBan71A4ep0DK+Jp/GKAIv8PYcZPJ zNmu5ItQIkWwnQTSq3UEkzpdRYAEfLyIkIQlGiW2AUTfkKP40nCh7NOPQ6F1NpER6p PNuVIFak2MrgUP/B4ittkOyCJaRahhHLiH0RF6IFcvBB9HKJQZN90E1b9vvxkoBZZ4 I9pJ6Zn6Azl937ExoPbKF3/hfYibSakd9V8aTCdk7QNlyMIEZbTvQpyI8El6uSouXj gYKuIgbmXJ3etnEmFU+vJCwcwLOQ2WNGbBA56/C8A6XEAn/hVL3xG6SUoc6eyDIVdG DDoa96C2b6F+A== From: Alexey Gladkov To: Masahiro Yamada , Petr Pavlu , Luis Chamberlain , Sami Tolvanen , Daniel Gomez , Nathan Chancellor , Nicolas Schier Cc: linux-kernel@vger.kernel.org, linux-modules@vger.kernel.org, linux-kbuild@vger.kernel.org, Alexey Gladkov Subject: [PATCH v5 04/10] kbuild: extract modules.builtin.modinfo from vmlinux.unstripped Date: Thu, 24 Jul 2025 15:49:41 +0200 Message-ID: <7b5d40bf880bed2281590a55e94771ad2b56763b.1753354215.git.legion@kernel.org> X-Mailer: git-send-email 2.50.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Masahiro Yamada Currently, we assume all the data for modules.builtin.modinfo are available in vmlinux.o. This makes it impossible for modpost, which is invoked after vmlinux.o, to add additional module info. This commit moves the modules.builtin.modinfo rule after modpost. Signed-off-by: Masahiro Yamada Signed-off-by: Alexey Gladkov --- scripts/Makefile.vmlinux | 26 ++++++++++++++++++++++++++ scripts/Makefile.vmlinux_o | 26 +------------------------- 2 files changed, 27 insertions(+), 25 deletions(-) diff --git a/scripts/Makefile.vmlinux b/scripts/Makefile.vmlinux index e2ceeb9e168d..fdab5aa90215 100644 --- a/scripts/Makefile.vmlinux +++ b/scripts/Makefile.vmlinux @@ -96,6 +96,32 @@ targets +=3D vmlinux vmlinux: vmlinux.unstripped FORCE $(call if_changed,strip_relocs) =20 +# modules.builtin.modinfo +# ------------------------------------------------------------------------= --- + +OBJCOPYFLAGS_modules.builtin.modinfo :=3D -j .modinfo -O binary + +targets +=3D modules.builtin.modinfo +modules.builtin.modinfo: vmlinux.unstripped FORCE + $(call if_changed,objcopy) + +# modules.builtin +# ------------------------------------------------------------------------= --- + +__default: modules.builtin + +# The second line aids cases where multiple modules share the same object. + +quiet_cmd_modules_builtin =3D GEN $@ + cmd_modules_builtin =3D \ + tr '\0' '\n' < $< | \ + sed -n 's/^[[:alnum:]:_]*\.file=3D//p' | \ + tr ' ' '\n' | uniq | sed -e 's:^:kernel/:' -e 's/$$/.ko/' > $@ + +targets +=3D modules.builtin +modules.builtin: modules.builtin.modinfo FORCE + $(call if_changed,modules_builtin) + # modules.builtin.ranges # ------------------------------------------------------------------------= --- ifdef CONFIG_BUILTIN_MODULE_RANGES diff --git a/scripts/Makefile.vmlinux_o b/scripts/Makefile.vmlinux_o index b024ffb3e201..23c8751285d7 100644 --- a/scripts/Makefile.vmlinux_o +++ b/scripts/Makefile.vmlinux_o @@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0-only =20 PHONY :=3D __default -__default: vmlinux.o modules.builtin.modinfo modules.builtin +__default: vmlinux.o =20 include include/config/auto.conf include $(srctree)/scripts/Kbuild.include @@ -73,30 +73,6 @@ vmlinux.o: $(initcalls-lds) vmlinux.a $(KBUILD_VMLINUX_L= IBS) FORCE =20 targets +=3D vmlinux.o =20 -# modules.builtin.modinfo -# ------------------------------------------------------------------------= --- - -OBJCOPYFLAGS_modules.builtin.modinfo :=3D -j .modinfo -O binary - -targets +=3D modules.builtin.modinfo -modules.builtin.modinfo: vmlinux.o FORCE - $(call if_changed,objcopy) - -# modules.builtin -# ------------------------------------------------------------------------= --- - -# The second line aids cases where multiple modules share the same object. - -quiet_cmd_modules_builtin =3D GEN $@ - cmd_modules_builtin =3D \ - tr '\0' '\n' < $< | \ - sed -n 's/^[[:alnum:]:_]*\.file=3D//p' | \ - tr ' ' '\n' | uniq | sed -e 's:^:kernel/:' -e 's/$$/.ko/' > $@ - -targets +=3D modules.builtin -modules.builtin: modules.builtin.modinfo FORCE - $(call if_changed,modules_builtin) - # Add FORCE to the prerequisites of a target to force it to be always rebu= ilt. # ------------------------------------------------------------------------= --- =20 --=20 2.50.1 From nobody Mon Oct 6 04:55:33 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DAEE72E175F; Thu, 24 Jul 2025 13:50:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753365023; cv=none; b=ic/eUPSO4LZ7NnuFi3GcPNgBv2COWKub89GlwF1qGdbBYzH4/DN6RcnYp98CM7+o3gJNtOxyBIZILttXfbkoZK3dNTr72LBLMALPTXXq+hXMaOb5CV708HghYGnMsZqW3nL+aRxnOFc4hxyzEm3zQ+scYizG0frlNrWk/a1JG2U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753365023; c=relaxed/simple; bh=9uoPb133GCaKetRWqdjQUMfYOCdH8EWDfhbgoqCMV1M=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=gGEnK42D/pLab1YjYWBplyMaWFA3M1q/rb61qT80bS3gr/KiwZHBATCCLYtG/ba1Gi73Z0AxEoQ3OLwx393WdOKvXOgxGQQiXYkx6E7DbWzIXuxVHfN5zv5JQtE18Gc1gQpYafBlu/KaKQAwEHaz6+6Eybs5smzN08PR8/wT6cM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=moaa3z5j; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="moaa3z5j" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4B2FCC4CEF7; Thu, 24 Jul 2025 13:50:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1753365022; bh=9uoPb133GCaKetRWqdjQUMfYOCdH8EWDfhbgoqCMV1M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=moaa3z5jyK7uTq41wwmcZXVwkOCVfOiLXzuBa3KTbS15p5ahG5JKRRV0yPA67u+hg pLZBMzNl0xBIzq3BD/CKk9pbwXwOscQ1xpI1uA38zkJ8hZlnuPakqPfiI9moFRTnAZ eHH3864VAUutwr/UJcBJSKd7iTZHmiIBnMV0aEfFbr4YSTzWLxW1ookmjU9Bv7NKeH azx+pPiqiheOIDz2ZAhd7Ao9SjF8Ikvaa0lecV2y45mRjjmnBJ7CwZ9S6SX6/CtORJ +uBgwl7RBAabniACPqJalZXRXdhH4EGalWusaPOoIidhwsihCJF9v3DpELwx7PnQFq KZqynNLB6RZMA== From: Alexey Gladkov To: Masahiro Yamada , Petr Pavlu , Luis Chamberlain , Sami Tolvanen , Daniel Gomez , Nathan Chancellor , Nicolas Schier Cc: linux-kernel@vger.kernel.org, linux-modules@vger.kernel.org, linux-kbuild@vger.kernel.org, Alexey Gladkov , Khalid Aziz , "Martin K. Petersen" , linux-scsi@vger.kernel.org, James Bottomley Subject: [PATCH v5 05/10] scsi: Always define blogic_pci_tbl structure Date: Thu, 24 Jul 2025 15:49:42 +0200 Message-ID: X-Mailer: git-send-email 2.50.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The blogic_pci_tbl structure is used by the MODULE_DEVICE_TABLE macro. There is no longer a need to protect it with the MODULE condition, since this no longer causes the compiler to warn about an unused variable. Cc: Khalid Aziz Cc: "Martin K. Petersen" Cc: linux-scsi@vger.kernel.org Suggested-by: James Bottomley Signed-off-by: Alexey Gladkov --- drivers/scsi/BusLogic.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/scsi/BusLogic.c b/drivers/scsi/BusLogic.c index 1f100270cd38..08e12a3d6703 100644 --- a/drivers/scsi/BusLogic.c +++ b/drivers/scsi/BusLogic.c @@ -3715,7 +3715,6 @@ static void __exit blogic_exit(void) =20 __setup("BusLogic=3D", blogic_setup); =20 -#ifdef MODULE /*static const struct pci_device_id blogic_pci_tbl[] =3D { { PCI_VENDOR_ID_BUSLOGIC, PCI_DEVICE_ID_BUSLOGIC_MULTIMASTER, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, @@ -3731,7 +3730,6 @@ static const struct pci_device_id blogic_pci_tbl[] = =3D { {PCI_DEVICE(PCI_VENDOR_ID_BUSLOGIC, PCI_DEVICE_ID_BUSLOGIC_FLASHPOINT)}, {0, }, }; -#endif MODULE_DEVICE_TABLE(pci, blogic_pci_tbl); =20 module_init(blogic_init); --=20 2.50.1 From nobody Mon Oct 6 04:55:33 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D83312DE6E9; Thu, 24 Jul 2025 13:50:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753365027; cv=none; b=RRdZXQSnj1tVhdVCN6s+DuAb3WROp/ktccPXJie3OHh7yMcNu43GfjU/NqNrJcpUuTxLGuVVogONEtaW/vs6b4EzfJsDqDUDzMhQbD5MbVaL8L6rfKIoAfMJEjUFvREFYxZqBiyx/S8MXsbsYMqSVpMmwbUROIv8brM7DPnuAuU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753365027; c=relaxed/simple; bh=fXRkp9tkBw6fJ60VIZeOBOecvw7Vr9jECqm8Xl4Zdsw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=XMING7O2INkHyxNPOWchfmFOq1Bmmx0AmisVQMRIoA3A2iYSm8LCbsWVwPdqanaIU9qC/ozbWlH6o6m7/Gfc9fVEQ/rSchUUf64X05+TAWzg4l1VkQLmYIQ6q9ewY1C/beFCDIbGb/rhow24ppl0Rf//9sKgGexRJ6/2gdJC+OQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=k/IhEq/P; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="k/IhEq/P" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C3E8FC4CEEF; Thu, 24 Jul 2025 13:50:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1753365026; bh=fXRkp9tkBw6fJ60VIZeOBOecvw7Vr9jECqm8Xl4Zdsw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=k/IhEq/PiqLK01qExpI5aOvQ+DpYYmUDVDbEw0mLq1miQ3Y8Cj+nVVtGRIb0PM4Bt vO3vORB3POrs+uQ6xPWHDHsF0Pfcn82583m4LhZG4r07/WG7q8DtYE8GSGWokZ9Ofx ZA0kyefW9eYF4iXGPKruH5n3d4hZbixh56aN/WD4sdx6CkXDp1pfSEUAL6T3GCjMCX V6qputJonc5eloBanaE2rjsa8/1dRSimA5xUMwtJu8sfZalh7PbMEuO5Xj71ZDZi5R r5jj88mYeGf55eTP2/rUDKDpwYAY9b6bc6tZlJisg7aKJKMUHuM3Ayp1SIyMj4WI4H K7pNfKrCOkThw== From: Alexey Gladkov To: Masahiro Yamada , Petr Pavlu , Luis Chamberlain , Sami Tolvanen , Daniel Gomez , Nathan Chancellor , Nicolas Schier Cc: linux-kernel@vger.kernel.org, linux-modules@vger.kernel.org, linux-kbuild@vger.kernel.org, Alexey Gladkov , Xianwei Zhao , Linus Walleij , Neil Armstrong , Kevin Hilman , linux-amlogic@lists.infradead.org, linux-gpio@vger.kernel.org, kernel test robot Subject: [PATCH v5 06/10] pinctrl: meson: Fix typo in device table macro Date: Thu, 24 Jul 2025 15:49:43 +0200 Message-ID: X-Mailer: git-send-email 2.50.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The typo when using the MODULE_DEVICE_TABLE macro was not noticeable because the macro was defined only if the module was built as a separate module. Cc: Xianwei Zhao Cc: Linus Walleij Cc: Neil Armstrong Cc: Kevin Hilman Cc: linux-amlogic@lists.infradead.org Cc: linux-gpio@vger.kernel.org Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202507220009.8HKbNP16-lkp@int= el.com/ Signed-off-by: Alexey Gladkov Reviewed-by: Neil Armstrong --- drivers/pinctrl/meson/pinctrl-amlogic-a4.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pinctrl/meson/pinctrl-amlogic-a4.c b/drivers/pinctrl/m= eson/pinctrl-amlogic-a4.c index 385cc619df13..95525e66e5c0 100644 --- a/drivers/pinctrl/meson/pinctrl-amlogic-a4.c +++ b/drivers/pinctrl/meson/pinctrl-amlogic-a4.c @@ -1023,7 +1023,7 @@ static const struct of_device_id aml_pctl_of_match[] = =3D { { .compatible =3D "amlogic,pinctrl-a4", }, { /* sentinel */ } }; -MODULE_DEVICE_TABLE(of, aml_pctl_dt_match); +MODULE_DEVICE_TABLE(of, aml_pctl_of_match); =20 static struct platform_driver aml_pctl_driver =3D { .driver =3D { --=20 2.50.1 From nobody Mon Oct 6 04:55:33 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 12C0F2DE6E9; Thu, 24 Jul 2025 13:50:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753365030; cv=none; b=p8X5Awc1rKFyrrhdrBFSEQ2y49A/XSk2scpf9gmoMmA9wQEeW48r21QpBTJHTKxq9n8pji5J5Xsp+SZ2qdJYcq6J3lP6U7m9rucBDNq5bn6zsSA9cqFWWstGZwpSdDbmi/XKzXSTF83dYhXPOtaUTQ39wCV4UxUQtltiybwVjtw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753365030; c=relaxed/simple; bh=npsVQNBWgGe4XdIyvmKpwtFZqHqxXaHKuv2jSNXcaSQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=msWM0th6Cwi4lAXdN4r02wE2yHj5hrON9BI5MDMqOsQqWXqZc/tnXwF5cmFAxLqsVMzOe+xnCiaBgG5Ngdr2hEi3XYQj1V7Qfj23WoHAtU9V9QJt9kOmNdZPx4vjFDIsWgBmK9xmZ8B8bG4X+OLOKsGty79DdUQ1pEuubG4VczY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Gnizktmw; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Gnizktmw" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C9BC4C4CEED; Thu, 24 Jul 2025 13:50:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1753365029; bh=npsVQNBWgGe4XdIyvmKpwtFZqHqxXaHKuv2jSNXcaSQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GnizktmwOml8yvmpBowo/Q3Hp8LqpK3VJMSGGrIIu00XvvJnd9WBfmW94mlchARsC iiXklhQkPEDo8xoJAWsYxAlKEATSHJ1Gr/1K+fIRQE19/djAAvlqkR1Zx7Hd6t8n4l 8uLamn7fq85U2Bk46qyXuG8tviOJyWHecJl1df7F45ZTd899rPGDZkVOk4jN9e9e9d NxxXIXLlKXdevEQkgVWBhjw5BKPt5JBWWyGlciKY3QixxmCbt2ogXpsLn8sNQPEbsf XrNtFJv7GpSXHHO2InCTAzEfqj5JFo822iWxYxhNekvifsL0H1a4jl44dOtrjcjljW fh5/YGNNH1wiw== From: Alexey Gladkov To: Masahiro Yamada , Petr Pavlu , Luis Chamberlain , Sami Tolvanen , Daniel Gomez , Nathan Chancellor , Nicolas Schier Cc: linux-kernel@vger.kernel.org, linux-modules@vger.kernel.org, linux-kbuild@vger.kernel.org, Alexey Gladkov , Miguel Ojeda , Alex Gaynor , rust-for-linux@vger.kernel.org Subject: [PATCH v5 07/10] modpost: Add modname to mod_device_table alias Date: Thu, 24 Jul 2025 15:49:44 +0200 Message-ID: X-Mailer: git-send-email 2.50.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" At this point, if a symbol is compiled as part of the kernel, information about which module the symbol belongs to is lost. To save this it is possible to add the module name to the alias name. It's not very pretty, but it's possible for now. Cc: Miguel Ojeda Cc: Alex Gaynor Cc: rust-for-linux@vger.kernel.org Signed-off-by: Alexey Gladkov --- include/linux/module.h | 14 +++++++++++++- rust/kernel/device_id.rs | 8 ++++---- scripts/mod/file2alias.c | 18 ++++++++++++++---- 3 files changed, 31 insertions(+), 9 deletions(-) diff --git a/include/linux/module.h b/include/linux/module.h index 4689852d7b18..32e98200b2f4 100644 --- a/include/linux/module.h +++ b/include/linux/module.h @@ -243,10 +243,22 @@ struct module_kobject *lookup_or_create_module_kobjec= t(const char *name); /* What your module does. */ #define MODULE_DESCRIPTION(_description) MODULE_INFO(description, _descrip= tion) =20 +/* + * Format: __mod_device_table__kmod_____ + * Parts of the string `__kmod_` and `__` are used as delimiters when pars= ing + * a symbol in file2alias.c + */ +#define __mod_device_table(type, name) \ + __PASTE(__mod_device_table__, \ + __PASTE(__KBUILD_MODNAME, \ + __PASTE(__, \ + __PASTE(type, \ + __PASTE(__, name))))) + #ifdef MODULE /* Creates an alias so file2alias.c can find device table. */ #define MODULE_DEVICE_TABLE(type, name) \ -static typeof(name) __mod_device_table__##type##__##name \ +static typeof(name) __mod_device_table(type, name) \ __attribute__ ((used, alias(__stringify(name)))) #else /* !MODULE */ #define MODULE_DEVICE_TABLE(type, name) diff --git a/rust/kernel/device_id.rs b/rust/kernel/device_id.rs index 0a4eb56d98f2..365d8f544844 100644 --- a/rust/kernel/device_id.rs +++ b/rust/kernel/device_id.rs @@ -154,10 +154,10 @@ macro_rules! module_device_table { ($table_type: literal, $module_table_name:ident, $table_name:ident) = =3D> { #[rustfmt::skip] #[export_name =3D - concat!("__mod_device_table__", $table_type, - "__", module_path!(), - "_", line!(), - "_", stringify!($table_name)) + concat!("__mod_device_table__", line!(), + "__kmod_", module_path!(), + "__", $table_type, + "__", stringify!($table_name)) ] static $module_table_name: [::core::mem::MaybeUninit; $table_n= ame.raw_ids().size()] =3D unsafe { ::core::mem::transmute_copy($table_name.raw_ids()) }; diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c index 00586119a25b..13021266a18f 100644 --- a/scripts/mod/file2alias.c +++ b/scripts/mod/file2alias.c @@ -1476,8 +1476,8 @@ void handle_moddevtable(struct module *mod, struct el= f_info *info, { void *symval; char *zeros =3D NULL; - const char *type, *name; - size_t typelen; + const char *type, *name, *modname; + size_t typelen, modnamelen; static const char *prefix =3D "__mod_device_table__"; =20 /* We're looking for a section relative symbol */ @@ -1488,10 +1488,20 @@ void handle_moddevtable(struct module *mod, struct = elf_info *info, if (ELF_ST_TYPE(sym->st_info) !=3D STT_OBJECT) return; =20 - /* All our symbols are of form __mod_device_table____. */ + /* All our symbols are of form __mod_device_table__kmod___= __. */ if (!strstarts(symname, prefix)) return; - type =3D symname + strlen(prefix); + + modname =3D strstr(symname, "__kmod_"); + if (!modname) + return; + modname +=3D strlen("__kmod_"); + + type =3D strstr(modname, "__"); + if (!type) + return; + modnamelen =3D type - modname; + type +=3D strlen("__"); =20 name =3D strstr(type, "__"); if (!name) --=20 2.50.1 From nobody Mon Oct 6 04:55:33 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D4F8D2DE70D; Thu, 24 Jul 2025 13:50:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753365032; cv=none; b=M0bPnJpGCy1/CVRnLYI9e3WQajXDwmfqiWqDXonWMuCdYg99vsjSc0EPH7w89DXjVMKtW7blqFJafLUZBM1rhkUzLbzr5mnkDUrj+bW+P8sP/wc8+fowGuUd34Pxzy6RNA/B75g3igOTk8DACsR7GP161sy/thSTXGLP4EuYcdY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753365032; c=relaxed/simple; bh=8ralIn/kOiibGrJEyrFSjT72lEek+j4rm3Cb4XRp87s=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DvbIDLZc2Ct+odsopGGCVq5hPrDMnGWqDQkgaSe/45I41NyBPlpywVFwN8MRHRaem9PMBCEG5s2KW5jDmVbuEuKPv0zPG5wz8r12Q6RsAI8zWU6G4UBHlFTm27PZSwh8yW8mZot8Fujdg57x8NSVrvkBcMT5gXI79EjOX4dkoro= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=B52Y7B97; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="B52Y7B97" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 20FCBC4CEEF; Thu, 24 Jul 2025 13:50:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1753365032; bh=8ralIn/kOiibGrJEyrFSjT72lEek+j4rm3Cb4XRp87s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=B52Y7B97HYZuDyRyLzK7nnvF/B7kj2uCZRePU/1Eq8kjD9eI3cu6OIXwVdNITkH5u hnr2r6qVQgzw38Umtnh5hBw/Vzj2yJV8uZSpUv+EhpLlWShXO0zHQEsP9In81yowiP Jh0mAucbjRykIUXlOM/tpC4VavCa5FxdsmoJuzh6nnTfAq/AFHItnrfYcNXUxuONh6 82LKWC1ep9TvfLx4gYTDgLwWjYFSyqBL10/3O0uINMqWGlTGzt5jU3Hi3x/6EUhZhq O0AVo+GPzPvpa6xnwFpExppDoiikde6voObVYmCjOPNHXhQsekWw+oHY8sMaaqQ64D ScJJZgG/8uiVw== From: Alexey Gladkov To: Masahiro Yamada , Petr Pavlu , Luis Chamberlain , Sami Tolvanen , Daniel Gomez , Nathan Chancellor , Nicolas Schier Cc: linux-kernel@vger.kernel.org, linux-modules@vger.kernel.org, linux-kbuild@vger.kernel.org, Alexey Gladkov Subject: [PATCH v5 08/10] modpost: Create modalias for builtin modules Date: Thu, 24 Jul 2025 15:49:45 +0200 Message-ID: <742ea2fdd32336df499da7662e88fb26333c9890.1753354215.git.legion@kernel.org> X-Mailer: git-send-email 2.50.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" For some modules, modalias is generated using the modpost utility and the section is added to the module file. When a module is added inside vmlinux, modpost does not generate modalias for such modules and the information is lost. As a result kmod (which uses modules.builtin.modinfo in userspace) cannot determine that modalias is handled by a builtin kernel module. $ cat /sys/devices/pci0000:00/0000:00:14.0/modalias pci:v00008086d0000A36Dsv00001043sd00008694bc0Csc03i30 $ modinfo xhci_pci name: xhci_pci filename: (builtin) license: GPL file: drivers/usb/host/xhci-pci description: xHCI PCI Host Controller Driver Missing modalias "pci:v*d*sv*sd*bc0Csc03i30*" which will be generated by modpost if the module is built separately. To fix this it is necessary to generate the same modalias for vmlinux as for the individual modules. Fortunately '.vmlinux.export.o' is already generated from which '.modinfo' can be extracted in the same way as for vmlinux.o. Signed-off-by: Masahiro Yamada Signed-off-by: Alexey Gladkov --- include/linux/module.h | 4 ---- scripts/Makefile.vmlinux | 5 ++++- scripts/mksysmap | 3 +++ scripts/mod/file2alias.c | 16 ++++++++++++++++ scripts/mod/modpost.c | 17 ++++++++++++++++- scripts/mod/modpost.h | 2 ++ 6 files changed, 41 insertions(+), 6 deletions(-) diff --git a/include/linux/module.h b/include/linux/module.h index 32e98200b2f4..9a8b359a1016 100644 --- a/include/linux/module.h +++ b/include/linux/module.h @@ -255,14 +255,10 @@ struct module_kobject *lookup_or_create_module_kobjec= t(const char *name); __PASTE(type, \ __PASTE(__, name))))) =20 -#ifdef MODULE /* Creates an alias so file2alias.c can find device table. */ #define MODULE_DEVICE_TABLE(type, name) \ static typeof(name) __mod_device_table(type, name) \ __attribute__ ((used, alias(__stringify(name)))) -#else /* !MODULE */ -#define MODULE_DEVICE_TABLE(type, name) -#endif =20 /* Version of form [:][-]. * Or for CVS/RCS ID version, everything but the number is stripped. diff --git a/scripts/Makefile.vmlinux b/scripts/Makefile.vmlinux index fdab5aa90215..fcc188d26ead 100644 --- a/scripts/Makefile.vmlinux +++ b/scripts/Makefile.vmlinux @@ -89,8 +89,11 @@ endif remove-section-y :=3D .modinfo remove-section-$(CONFIG_ARCH_VMLINUX_NEEDS_RELOCS) +=3D '.rel*' =20 +remove-symbols :=3D -w --strip-symbol=3D'__mod_device_table__*' + quiet_cmd_strip_relocs =3D OBJCOPY $@ - cmd_strip_relocs =3D $(OBJCOPY) $(addprefix --remove-section=3D,$(re= move-section-y)) $< $@ + cmd_strip_relocs =3D $(OBJCOPY) $(addprefix --remove-section=3D,$(re= move-section-y)) \ + $(remove-symbols) $< $@ =20 targets +=3D vmlinux vmlinux: vmlinux.unstripped FORCE diff --git a/scripts/mksysmap b/scripts/mksysmap index a607a0059d11..c4531eacde20 100755 --- a/scripts/mksysmap +++ b/scripts/mksysmap @@ -59,6 +59,9 @@ # EXPORT_SYMBOL (namespace) / __kstrtabns_/d =20 +# MODULE_DEVICE_TABLE (symbol name) +/ __mod_device_table__/d + # ------------------------------------------------------------------------= --- # Ignored suffixes # (do not forget '$' after each pattern) diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c index 13021266a18f..7da9735e7ab3 100644 --- a/scripts/mod/file2alias.c +++ b/scripts/mod/file2alias.c @@ -1527,5 +1527,21 @@ void handle_moddevtable(struct module *mod, struct e= lf_info *info, } } =20 + if (mod->is_vmlinux) { + struct module_alias *alias; + + /* + * If this is vmlinux, record the name of the builtin module. + * Traverse the linked list in the reverse order, and set the + * builtin_modname unless it has already been set in the + * previous call. + */ + list_for_each_entry_reverse(alias, &mod->aliases, node) { + if (alias->builtin_modname) + break; + alias->builtin_modname =3D xstrndup(modname, modnamelen); + } + } + free(zeros); } diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index 5ca7c268294e..67f9cd76bdd2 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -2067,11 +2067,26 @@ static void write_if_changed(struct buffer *b, cons= t char *fname) static void write_vmlinux_export_c_file(struct module *mod) { struct buffer buf =3D { }; + struct module_alias *alias, *next; =20 buf_printf(&buf, - "#include \n"); + "#include \n" + "#include \n"); =20 add_exported_symbols(&buf, mod); + + buf_printf(&buf, + "#undef __MODULE_INFO_PREFIX\n" + "#define __MODULE_INFO_PREFIX\n"); + + list_for_each_entry_safe(alias, next, &mod->aliases, node) { + buf_printf(&buf, "MODULE_INFO(%s.alias, \"%s\");\n", + alias->builtin_modname, alias->str); + list_del(&alias->node); + free(alias->builtin_modname); + free(alias); + } + write_if_changed(&buf, ".vmlinux.export.c"); free(buf.p); } diff --git a/scripts/mod/modpost.h b/scripts/mod/modpost.h index 9133e4c3803f..2aecb8f25c87 100644 --- a/scripts/mod/modpost.h +++ b/scripts/mod/modpost.h @@ -99,10 +99,12 @@ buf_write(struct buffer *buf, const char *s, int len); * struct module_alias - auto-generated MODULE_ALIAS() * * @node: linked to module::aliases + * @modname: name of the builtin module (only for vmlinux) * @str: a string for MODULE_ALIAS() */ struct module_alias { struct list_head node; + char *builtin_modname; char str[]; }; =20 --=20 2.50.1 From nobody Mon Oct 6 04:55:33 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5ABE52DE71F; Thu, 24 Jul 2025 13:50:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753365035; cv=none; b=H3WyfoyDsn8z5RrPu9UKrtCzi2pF1YVkQz34t7Ojl1Tvvs9sk81amn7WUZPjE55yxQaRSfb933FcWCq9v4m9WBDS4qA49VNdPEtFiHc1VNPkjlYqK/SYLNrJCsMknIceWXzR4cHb3L+gaNfoGMnfyqdJkfyFgOTMJNkn13BPA58= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753365035; c=relaxed/simple; bh=BZNqAkUNOK9Nr6DHLj1baz+QKcwHjdeg9vOowOhVhiY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=cjbcW7lc6KfnnaFaIFh0if66OTDD18HTjwwmlnnSGq57koNNYL/jOR+kVVj/cFv5OjG32QEE0wfvC+Msjgs4GpDLqzC7owJfTeVM8/YSQLMCBUxBM+xjgw2f6/JwJ4R1mwceCGZfqDAgaWTaSFnXrssmEvvknsWVU3LF4cHD5Eo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=uRAMFOVb; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="uRAMFOVb" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DBD49C4CEF6; Thu, 24 Jul 2025 13:50:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1753365035; bh=BZNqAkUNOK9Nr6DHLj1baz+QKcwHjdeg9vOowOhVhiY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uRAMFOVbhKpKMPxMRHqHc1oP2659cwFd1ukcgP9s/LBLq9vPnDOzvUT5CRDEUzwz2 aK3/2kdc/zgp+tyzQ5A0v3fOsliOWIw451BNfOCiI/nmmIznanYRucAMPKrep8COYx b2t7j+M4PDuQRD51kyJmW1q3yeFZp7Hxwq1Elmgs3z6rIG9/cBZuvcxoT0RXoReB8A EYc/Y5X/w2eV1AeOt2piI1ZePHF+dpj0kK8NwUpHJExETZBqDalvo7EtTbZ98mS6Xf XCZks7efxFLBaXpa4RaRAg2LDrZ9EZNfmQ41T0ThHkvBF6kkRjauuujRtv2w8bfBna DTjpPeAn+ga6A== From: Alexey Gladkov To: Masahiro Yamada , Petr Pavlu , Luis Chamberlain , Sami Tolvanen , Daniel Gomez , Nathan Chancellor , Nicolas Schier Cc: linux-kernel@vger.kernel.org, linux-modules@vger.kernel.org, linux-kbuild@vger.kernel.org, Alexey Gladkov Subject: [PATCH v5 09/10] kbuild: vmlinux.unstripped should always depend on .vmlinux.export.o Date: Thu, 24 Jul 2025 15:49:46 +0200 Message-ID: <2be01f4db6d5b4dc009af0b8ed058e6dc6a3bf7c.1753354215.git.legion@kernel.org> X-Mailer: git-send-email 2.50.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Since .vmlinux.export.c is used to add generated by modpost modaliases for builtin modules the .vmlinux.export.o is no longer optional and should always be created. The generation of this file is not dependent on CONFIG_MODULES. Signed-off-by: Alexey Gladkov --- scripts/Makefile.vmlinux | 9 ++------- scripts/link-vmlinux.sh | 5 +---- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/scripts/Makefile.vmlinux b/scripts/Makefile.vmlinux index fcc188d26ead..dbbe3bf0cf23 100644 --- a/scripts/Makefile.vmlinux +++ b/scripts/Makefile.vmlinux @@ -53,11 +53,6 @@ endif # vmlinux.unstripped # ------------------------------------------------------------------------= --- =20 -ifdef CONFIG_MODULES -targets +=3D .vmlinux.export.o -vmlinux.unstripped: .vmlinux.export.o -endif - ifdef CONFIG_ARCH_WANTS_PRE_LINK_VMLINUX vmlinux.unstripped: arch/$(SRCARCH)/tools/vmlinux.arch.o =20 @@ -72,8 +67,8 @@ cmd_link_vmlinux =3D \ $< "$(LD)" "$(KBUILD_LDFLAGS)" "$(LDFLAGS_vmlinux)" "$@"; \ $(if $(ARCH_POSTLINK), $(MAKE) -f $(ARCH_POSTLINK) $@, true) =20 -targets +=3D vmlinux.unstripped -vmlinux.unstripped: scripts/link-vmlinux.sh vmlinux.o $(KBUILD_LDS) FORCE +targets +=3D vmlinux.unstripped .vmlinux.export.o +vmlinux.unstripped: scripts/link-vmlinux.sh vmlinux.o .vmlinux.export.o $(= KBUILD_LDS) FORCE +$(call if_changed_dep,link_vmlinux) ifdef CONFIG_DEBUG_INFO_BTF vmlinux.unstripped: $(RESOLVE_BTFIDS) diff --git a/scripts/link-vmlinux.sh b/scripts/link-vmlinux.sh index 51367c2bfc21..433849ff7529 100755 --- a/scripts/link-vmlinux.sh +++ b/scripts/link-vmlinux.sh @@ -73,10 +73,7 @@ vmlinux_link() objs=3D"${objs} .builtin-dtbs.o" fi =20 - if is_enabled CONFIG_MODULES; then - objs=3D"${objs} .vmlinux.export.o" - fi - + objs=3D"${objs} .vmlinux.export.o" objs=3D"${objs} init/version-timestamp.o" =20 if [ "${SRCARCH}" =3D "um" ]; then --=20 2.50.1 From nobody Mon Oct 6 04:55:33 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 55B5E2DEA89; Thu, 24 Jul 2025 13:50:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753365039; cv=none; b=afM94P7crHD3lVZBV73J5ZEbs+sbkAhAFkBzrEtn/P1D8NPqWSDhBDfnU7EQR0r8FJzJrEW+H8DLnfAzB8SPsgcA4V1MfrfOc8mFAkPAdMGUkaMDBVJuZnG5SkgC9056oXr35Bshc9rc+koj3hxqzdlJZ/RwDSWr8OunA/rrG4M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753365039; c=relaxed/simple; bh=iJjLNDfFc1+GOOk7iXnO04IQxxZdux2GznFTgHowxBk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pitqFfH4EIzopM3wlDs0FW2tlGGSOg3F5rPhcpybmdcSTbTyGTXS1efaQynBEyfIRWEwZSTcAmvr6cDxv6UnQBKSkLH9u6P2JraDr61m4icMK0qvUkwqwrBHtbsMP2bCjz6JG/bohmXrcn89ICiOx1wvcQXF2Yj+dTeJA5o9jhw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=OqpCqpa8; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="OqpCqpa8" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A2A40C4CEED; Thu, 24 Jul 2025 13:50:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1753365038; bh=iJjLNDfFc1+GOOk7iXnO04IQxxZdux2GznFTgHowxBk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OqpCqpa8IWuCzkJ3Alf+tjYsASPgZIrtdsqjDLkugG365FO7HHKm/9A1Y3rAKIf1I mrELj6E07kyVhr5+roursPmMQeUhe0cb4TIqEEgZ7c/DT2htlkoshQ8dNKz1JleFtd G4WYnENA2jclojwypGF2Wwyk4vvZbqRNVWcF3+mGd4+qvSGWlwemCBAmwTkjYJMpTH krghYq51KSAHWhiu/HjnxfqxQtpog6JnwBKweo6q2kvnhJpfVoqKjuDyv2YH2bY0Fh k8+HxjJ2sOVGL4X/2YWO6K8emN/kxlCPAygYV5awwPLs9zVuYUyttdJacAF2bj8+g0 3bJNbckxIlSoQ== From: Alexey Gladkov To: Masahiro Yamada , Petr Pavlu , Luis Chamberlain , Sami Tolvanen , Daniel Gomez , Nathan Chancellor , Nicolas Schier Cc: linux-kernel@vger.kernel.org, linux-modules@vger.kernel.org, linux-kbuild@vger.kernel.org, Alexey Gladkov , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , linux-s390@vger.kernel.org, kernel test robot Subject: [PATCH v5 10/10] s390: vmlinux.lds.S: Reorder sections Date: Thu, 24 Jul 2025 15:49:47 +0200 Message-ID: <2860d5a5e7c6279b3836537e20b0fa0c40d2ba0f.1753354215.git.legion@kernel.org> X-Mailer: git-send-email 2.50.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Reorder the sections to be placed in the default segment. The .vmlinux.info use :NONE to override the default segment and tell the linker to not put the section in any segment at all. >> s390x-linux-ld: .tmp_vmlinux1: warning: allocated section `.modinfo' not= in segment >> s390x-linux-ld: .tmp_vmlinux2: warning: allocated section `.modinfo' not= in segment >> s390x-linux-ld: vmlinux.unstripped: warning: allocated section `.modinfo= ' not in segment Cc: Heiko Carstens Cc: Vasily Gorbik Cc: Alexander Gordeev Cc: linux-s390@vger.kernel.org Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202506062053.zbkFBEnJ-lkp@int= el.com/ Signed-off-by: Alexey Gladkov Acked-by: Heiko Carstens --- arch/s390/kernel/vmlinux.lds.S | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/s390/kernel/vmlinux.lds.S b/arch/s390/kernel/vmlinux.lds.S index ff1ddba96352..3f2f90e38808 100644 --- a/arch/s390/kernel/vmlinux.lds.S +++ b/arch/s390/kernel/vmlinux.lds.S @@ -202,6 +202,11 @@ SECTIONS . =3D ALIGN(PAGE_SIZE); _end =3D . ; =20 + /* Debugging sections. */ + STABS_DEBUG + DWARF_DEBUG + ELF_DETAILS + /* * uncompressed image info used by the decompressor * it should match struct vmlinux_info @@ -232,11 +237,6 @@ SECTIONS #endif } :NONE =20 - /* Debugging sections. */ - STABS_DEBUG - DWARF_DEBUG - ELF_DETAILS - /* * Make sure that the .got.plt is either completely empty or it * contains only the three reserved double words. --=20 2.50.1