From nobody Sat Sep 27 20:33:11 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 85FC0342CB3; Mon, 18 Aug 2025 16:58:05 +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=1755536285; cv=none; b=T7N/z6bEgtV/rBF+ixIktrcEDFZhtfqTMHsHLe7zUNuZaoGA9con0K6uvP8W9PIiqPNS7uitWsV/oy6N8j67nwb9WUkV+I8N+kjvxUFQCB3JzvHqaoRWhu9asFAjxcxtkd2yN9+pdUs3PxAl1KNVa0JmQ5/bxdz9bywbxxK6scU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755536285; c=relaxed/simple; bh=7DvUfbLDHcNpchdb39M+gsCoURfaKV1JpU9VP1P0WYM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=MEQy8wJQtTvF2L+Yqwu3vP7lpO2qXixrwE+Qq4oiKbkof0tQ90oW7B+Fl9AXmSrDMnY92vKeRVBOBxZsrEPGfJEPF78jNr7SjaLtoFmvUgxgPnNqS46+qASOPcjPVZaa7o1Ox/M+6tYmlfyjKQmfu6T5P4zwtq+gRlbcXCqVEWM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=PR+wkHRS; 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="PR+wkHRS" Received: by smtp.kernel.org (Postfix) with ESMTPSA id EC32FC116C6; Mon, 18 Aug 2025 16:58:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1755536285; bh=7DvUfbLDHcNpchdb39M+gsCoURfaKV1JpU9VP1P0WYM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PR+wkHRSlITV96YSpNXaPGswOnIBosVbaorShwQ6GbSL97QRSKkseFZHvUoKtN5Bp Hj5qURUMvgbm7c/6Kd1xG8RguCcg91gKo8/hLd7UZHwYhMjKkflNEBzY0yfr5Se2LN tbcKmMgZHJzDqzQzjNFifqicTGR33cOKw8NYwudfMHTcP4Wl/s5ogDjEhJXF6vxT94 LvAjPk9OraLkQ44Fwf6uZy2WrbI+zsJbxWHTqmDdm9nLtT6gYHQxztPCAnOOUu99Mo HSFf5v24sRM5U4HPLZSd7dRXYsdSULx3xkQaftEM991TbqPUnEeumhSNw8Q43p3gbw mRWT5mXicCI5Q== From: Alexey Gladkov To: Nathan Chancellor , Nicolas Schier , Petr Pavlu , Luis Chamberlain , Sami Tolvanen , Daniel Gomez Cc: linux-kernel@vger.kernel.org, linux-modules@vger.kernel.org, linux-kbuild@vger.kernel.org, Masahiro Yamada Subject: [PATCH v7 3/8] kbuild: keep .modinfo section in vmlinux.unstripped Date: Mon, 18 Aug 2025 18:54:57 +0200 Message-ID: <4d53c72293d88b663257a0d723ebf3473a08b374.1755535876.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 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 ae2d2359b79e9..cfa63860dfd4c 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 4f2d4c3fb7372..e2ceeb9e168d4 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 3accbdb269ac7..a607a0059d119 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