From nobody Thu Apr 2 18:59:39 2026 Received: from mail-ed1-f74.google.com (mail-ed1-f74.google.com [209.85.208.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9A416346E43 for ; Thu, 26 Mar 2026 21:25:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.74 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774560327; cv=none; b=DTqL3Y4HBHdFwp/fJ8yTN/6p26RcGoGvh2j2oG4VUC7KT/1wX0oDYFpEZIgdwwGjCs5Nk7/l+N8sPvRo2wzXWp9r3SwgeyMHTlI+gFNcoZFb2HHjT/Xi9orLXhG6Gc9t/etsLaqHEo573V7BswDNV5tNecYLy3yKMxXWt76Co8w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774560327; c=relaxed/simple; bh=yxWFKfFkKHmuOpsxGuTO4vPY99a8JR43U1hClfLdqBk=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=l1xW0bROqthj88Y5o42sq8biU0c4VmOzLnzxGbYoUTLQmUHcjEfslgSM6gejCiRS0jN1d4nWaP3StXeCyOIHMQSblDneSmNOqO30E2f4FXQCV/VptYq5eIZgsoxbnL+JAI1OnHjWwNOOXXD0HWemCpukrwUpinbcIwARNaiv5U8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--sidnayyar.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=JrnCHHLB; arc=none smtp.client-ip=209.85.208.74 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--sidnayyar.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="JrnCHHLB" Received: by mail-ed1-f74.google.com with SMTP id 4fb4d7f45d1cf-66b0e7430d6so736773a12.2 for ; Thu, 26 Mar 2026 14:25:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1774560324; x=1775165124; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=KWI54gUN+/1z0II7jAJ2ytcdqsD5FtTzHZqzZAkbnP4=; b=JrnCHHLBnnSdj37f/7KmfJMneZEXt24dNLLaqP6aGRkUHDGp2Q1x/BzSMmGO/QKwFL KtadSgexEhD+xdjaMztTmCEXOLINZmEmuWfhQsjZ7iAPaNeXfuRJRVdUWasIywOjShZM J4CZ6KhcQv1v2301sVyyhQ06RclkaPtVuToP3CzhWJB/FYaNXXxWSDFAjaFz2YJiqTDl CJQs8ZJZrN2VloBEB2PTcAtLitArxDRDKZXNYfr98NRKbVw95wkCzNdF9O/b0ApPVyuN SA+Sr7qmjydMEnSGbOf0EY4OFwp5UBDXesNjR9813fui0iqU6tJ+c0s2m3LanlE2Stvn EMNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774560324; x=1775165124; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=KWI54gUN+/1z0II7jAJ2ytcdqsD5FtTzHZqzZAkbnP4=; b=VbnAXKN0uWd0trQUwdP6sJ00neY6WCjzB/bwQCrD3XrhwkVeMw/DFqrHcF5PDSkExM qP53kV5V0ZdnZBZSeUx8ExgP12tTLeQtCYJKqPkz7tA8l+cx1njaixlBe8ZLGuSLRTGl EngKbH07z00UBt8+T6D9LeUVfalYqG+FdUQGZ02pr4u7KRoVr8IF6gzVCy4FF2XjFfat 0Jr7AhLnqs6hUJQwsyTPlC/NGJIln6EbQjPyCNN+m7o3/CghWcYFcPyOdZRtjkdARlxW T8A1c7KYx8kTXNR26i3lu0Jnq6rl8GcvSNhDs0WsGG7k4neoeKe/ynm6UJPBDaJ1Mfok rXqQ== X-Forwarded-Encrypted: i=1; AJvYcCUVfKzi3zD2iuug6xQIfjszI5cFTfTvHgiTn7v++rY7XmKbUV939HnkbORiRPMPNlhLP/zEdaKGMZewwbw=@vger.kernel.org X-Gm-Message-State: AOJu0YyuPBTl8slH09CfoBYkmR+/6sJma9uG5knhZubpH1R/XOjFHjEW DgC1M8gC3yLxeJ/k0VvGRePcmNsY9DawLpu5WZC75ffqto1WqIRG0AV7sL5slajqYtecPoQRjeg xOvmihm7Ii3WmOKaKJQ== X-Received: from edf13.prod.google.com ([2002:a05:6402:21cd:b0:667:53b3:300f]) (user=sidnayyar job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6402:458d:b0:669:2043:ec13 with SMTP id 4fb4d7f45d1cf-66a82672771mr5923271a12.21.1774560323929; Thu, 26 Mar 2026 14:25:23 -0700 (PDT) Date: Thu, 26 Mar 2026 21:25:02 +0000 In-Reply-To: <20260326-kflagstab-v5-0-fa0796fe88d9@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260326-kflagstab-v5-0-fa0796fe88d9@google.com> X-Mailer: b4 0.14.3 Message-ID: <20260326-kflagstab-v5-1-fa0796fe88d9@google.com> Subject: [PATCH v5 1/7] module: define ksym_flags enumeration to represent kernel symbol flags From: Siddharth Nayyar To: Luis Chamberlain , Petr Pavlu , Daniel Gomez , Sami Tolvanen , Aaron Tomlin , Arnd Bergmann , Nathan Chancellor , Nicolas Schier , Jonathan Corbet , Shuah Khan Cc: linux-modules@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-kbuild@vger.kernel.org, linux-doc@vger.kernel.org, Siddharth Nayyar , maennich@google.com, gprocida@google.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Symbol flags is an enumeration used to represent flags as a bitset, for example a flag to tell if a symbol is GPL only. The said bitset is introduced in subsequent patches and will contain values of kernel symbol flags. These bitset will then be used to infer flag values rather than fragmenting ksymtab for separating symbols with different flag values, thereby eliminating the need to fragment the ksymtab. Signed-off-by: Siddharth Nayyar Reviewed-by: Petr Pavlu --- include/linux/module_symbol.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/linux/module_symbol.h b/include/linux/module_symbol.h index 77c9895b9ddb..574609aced99 100644 --- a/include/linux/module_symbol.h +++ b/include/linux/module_symbol.h @@ -2,6 +2,11 @@ #ifndef _LINUX_MODULE_SYMBOL_H #define _LINUX_MODULE_SYMBOL_H =20 +/* Kernel symbol flags bitset. */ +enum ksym_flags { + KSYM_FLAG_GPL_ONLY =3D 1 << 0, +}; + /* This ignores the intensely annoying "mapping symbols" found in ELF file= s. */ static inline bool is_mapping_symbol(const char *str) { --=20 2.53.0.1018.g2bb0e51243-goog From nobody Thu Apr 2 18:59:39 2026 Received: from mail-wm1-f73.google.com (mail-wm1-f73.google.com [209.85.128.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E21483A75BA for ; Thu, 26 Mar 2026 21:25:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.73 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774560328; cv=none; b=gFmg2NWNPef1KtAyW1FHAtVBu7+Tz+/G4o6F0cHUsAlwKzrw/0c4q926e4mhmcajNrqTk/W0DpAsK84XAosNbzWr5U5qLn6boVRZ7T7WG1CtgGWU//5cGtQQQBdlp5XpsN5G4OQili++C4GwK59toNiSgs2csdH1ojR6p3wpdaE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774560328; c=relaxed/simple; bh=o/kOrCCo+fMsG/zyKbK9sMlBZ4cdbWSoTsj4GMMdO14=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=HFDN5eunBp6Ru9YEdlWOOao4a08c7y0AldqCn6KfE/+d1qYOBbySjZLsBfloW0Nm/6AoCGBqSSRnRX7E6jM3G/2zcZkgIUwCvFa2G2VAqztNOpLZFtfMWwhDNSLsOxef1uCZRT13T0J3TYvamoep1MRaLSWiPJCO9+wtp8PuWLg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--sidnayyar.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=hxNI5G8M; arc=none smtp.client-ip=209.85.128.73 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--sidnayyar.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="hxNI5G8M" Received: by mail-wm1-f73.google.com with SMTP id 5b1f17b1804b1-48531e6012bso17517055e9.1 for ; Thu, 26 Mar 2026 14:25:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1774560325; x=1775165125; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=Q64ZpAFewOF3l9iLTHkbHOl134UR/SzN3vMtwvmgNnI=; b=hxNI5G8MKD8Y5ARvIozlhz0L6kprlBZ5GsMeUGFbUOZE2ppGchpgjat0MZyUOV+SJg 69P33oU5Obe4GHsK12/6B/C5ckOmdA51CktXZKE9wsOW3eD6x6tw1bTLZONUHKUCJe6u z4/kXwABbTJQrr+CyCo9QacA45H/xyBB00xuwTrW36KVx96umKAhQ2S2uQ8w2rlUM1qL bdGNyuXMvs0AwDAacYWOq9dzOK7sQmr4laAHgsr7uKZYwCsmicu6CQEt0u+tNMpklp5s 7fTtfAlfWTMVbvUdyD49vRx77XOu7p8QYzOq3P6t6xwsHk1E5P6OWAKeJTzQeXCvJnBx G4bA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774560325; x=1775165125; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Q64ZpAFewOF3l9iLTHkbHOl134UR/SzN3vMtwvmgNnI=; b=PD8E0CHYWfZDXXT+80hCbni5laz9sp0jINTHnQKF8gxriY87kB8M6JI1PsvrRLcIQq 2/2XxYpppqRSgfkUDzznYa3FV3KSrU8WpgjML2hpTOrRh7nGkdGCDUOBVrwSVevuqL+K 8wg2/sA/dsGMX0wSyRVkLzykMsp+eQ4Vlgn2Wx2c60qBCOO7POEDH2JaoMY36FLuaRiO q3QOoy4gCaX9QRrzJ1RESOzbYb0RNXULRzN1ctQfr5SpW9U073jiKRCugVK9/rxwfnxP 5NVYOHjstpz0Ke852+OwoXuWHuBLQ7OeiiiXPqygYe29vZJo4SwHtgY/QFb6ITRkqhij C7oA== X-Forwarded-Encrypted: i=1; AJvYcCUqOmx5aKcMyz4SJBTYz70jP4W6EoaqI95ZCUHd6tsgrcKNOvaYuWzFo1PhwKXzsR6kEUutEu7kTAnzWiM=@vger.kernel.org X-Gm-Message-State: AOJu0YzQ1A/Glraao5WF9Pb2hRiRSlu+fmf7bMCJxsAjAIroZDFUQIFV SXvWYPW5DM0qhj/VhIlCZs/nAp9p4sc9MA6gsYzvd1lLeHAVhoY/mfsvoAhiCfHThdn8988WTZK thKVFNlGjFWR2DwSi6Q== X-Received: from wmcu15.prod.google.com ([2002:a7b:c04f:0:b0:485:2e9a:31b4]) (user=sidnayyar job=prod-delivery.src-stubby-dispatcher) by 2002:a05:600d:e:b0:485:5812:bb9e with SMTP id 5b1f17b1804b1-48727d31801mr2881495e9.0.1774560325336; Thu, 26 Mar 2026 14:25:25 -0700 (PDT) Date: Thu, 26 Mar 2026 21:25:03 +0000 In-Reply-To: <20260326-kflagstab-v5-0-fa0796fe88d9@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260326-kflagstab-v5-0-fa0796fe88d9@google.com> X-Mailer: b4 0.14.3 Message-ID: <20260326-kflagstab-v5-2-fa0796fe88d9@google.com> Subject: [PATCH v5 2/7] module: add kflagstab section to vmlinux and modules From: Siddharth Nayyar To: Luis Chamberlain , Petr Pavlu , Daniel Gomez , Sami Tolvanen , Aaron Tomlin , Arnd Bergmann , Nathan Chancellor , Nicolas Schier , Jonathan Corbet , Shuah Khan Cc: linux-modules@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-kbuild@vger.kernel.org, linux-doc@vger.kernel.org, Siddharth Nayyar , maennich@google.com, gprocida@google.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable This section will contain read-only data for values of kernel symbol flags in the form of an 8-bit bitsets for each kernel symbol. Each bit in the bitset represents a flag value defined by ksym_flags enumeration. The kflagstab section introduces a 1-byte overhead for each symbol exported in the ksymtab. Given that typical kernel builds contain roughly a few thousand exported symbols, the resulting memory increase is negligible. Signed-off-by: Siddharth Nayyar Reviewed-by: Petr Pavlu --- include/asm-generic/vmlinux.lds.h | 7 +++++++ scripts/module.lds.S | 1 + 2 files changed, 8 insertions(+) diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinu= x.lds.h index 1e1580febe4b..d64a475c468a 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -536,6 +536,13 @@ __stop___kcrctab_gpl =3D .; \ } \ \ + /* Kernel symbol flags table */ \ + __kflagstab : AT(ADDR(__kflagstab) - LOAD_OFFSET) { \ + __start___kflagstab =3D .; \ + KEEP(*(SORT(___kflagstab+*))) \ + __stop___kflagstab =3D .; \ + } \ + \ /* Kernel symbol table: strings */ \ __ksymtab_strings : AT(ADDR(__ksymtab_strings) - LOAD_OFFSET) { \ *(__ksymtab_strings) \ diff --git a/scripts/module.lds.S b/scripts/module.lds.S index 054ef99e8288..d7a8ba278dfc 100644 --- a/scripts/module.lds.S +++ b/scripts/module.lds.S @@ -23,6 +23,7 @@ SECTIONS { __ksymtab_gpl 0 : ALIGN(8) { *(SORT(___ksymtab_gpl+*)) } __kcrctab 0 : ALIGN(4) { *(SORT(___kcrctab+*)) } __kcrctab_gpl 0 : ALIGN(4) { *(SORT(___kcrctab_gpl+*)) } + __kflagstab 0 : ALIGN(1) { *(SORT(___kflagstab+*)) } =20 .ctors 0 : ALIGN(8) { *(SORT(.ctors.*)) *(.ctors) } .init_array 0 : ALIGN(8) { *(SORT(.init_array.*)) *(.init_array) } --=20 2.53.0.1018.g2bb0e51243-goog From nobody Thu Apr 2 18:59:39 2026 Received: from mail-wm1-f74.google.com (mail-wm1-f74.google.com [209.85.128.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 485993A782E for ; Thu, 26 Mar 2026 21:25:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.74 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774560330; cv=none; b=hgLIMCgVof173/zUDTtyoF29SiiGsLJbg6dz0GGuOmkX01AWo/mE/AtOY5m1nIIm4kxfXB2a/m9NqN+Xf9dzleif+9Rt8SgdnjfkzW+afH3bt1S/Rm7HZf1IKI1gGxIlQgMI/fpNBpHBj0+Aj7DMzWZJIixvUJCfwNT39lID+KE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774560330; c=relaxed/simple; bh=IMqZKd1uN1FnLrufR1Vtu+d5jfNCK7QjuAG3cXhKCg8=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=lW/C8kbZsQc8T4AHb4G61Z63hC5rgP/jAzWSprpxW4L4Lwd7pu8Gn64ybnJr2KODk3KpSYsK+eMKOUkXoLUn1dgv9r30BjTAh297bPRbnGnbvX7+rzuTZvFiasATT5W7yqwCj8QGFO7yLb70xM2zT0zlPmKJk+FLgcGLq751FBc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--sidnayyar.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=NJbP2TmX; arc=none smtp.client-ip=209.85.128.74 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--sidnayyar.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="NJbP2TmX" Received: by mail-wm1-f74.google.com with SMTP id 5b1f17b1804b1-48531e8ae62so10819625e9.3 for ; Thu, 26 Mar 2026 14:25:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1774560327; x=1775165127; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=woqFHYkUrW1f2z9oyqhnpwQO2sR6jhXkFvm21NeDZng=; b=NJbP2TmXX1PaPlaltakZh7+M/KZt9H62AzEfr18yZhzga8pSxsM+cNSkqWqjDPCUHh 8GKUI3xp5Z42YY4+ospEieiHSd/N0g4HbUjRsG2O3yyGlHwnvkktUL2ap3PXX+Op0YBs DQUOUzmv8QYGghzA5n9KWoN+v2mruxNb+yio8y3aS9bx8BfWHxq/bAEuzWI1w0p8L48C tecCvtR/P/ClNrpVwTYqcWCMorOD4NX8JqiXoyxr8t9NUZwtqqRhH/7/Tvrys6XlMJJr 37Pzr2Uc4VyE508UHa4OfP01ahGBWKf2PHkOodVfDO9DYtrLq850IN5j4muw2zNmuWZl UsMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774560327; x=1775165127; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=woqFHYkUrW1f2z9oyqhnpwQO2sR6jhXkFvm21NeDZng=; b=eQkF877GX0GBpb7kkjnOHDD+wfcGwt8pRt39YKdm5j7W3Wab041wEj6pLJAap8jucr eH0tJolmFr6qzXmbb/SMeqYka00fiIjBK/gQqsSLc+PE3yysmi4m5Auapc3EJ80NRY1g 64uGaGZIS2T461i2xbkFlVippFslaqrCz0Dso/Ss3F/L5m7qLDw1jMtIx6bqHbHRiUVm f2TOjSQa/FgDd3IhGVyb+XvzpiR3u+JgOMha94oJLc8P5yFMM47sQttWcaPkMxVYVdKC 2WR/kexrkrava9qb74UB74iNpqVRiQnEBO9EfoQp4Dps0iJYiIcuxKKHbViknMvE0cAP AlNg== X-Forwarded-Encrypted: i=1; AJvYcCVSZ45TzCSP9WZfoOHZ8bnNzjmMjhX25TFRCAlG63g6oApCSuv7OFdLWv7ziz6qUW8wNnrGP5GAp4lFXUQ=@vger.kernel.org X-Gm-Message-State: AOJu0YwjCghZzDXw/PK80WvDHGZQN5VtHP0z3IMLMPx50bReMoG63ts/ jIyYvD0j/8LU6RsoDchEQ8tlApFqPDT/OGm3J0dXHos3hhI4QIYw3lCc7gjv1Von+7zHt301dL2 QNm19aN352F6wWQiU0Q== X-Received: from wmf24.prod.google.com ([2002:a05:600c:2298:b0:483:80e5:6e03]) (user=sidnayyar job=prod-delivery.src-stubby-dispatcher) by 2002:a05:600c:6487:b0:487:1c2:6a4c with SMTP id 5b1f17b1804b1-48727d6790dmr3401815e9.4.1774560326661; Thu, 26 Mar 2026 14:25:26 -0700 (PDT) Date: Thu, 26 Mar 2026 21:25:04 +0000 In-Reply-To: <20260326-kflagstab-v5-0-fa0796fe88d9@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260326-kflagstab-v5-0-fa0796fe88d9@google.com> X-Mailer: b4 0.14.3 Message-ID: <20260326-kflagstab-v5-3-fa0796fe88d9@google.com> Subject: [PATCH v5 3/7] module: populate kflagstab in modpost From: Siddharth Nayyar To: Luis Chamberlain , Petr Pavlu , Daniel Gomez , Sami Tolvanen , Aaron Tomlin , Arnd Bergmann , Nathan Chancellor , Nicolas Schier , Jonathan Corbet , Shuah Khan Cc: linux-modules@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-kbuild@vger.kernel.org, linux-doc@vger.kernel.org, Siddharth Nayyar , maennich@google.com, gprocida@google.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable This patch adds the ability to create entries for kernel symbol flag bitsets in kflagstab. Modpost populates only the GPL-only flag for now. Signed-off-by: Siddharth Nayyar Reviewed-by: Petr Pavlu --- include/linux/export-internal.h | 7 +++++++ scripts/mod/modpost.c | 8 ++++++++ 2 files changed, 15 insertions(+) diff --git a/include/linux/export-internal.h b/include/linux/export-interna= l.h index d445705ac13c..4123c7592404 100644 --- a/include/linux/export-internal.h +++ b/include/linux/export-internal.h @@ -69,4 +69,11 @@ ".long " #crc "\n" \ ".previous" "\n") =20 +#define SYMBOL_FLAGS(sym, flags) \ + asm(" .section \"___kflagstab+" #sym "\",\"a\"" "\n" \ + "__flags_" #sym ":" "\n" \ + " .byte " #flags "\n" \ + " .previous" "\n" \ + ) + #endif /* __LINUX_EXPORT_INTERNAL_H__ */ diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index 0c25b5ad497b..1d721fe67caf 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -244,6 +244,11 @@ static struct symbol *alloc_symbol(const char *name) return s; } =20 +static uint8_t get_symbol_flags(const struct symbol *sym) +{ + return sym->is_gpl_only ? KSYM_FLAG_GPL_ONLY : 0; +} + /* For the hash of exported symbols */ static void hash_add_symbol(struct symbol *sym) { @@ -1874,6 +1879,9 @@ static void add_exported_symbols(struct buffer *buf, = struct module *mod) buf_printf(buf, "KSYMTAB_%s(%s, \"%s\", \"%s\");\n", sym->is_func ? "FUNC" : "DATA", sym->name, sym->is_gpl_only ? "_gpl" : "", sym->namespace); + + buf_printf(buf, "SYMBOL_FLAGS(%s, 0x%02x);\n", + sym->name, get_symbol_flags(sym)); } =20 if (!modversions) --=20 2.53.0.1018.g2bb0e51243-goog From nobody Thu Apr 2 18:59:39 2026 Received: from mail-ed1-f74.google.com (mail-ed1-f74.google.com [209.85.208.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 295783A7836 for ; Thu, 26 Mar 2026 21:25:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.74 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774560335; cv=none; b=h7KMWSM4/B0NtUapkUj62XyBB9vVgeX40QQZLmYsp3p6t35o1GNqgmcG3GqwvDTjJBNl8b5L7MYmN2hiEu4yD78iM3FD2F/7dsbCF5TEFMIvUXkobv1kSOZ0V7XjdgGeX8bwW4sJ6SOvRBTvvlDh8Z6k4eCfyAaw3RCQ8p3JSGg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774560335; c=relaxed/simple; bh=0U9iq2+HUm+aS2vjawKYbXT5f9IrepXKCnDpNX7IFHc=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=D6TpNY6be5wJuXGeNgXjQRh1VY5SYEkmjKG61yHAte+Ma/TTBspFVAvF9ONY/WurHDU0u/Xly314mBh65XbCniKax6EF/I6tDqzDNJRb2GutLzcfswJdcnTd9yS7OCYSEcoXOfb/gbzgaIEj6N7YbrRjRHUGWz+vMcyUgprF9AM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--sidnayyar.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=H+/JvMu0; arc=none smtp.client-ip=209.85.208.74 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--sidnayyar.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="H+/JvMu0" Received: by mail-ed1-f74.google.com with SMTP id 4fb4d7f45d1cf-66a25bf6b9cso276172a12.1 for ; Thu, 26 Mar 2026 14:25:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1774560328; x=1775165128; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=R8X6HsE8awtCdqRwAzXkA4S4JNfAg5Eshe/q3ZQiyww=; b=H+/JvMu0dJ/avCiubvex8rpxyRO1VhW4LQBL8U1uwhYMkc0CUononXMcnNEmCWNsLv e2eBn3OO1UA2cTC6J4q7WVu7gtd+JlubNxN75Ge1NuMe6DYhvZPtg0RdqPyM1WvR1Tms /dTiww1f0YXviBEuW1g7Z8kOoGbFYZx1INkqpjjoGvr5OvCo7xDjvkcLBvFy49ibYgF9 PFGibBUwBRzFrP8+pr7GF/uZDpTRIqOiBGtPlq3RYtUGOn5LOsC5ZZPnSVjCGTOBKAXV U0i6xHUwjyAjPavjaxdguDELDPrbXgeu5Lo4KnschfXx7uGdsEFFyxJpxh2ba1Meubtf xfeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774560328; x=1775165128; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=R8X6HsE8awtCdqRwAzXkA4S4JNfAg5Eshe/q3ZQiyww=; b=f91/jyYryg9dn9aLuB4FirMJfIewb1bIwv1HojA2dlC+xgqnlAN0CeVwp6oMSk7vn1 XddQPZPRzJiDVbOPrnLwP1R3COYYZvibv9fJzaoM6eO4K3NmcCBFI7XHlOYuPZi1d4Bu pXVOfWmqNphiID5JH5mIVP89xwGM1sE9It0PfpI1othqGA64Klyr9kCDAGm8Z3usnyny 0BVy9oCUJrzurXnYCQYeGXO9HDvugNEEl3oEfbTSLX8VKc1fM29zhecXGAPj1BzNeIMk 1vFkSqGlPK4k/navzCYT4eDx4PxmtTqtXYgF+NH3AtYoiM6UPYPNxBK53WNGeK038YCJ 1qUg== X-Forwarded-Encrypted: i=1; AJvYcCXy6KO9Dv6TFMj0ox4YyeXvvm69nib+ZcZzuuBiuOSLhRO3k99P5j1dT2vhh79LgVdn0XqMvzCWug3E8Tg=@vger.kernel.org X-Gm-Message-State: AOJu0YwR3h+Kc2ywxE1poCeacWXhqsa5BAOR7fOqwz7UIIBsvhEy3vOT 2FTBwklGcQNrrs2PMEw80/2kvvPoEOUaGG0Wo0mHrq2HM29/1HthRhTBVLxFJ9Y8D/vNGSPGeDx vYfn1XZbMTeE1pa2pWg== X-Received: from edn23.prod.google.com ([2002:a05:6402:a0d7:b0:668:df50:e7fc]) (user=sidnayyar job=prod-delivery.src-stubby-dispatcher) by 2002:a17:907:e106:b0:b98:5d8:4fcb with SMTP id a640c23a62f3a-b9b507a74b3mr644766b.33.1774560328392; Thu, 26 Mar 2026 14:25:28 -0700 (PDT) Date: Thu, 26 Mar 2026 21:25:05 +0000 In-Reply-To: <20260326-kflagstab-v5-0-fa0796fe88d9@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260326-kflagstab-v5-0-fa0796fe88d9@google.com> X-Mailer: b4 0.14.3 Message-ID: <20260326-kflagstab-v5-4-fa0796fe88d9@google.com> Subject: [PATCH v5 4/7] module: use kflagstab instead of *_gpl sections From: Siddharth Nayyar To: Luis Chamberlain , Petr Pavlu , Daniel Gomez , Sami Tolvanen , Aaron Tomlin , Arnd Bergmann , Nathan Chancellor , Nicolas Schier , Jonathan Corbet , Shuah Khan Cc: linux-modules@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-kbuild@vger.kernel.org, linux-doc@vger.kernel.org, Siddharth Nayyar , maennich@google.com, gprocida@google.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Read kflagstab section for vmlinux and modules to determine whether kernel symbols are GPL only. This patch eliminates the need for fragmenting the ksymtab for infering the value of GPL-only symbol flag, henceforth stop populating *_gpl versions of the ksymtab and kcrctab in modpost. Signed-off-by: Siddharth Nayyar Reviewed-by: Petr Pavlu --- include/linux/export-internal.h | 21 ++++++++-------- include/linux/module.h | 1 + kernel/module/internal.h | 1 + kernel/module/main.c | 55 ++++++++++++++++++++++---------------= ---- scripts/mod/modpost.c | 8 +++--- 5 files changed, 46 insertions(+), 40 deletions(-) diff --git a/include/linux/export-internal.h b/include/linux/export-interna= l.h index 4123c7592404..726054614752 100644 --- a/include/linux/export-internal.h +++ b/include/linux/export-internal.h @@ -37,14 +37,14 @@ * section flag requires it. Use '%progbits' instead of '@progbits' since = the * former apparently works on all arches according to the binutils source. */ -#define __KSYMTAB(name, sym, sec, ns) \ +#define __KSYMTAB(name, sym, ns) \ asm(" .section \"__ksymtab_strings\",\"aMS\",%progbits,1" "\n" \ "__kstrtab_" #name ":" "\n" \ " .asciz \"" #name "\"" "\n" \ "__kstrtabns_" #name ":" "\n" \ " .asciz \"" ns "\"" "\n" \ " .previous" "\n" \ - " .section \"___ksymtab" sec "+" #name "\", \"a\"" "\n" \ + " .section \"___ksymtab+" #name "\", \"a\"" "\n" \ __KSYM_ALIGN "\n" \ "__ksymtab_" #name ":" "\n" \ __KSYM_REF(sym) "\n" \ @@ -59,15 +59,16 @@ #define KSYM_FUNC(name) name #endif =20 -#define KSYMTAB_FUNC(name, sec, ns) __KSYMTAB(name, KSYM_FUNC(name), sec, = ns) -#define KSYMTAB_DATA(name, sec, ns) __KSYMTAB(name, name, sec, ns) +#define KSYMTAB_FUNC(name, ns) __KSYMTAB(name, KSYM_FUNC(name), ns) +#define KSYMTAB_DATA(name, ns) __KSYMTAB(name, name, ns) =20 -#define SYMBOL_CRC(sym, crc, sec) \ - asm(".section \"___kcrctab" sec "+" #sym "\",\"a\"" "\n" \ - ".balign 4" "\n" \ - "__crc_" #sym ":" "\n" \ - ".long " #crc "\n" \ - ".previous" "\n") +#define SYMBOL_CRC(sym, crc) \ + asm(" .section \"___kcrctab+" #sym "\",\"a\"" "\n" \ + " .balign 4" "\n" \ + "__crc_" #sym ":" "\n" \ + " .long " #crc "\n" \ + " .previous" "\n" \ + ) =20 #define SYMBOL_FLAGS(sym, flags) \ asm(" .section \"___kflagstab+" #sym "\",\"a\"" "\n" \ diff --git a/include/linux/module.h b/include/linux/module.h index 14f391b186c6..aee3accba73c 100644 --- a/include/linux/module.h +++ b/include/linux/module.h @@ -418,6 +418,7 @@ struct module { /* Exported symbols */ const struct kernel_symbol *syms; const u32 *crcs; + const u8 *flagstab; unsigned int num_syms; =20 #ifdef CONFIG_ARCH_USES_CFI_TRAPS diff --git a/kernel/module/internal.h b/kernel/module/internal.h index 618202578b42..69b84510e097 100644 --- a/kernel/module/internal.h +++ b/kernel/module/internal.h @@ -57,6 +57,7 @@ extern const struct kernel_symbol __start___ksymtab_gpl[]; extern const struct kernel_symbol __stop___ksymtab_gpl[]; extern const u32 __start___kcrctab[]; extern const u32 __start___kcrctab_gpl[]; +extern const u8 __start___kflagstab[]; =20 #define KMOD_PATH_LEN 256 extern char modprobe_path[]; diff --git a/kernel/module/main.c b/kernel/module/main.c index c3ce106c70af..d237fa4e0737 100644 --- a/kernel/module/main.c +++ b/kernel/module/main.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -87,7 +88,7 @@ struct mod_tree_root mod_tree __cacheline_aligned =3D { struct symsearch { const struct kernel_symbol *start, *stop; const u32 *crcs; - enum mod_license license; + const u8 *flagstab; }; =20 /* @@ -364,19 +365,21 @@ static bool find_exported_symbol_in_section(const str= uct symsearch *syms, struct find_symbol_arg *fsa) { struct kernel_symbol *sym; - - if (!fsa->gplok && syms->license =3D=3D GPL_ONLY) - return false; + u8 sym_flags; =20 sym =3D bsearch(fsa->name, syms->start, syms->stop - syms->start, sizeof(struct kernel_symbol), cmp_name); if (!sym) return false; =20 + sym_flags =3D *(syms->flagstab + (sym - syms->start)); + if (!fsa->gplok && (sym_flags & KSYM_FLAG_GPL_ONLY)) + return false; + fsa->owner =3D owner; fsa->crc =3D symversion(syms->crcs, sym - syms->start); fsa->sym =3D sym; - fsa->license =3D syms->license; + fsa->license =3D (sym_flags & KSYM_FLAG_GPL_ONLY) ? GPL_ONLY : NOT_GPL_ON= LY; =20 return true; } @@ -387,36 +390,31 @@ static bool find_exported_symbol_in_section(const str= uct symsearch *syms, */ bool find_symbol(struct find_symbol_arg *fsa) { - static const struct symsearch arr[] =3D { - { __start___ksymtab, __stop___ksymtab, __start___kcrctab, - NOT_GPL_ONLY }, - { __start___ksymtab_gpl, __stop___ksymtab_gpl, - __start___kcrctab_gpl, - GPL_ONLY }, + const struct symsearch syms =3D { + .start =3D __start___ksymtab, + .stop =3D __stop___ksymtab, + .crcs =3D __start___kcrctab, + .flagstab =3D __start___kflagstab, }; struct module *mod; - unsigned int i; =20 - for (i =3D 0; i < ARRAY_SIZE(arr); i++) - if (find_exported_symbol_in_section(&arr[i], NULL, fsa)) - return true; + if (find_exported_symbol_in_section(&syms, NULL, fsa)) + return true; =20 list_for_each_entry_rcu(mod, &modules, list, lockdep_is_held(&module_mutex)) { - struct symsearch arr[] =3D { - { mod->syms, mod->syms + mod->num_syms, mod->crcs, - NOT_GPL_ONLY }, - { mod->gpl_syms, mod->gpl_syms + mod->num_gpl_syms, - mod->gpl_crcs, - GPL_ONLY }, + const struct symsearch syms =3D { + .start =3D mod->syms, + .stop =3D mod->syms + mod->num_syms, + .crcs =3D mod->crcs, + .flagstab =3D mod->flagstab, }; =20 if (mod->state =3D=3D MODULE_STATE_UNFORMED) continue; =20 - for (i =3D 0; i < ARRAY_SIZE(arr); i++) - if (find_exported_symbol_in_section(&arr[i], mod, fsa)) - return true; + if (find_exported_symbol_in_section(&syms, mod, fsa)) + return true; } =20 pr_debug("Failed to find symbol %s\n", fsa->name); @@ -2614,6 +2612,7 @@ static int find_module_sections(struct module *mod, s= truct load_info *info) sizeof(*mod->gpl_syms), &mod->num_gpl_syms); mod->gpl_crcs =3D section_addr(info, "__kcrctab_gpl"); + mod->flagstab =3D section_addr(info, "__kflagstab"); =20 #ifdef CONFIG_CONSTRUCTORS mod->ctors =3D section_objs(info, ".ctors", @@ -2817,8 +2816,12 @@ static int move_module(struct module *mod, struct lo= ad_info *info) return ret; } =20 -static int check_export_symbol_versions(struct module *mod) +static int check_export_symbol_sections(struct module *mod) { + if (mod->num_syms && !mod->flagstab) { + pr_err("%s: no flags for exported symbols\n", mod->name); + return -ENOEXEC; + } #ifdef CONFIG_MODVERSIONS if ((mod->num_syms && !mod->crcs) || (mod->num_gpl_syms && !mod->gpl_crcs)) { @@ -3434,7 +3437,7 @@ static int load_module(struct load_info *info, const = char __user *uargs, if (err) goto free_unload; =20 - err =3D check_export_symbol_versions(mod); + err =3D check_export_symbol_sections(mod); if (err) goto free_unload; =20 diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index 1d721fe67caf..9d96acce60a8 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -1876,9 +1876,9 @@ static void add_exported_symbols(struct buffer *buf, = struct module *mod) if (trim_unused_exports && !sym->used) continue; =20 - buf_printf(buf, "KSYMTAB_%s(%s, \"%s\", \"%s\");\n", + buf_printf(buf, "KSYMTAB_%s(%s, \"%s\");\n", sym->is_func ? "FUNC" : "DATA", sym->name, - sym->is_gpl_only ? "_gpl" : "", sym->namespace); + sym->namespace); =20 buf_printf(buf, "SYMBOL_FLAGS(%s, 0x%02x);\n", sym->name, get_symbol_flags(sym)); @@ -1899,8 +1899,8 @@ static void add_exported_symbols(struct buffer *buf, = struct module *mod) sym->name, mod->name, mod->is_vmlinux ? "" : ".ko", sym->name); =20 - buf_printf(buf, "SYMBOL_CRC(%s, 0x%08x, \"%s\");\n", - sym->name, sym->crc, sym->is_gpl_only ? "_gpl" : ""); + buf_printf(buf, "SYMBOL_CRC(%s, 0x%08x);\n", + sym->name, sym->crc); } } =20 --=20 2.53.0.1018.g2bb0e51243-goog From nobody Thu Apr 2 18:59:39 2026 Received: from mail-wm1-f73.google.com (mail-wm1-f73.google.com [209.85.128.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 161CC3A7F50 for ; Thu, 26 Mar 2026 21:25:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.73 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774560332; cv=none; b=ZS+JsAdPMdQRZKN0e2R6CykvTfHoEqls2fvsTcdGxP511uwFkq3rkj86LnRSYgCseeyK61LF4lYnisXUTYZuXeVlWkafmGi1Wq2HDYvEv+dp2DEbD/uXxy/X4GYfhFprHwyB+xR5kydqPplUwKhs8tY227tmKUr9lXiVq1799Cw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774560332; c=relaxed/simple; bh=dhaz9oRBN2LrlO9PSGOfI7otVV2KGMDVKhDfQTLvm0g=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=hIkNKB8ZIyA9HdsdhJ3hBKx34ZsulrevX76bUikaZDDon99814VBTKN2TdpUZt/HQLnHo2pHoqqvoqPvHkG5XltgUIOFFMYo3SlbeR8PIUPfcq381QmjqDlOmF2CqP2m6IvZcMydpvWAPk7PPKmkFS0E1yMNkEdQpR4qEBGFczg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--sidnayyar.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=p3tC3AEr; arc=none smtp.client-ip=209.85.128.73 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--sidnayyar.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="p3tC3AEr" Received: by mail-wm1-f73.google.com with SMTP id 5b1f17b1804b1-48532df52c5so13450815e9.1 for ; Thu, 26 Mar 2026 14:25:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1774560330; x=1775165130; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=ZE42C9hekLpveGyF6RMfwZOJjelI4nIxMgNfnUlAiOM=; b=p3tC3AEre5xAVW2LylVKd1EIfy016r3jFDobGF8J/Bqj5+kSmsT0DD9Gxpa0wXveje vgJzL9Q/zPPkbfnrG/RZAk/XqdagAs8+9jG/3LszkBaxWOP07tNnooiIv1F6JvCOkBeh MuR03IxB9awt/9QvS2gxlDgFGzt/miQwVDMVaPTFA3UYXGdUn+ZTaAHpywTRdIQantOV xWv0fcXyDWVAwo7+3BBHgQzJjKNfx2HEIgzZURETPKKiPdb0KTfFldA0RZ2apk69PiuT XQUBE5MULaBYvVwRe8hEjSUhhvb4g1a1NBsrJas2yVnDI9bsXaKCTxKG6Uwrt79SaxTW BYBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774560330; x=1775165130; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ZE42C9hekLpveGyF6RMfwZOJjelI4nIxMgNfnUlAiOM=; b=tMqA4EsQowN8CbDJUeuB1DKoTGgPc6s2naloMJUeKuB5epAHwO6Vu7Zz7azfB1hqVO R+UgOYvOrJ5qlKonTVgePCQH+GIqlIvXqHrkp5yoptqZoGDIx0OowHOizE5QZZ5Ykl+R 3nfmYsZqI57pI/jEUGVycp0i/jf3yjyBpkzurpViY8wKpix3cF9dzwtkerFzuy1GuX7N dtJINuZZMHEAUHuaJarCMV4tCwaLg4IDv7DJzi5cEs/nGpU5jDd/WgttnCllctIto2fG wjOq9O6qR0nIVGST3VqO9juOe3qzuLa67ba9eE8UQA5rR5cAc9ypesOZKY+Z8NVXRsSj wGIw== X-Forwarded-Encrypted: i=1; AJvYcCUnrVxdmnZTZRIHO06nX9+nHdn5sNgaNtNEvAZGwxo62hCFC0202EtjtCnFtcUHGstufUkcjE5Td0z6bKs=@vger.kernel.org X-Gm-Message-State: AOJu0Yw2CU8jKHOQUh0pfNewEroPiKLNKoCNgV/vm2yDkRdOucG0yz6V HQCDGDoWgH0cNvY/ksMZRYh8H5rn9AW0qaNEEu0AKTybyRY9C866T7kI/cTFtr1YyztwuJ/NG5M YGgKZZtJVUsgq6V5spQ== X-Received: from wmga17.prod.google.com ([2002:a05:600c:2d51:b0:485:3a14:a74e]) (user=sidnayyar job=prod-delivery.src-stubby-dispatcher) by 2002:a05:600c:927:b0:485:3dfc:57d with SMTP id 5b1f17b1804b1-48727efab7emr1875075e9.30.1774560329539; Thu, 26 Mar 2026 14:25:29 -0700 (PDT) Date: Thu, 26 Mar 2026 21:25:06 +0000 In-Reply-To: <20260326-kflagstab-v5-0-fa0796fe88d9@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260326-kflagstab-v5-0-fa0796fe88d9@google.com> X-Mailer: b4 0.14.3 Message-ID: <20260326-kflagstab-v5-5-fa0796fe88d9@google.com> Subject: [PATCH v5 5/7] module: deprecate usage of *_gpl sections in module loader From: Siddharth Nayyar To: Luis Chamberlain , Petr Pavlu , Daniel Gomez , Sami Tolvanen , Aaron Tomlin , Arnd Bergmann , Nathan Chancellor , Nicolas Schier , Jonathan Corbet , Shuah Khan Cc: linux-modules@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-kbuild@vger.kernel.org, linux-doc@vger.kernel.org, Siddharth Nayyar , maennich@google.com, gprocida@google.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The *_gpl section are not being used populated by modpost anymore. Hence the module loader doesn't need to find and process these sections in modules. This patch also simplifies symbol finding logic in module loader since *_gpl sections don't have to be searched anymore. Signed-off-by: Siddharth Nayyar Reviewed-by: Petr Pavlu --- include/linux/module.h | 3 --- kernel/module/internal.h | 3 --- kernel/module/main.c | 46 ++++++++++++++++++--------------------------= -- 3 files changed, 18 insertions(+), 34 deletions(-) diff --git a/include/linux/module.h b/include/linux/module.h index aee3accba73c..a0ec1a9f97b4 100644 --- a/include/linux/module.h +++ b/include/linux/module.h @@ -434,9 +434,6 @@ struct module { unsigned int num_kp; =20 /* GPL-only exported symbols. */ - unsigned int num_gpl_syms; - const struct kernel_symbol *gpl_syms; - const u32 *gpl_crcs; bool using_gplonly_symbols; =20 #ifdef CONFIG_MODULE_SIG diff --git a/kernel/module/internal.h b/kernel/module/internal.h index 69b84510e097..061161cc79d9 100644 --- a/kernel/module/internal.h +++ b/kernel/module/internal.h @@ -53,10 +53,7 @@ extern const size_t modinfo_attrs_count; /* Provided by the linker */ extern const struct kernel_symbol __start___ksymtab[]; extern const struct kernel_symbol __stop___ksymtab[]; -extern const struct kernel_symbol __start___ksymtab_gpl[]; -extern const struct kernel_symbol __stop___ksymtab_gpl[]; extern const u32 __start___kcrctab[]; -extern const u32 __start___kcrctab_gpl[]; extern const u8 __start___kflagstab[]; =20 #define KMOD_PATH_LEN 256 diff --git a/kernel/module/main.c b/kernel/module/main.c index d237fa4e0737..189e18b8103d 100644 --- a/kernel/module/main.c +++ b/kernel/module/main.c @@ -1464,29 +1464,17 @@ EXPORT_SYMBOL_GPL(__symbol_get); */ static int verify_exported_symbols(struct module *mod) { - unsigned int i; const struct kernel_symbol *s; - struct { - const struct kernel_symbol *sym; - unsigned int num; - } arr[] =3D { - { mod->syms, mod->num_syms }, - { mod->gpl_syms, mod->num_gpl_syms }, - }; - - for (i =3D 0; i < ARRAY_SIZE(arr); i++) { - for (s =3D arr[i].sym; s < arr[i].sym + arr[i].num; s++) { - struct find_symbol_arg fsa =3D { - .name =3D kernel_symbol_name(s), - .gplok =3D true, - }; - if (find_symbol(&fsa)) { - pr_err("%s: exports duplicate symbol %s" - " (owned by %s)\n", - mod->name, kernel_symbol_name(s), - module_name(fsa.owner)); - return -ENOEXEC; - } + for (s =3D mod->syms; s < mod->syms + mod->num_syms; s++) { + struct find_symbol_arg fsa =3D { + .name =3D kernel_symbol_name(s), + .gplok =3D true, + }; + if (find_symbol(&fsa)) { + pr_err("%s: exports duplicate symbol %s (owned by %s)\n", + mod->name, kernel_symbol_name(s), + module_name(fsa.owner)); + return -ENOEXEC; } } return 0; @@ -2608,12 +2596,15 @@ static int find_module_sections(struct module *mod,= struct load_info *info) mod->syms =3D section_objs(info, "__ksymtab", sizeof(*mod->syms), &mod->num_syms); mod->crcs =3D section_addr(info, "__kcrctab"); - mod->gpl_syms =3D section_objs(info, "__ksymtab_gpl", - sizeof(*mod->gpl_syms), - &mod->num_gpl_syms); - mod->gpl_crcs =3D section_addr(info, "__kcrctab_gpl"); mod->flagstab =3D section_addr(info, "__kflagstab"); =20 + if (section_addr(info, "__ksymtab_gpl")) + pr_warn("%s: ignoring obsolete section __ksymtab_gpl\n", + mod->name); + if (section_addr(info, "__kcrctab_gpl")) + pr_warn("%s: ignoring obsolete section __kcrctab_gpl\n", + mod->name); + #ifdef CONFIG_CONSTRUCTORS mod->ctors =3D section_objs(info, ".ctors", sizeof(*mod->ctors), &mod->num_ctors); @@ -2823,8 +2814,7 @@ static int check_export_symbol_sections(struct module= *mod) return -ENOEXEC; } #ifdef CONFIG_MODVERSIONS - if ((mod->num_syms && !mod->crcs) || - (mod->num_gpl_syms && !mod->gpl_crcs)) { + if (mod->num_syms && !mod->crcs) { return try_to_force_load(mod, "no versions for exported symbols"); } --=20 2.53.0.1018.g2bb0e51243-goog From nobody Thu Apr 2 18:59:39 2026 Received: from mail-wm1-f74.google.com (mail-wm1-f74.google.com [209.85.128.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C60903A872C for ; Thu, 26 Mar 2026 21:25:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.74 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774560335; cv=none; b=rJrLLD5/EAv76rtCzjmcyY6uArVmPdWkJPwBaLjxe+LPTa6hUtaSuaoIbYGTAf1p8yIgw5FLxb0LNCuaSLkZdm1qHj0vBAhKUpb1cWDUzI0JrNu3vxkP5jZl0x5TcbZMj5ufWRjOlgL1tv3uCJ9r1E1aXTKInqMLywoVhsrlv5A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774560335; c=relaxed/simple; bh=YJ12M66JVdOPpUyl/ZnRqsezMQxQSFmDChR9hjNAYhg=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=MXaAvl3j1MsNUt27l9TvoHUjW4YaZmzmwicD3QGmtgOu6IweY/QsA+ZA/zVwGFBQYUvPFwm1zCLin7izsttgd36DNDOLuq0N+vLOMeQYGtJK8Ju63Ad67x941urMCXU8ihJUF2pgjuc0DfWGLd9cSK0/VW0feyJ7YygPF5//kYs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--sidnayyar.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=hrulh1gG; arc=none smtp.client-ip=209.85.128.74 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--sidnayyar.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="hrulh1gG" Received: by mail-wm1-f74.google.com with SMTP id 5b1f17b1804b1-48531e6012bso17517375e9.1 for ; Thu, 26 Mar 2026 14:25:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1774560331; x=1775165131; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=aGYiW8Rqw4kRzbw632ADCfNRFJHG+c2ihwrVrUq2DSI=; b=hrulh1gGqhNnuV8fxCE6id19q2iVakr4ShCWs7LspkNhac3nIFZ7p/VDmTR0B4Urn1 G+7e+a7DM5dnjX9yT8M8dwczz66cIEIQTk41GH0q497fMdtx3UqKa4CwXEk8tnmRQtFx oUdHcb2mEAFTmswhO0/cy89+vNOfbwIGOgna3nbpGweDy+XU4W4HwA9J/WFGFfQUbl+f +OxHzc2ls8TqBFrYOIwLnX6Yum9z0V4hOdDzCBom7AAA9sYX2HgcZ2klSYpUrXIhRRo9 0Rloep76eThZ44MuBVRGXEb1FakMaihGH/BLePmCRZcyZAGhya/ijWmI+CJnbObd/ufs Xbhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774560331; x=1775165131; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=aGYiW8Rqw4kRzbw632ADCfNRFJHG+c2ihwrVrUq2DSI=; b=aiGD+hb4ErzBeCkfMMchVrpGrr3ck1r9IABe0fIuXtZ1ES237tTDCS+wZ32jCPUPJ4 WA8Q5SlnIegfQVg6Qzy85qXA6KknvvcPu4/Lmw4/vWdC9HCmmqLrkX9YMCOPAHO+IXyg O8I2L8eKVVQC4ilZMgGxNXXG6lnBCzQjN6sU6U1MzE23DAxytCpsaf4KW3INeQxUrJeA q7yFpnfsdt7jJXFzek36CblZ4JouEDoDNV/l6p4aQf2X77nRYgG+OeUEM2j0imbeAJtM /yHBjVAXCN3HB5upVH7eIsxQ+0cc0j8/yzLMGZRWhqjjMuVOZKb48z4iGBJNHRiow/Sc uOzg== X-Forwarded-Encrypted: i=1; AJvYcCVaEYeMMzGMHNmMAY6bLmfjNPoln85pRfKw5oiAI//7rap2tqIGTy4EdVTjnxSEFdVKY86cfD/6G8hF0UA=@vger.kernel.org X-Gm-Message-State: AOJu0YwzAr3YNJ2KxjHgy5qs7wBpRj6FfePTzOqFebQs4ks5DQHB6NLO xZ0VaQofllZ30sMR05NK6n/eiTJ7OX7OPkApqSoWaeNMzKcMgXBmogtybUmTvQKxx3Btfl9q+0w F9rj2KaWxoCCjkQBqiA== X-Received: from wmsm27.prod.google.com ([2002:a05:600c:3b1b:b0:485:3b4c:3e34]) (user=sidnayyar job=prod-delivery.src-stubby-dispatcher) by 2002:a05:600c:3b1c:b0:485:6bcc:87dc with SMTP id 5b1f17b1804b1-48727f27c5fmr3066095e9.14.1774560330845; Thu, 26 Mar 2026 14:25:30 -0700 (PDT) Date: Thu, 26 Mar 2026 21:25:07 +0000 In-Reply-To: <20260326-kflagstab-v5-0-fa0796fe88d9@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260326-kflagstab-v5-0-fa0796fe88d9@google.com> X-Mailer: b4 0.14.3 Message-ID: <20260326-kflagstab-v5-6-fa0796fe88d9@google.com> Subject: [PATCH v5 6/7] module: remove *_gpl sections from vmlinux and modules From: Siddharth Nayyar To: Luis Chamberlain , Petr Pavlu , Daniel Gomez , Sami Tolvanen , Aaron Tomlin , Arnd Bergmann , Nathan Chancellor , Nicolas Schier , Jonathan Corbet , Shuah Khan Cc: linux-modules@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-kbuild@vger.kernel.org, linux-doc@vger.kernel.org, Siddharth Nayyar , maennich@google.com, gprocida@google.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable These sections are not used anymore and can be removed from vmlinux and modules during linking. Signed-off-by: Siddharth Nayyar Reviewed-by: Petr Pavlu --- include/asm-generic/vmlinux.lds.h | 18 ++---------------- scripts/module.lds.S | 2 -- 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinu= x.lds.h index d64a475c468a..6f47c4c56574 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -508,34 +508,20 @@ \ PRINTK_INDEX \ \ - /* Kernel symbol table: Normal symbols */ \ + /* Kernel symbol table */ \ __ksymtab : AT(ADDR(__ksymtab) - LOAD_OFFSET) { \ __start___ksymtab =3D .; \ KEEP(*(SORT(___ksymtab+*))) \ __stop___ksymtab =3D .; \ } \ \ - /* Kernel symbol table: GPL-only symbols */ \ - __ksymtab_gpl : AT(ADDR(__ksymtab_gpl) - LOAD_OFFSET) { \ - __start___ksymtab_gpl =3D .; \ - KEEP(*(SORT(___ksymtab_gpl+*))) \ - __stop___ksymtab_gpl =3D .; \ - } \ - \ - /* Kernel symbol table: Normal symbols */ \ + /* Kernel symbol CRC table */ \ __kcrctab : AT(ADDR(__kcrctab) - LOAD_OFFSET) { \ __start___kcrctab =3D .; \ KEEP(*(SORT(___kcrctab+*))) \ __stop___kcrctab =3D .; \ } \ \ - /* Kernel symbol table: GPL-only symbols */ \ - __kcrctab_gpl : AT(ADDR(__kcrctab_gpl) - LOAD_OFFSET) { \ - __start___kcrctab_gpl =3D .; \ - KEEP(*(SORT(___kcrctab_gpl+*))) \ - __stop___kcrctab_gpl =3D .; \ - } \ - \ /* Kernel symbol flags table */ \ __kflagstab : AT(ADDR(__kflagstab) - LOAD_OFFSET) { \ __start___kflagstab =3D .; \ diff --git a/scripts/module.lds.S b/scripts/module.lds.S index d7a8ba278dfc..23fa452eb16d 100644 --- a/scripts/module.lds.S +++ b/scripts/module.lds.S @@ -20,9 +20,7 @@ SECTIONS { } =20 __ksymtab 0 : ALIGN(8) { *(SORT(___ksymtab+*)) } - __ksymtab_gpl 0 : ALIGN(8) { *(SORT(___ksymtab_gpl+*)) } __kcrctab 0 : ALIGN(4) { *(SORT(___kcrctab+*)) } - __kcrctab_gpl 0 : ALIGN(4) { *(SORT(___kcrctab_gpl+*)) } __kflagstab 0 : ALIGN(1) { *(SORT(___kflagstab+*)) } =20 .ctors 0 : ALIGN(8) { *(SORT(.ctors.*)) *(.ctors) } --=20 2.53.0.1018.g2bb0e51243-goog From nobody Thu Apr 2 18:59:39 2026 Received: from mail-wm1-f74.google.com (mail-wm1-f74.google.com [209.85.128.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C61583A8734 for ; Thu, 26 Mar 2026 21:25:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.74 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774560336; cv=none; b=ZgNRord8DA0c4cfYm7bxrkzEvZJ2YTzmGhKdJZa/YBL5EZMBk0ESuCnphDc7+ls5ptDXxCHEG/+1ZejJiea536UOIJANq3ZPIqXC16GTTxZxWeagu3vr/WELn8JvCpB1Xn68DsjmOalZ6MnWy29Pg2aFX5VabMaNLUoDkYzNCsU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774560336; c=relaxed/simple; bh=lUQ7U8VJ/rlQHorgZU+GXUXjuVr+UBXICgrCGqgyAoo=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=DLt/gYCWtZ522Fxxt06y2kfSL5TE1T+Vl8/RaT1XpYu23//j6A0S9uVnIR+VnT47SKDB5uvqclNYi0tZjwqQvvtJ3P1TwNeJOzu3Q0cIz5Rm7ScIwmoAiRcX6zcK193/Msji/0s7HU/9pPd6BS3+9k5/2vqWwYMzWdPAFMpwCY0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--sidnayyar.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=Md/wQu5l; arc=none smtp.client-ip=209.85.128.74 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--sidnayyar.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="Md/wQu5l" Received: by mail-wm1-f74.google.com with SMTP id 5b1f17b1804b1-485c45885e6so12125545e9.0 for ; Thu, 26 Mar 2026 14:25:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1774560332; x=1775165132; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=Ug/Aikg8oXAqlbbl6AzYUeKxZkIdPz7Q+TVSZpI0rDA=; b=Md/wQu5lBGLdZR4ug5+jWwene+rcsKJ5H0kAQuUNr64d5qGj2BYd08QH/4wYRbQZjh C5EuOjzrCA7SzeY3Ec3fCq0118NbHSBeeQCB5Ojq700gXOlYJaUb3jud09W3tS+NMa/t qp2CgKfGVm76ii3CWTSkNTOvEulWUbXTNuTQSPJ/u0Nwp6EjHhomLqlKTuHjz7NJLlng 2GkM4xK5twfnNCsWyEP12q7gYRSMJAigPaJ5zoLbKfZeOnRjWOx/RwPflOfplMGX9HRH 9W729f3dEW0LPIgefyN42KntPMUq/rqJMNOqHmBQcSz0/AB/jSMJvrt9PbwiWA5ocxxs 2h6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774560332; x=1775165132; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Ug/Aikg8oXAqlbbl6AzYUeKxZkIdPz7Q+TVSZpI0rDA=; b=E/q45LUR9VikM0mkhRK3vfo7HbcJEEgeIcmrjZrtYkLp/sBZoSP4zCSxZqJFZtf/q/ 1CNnOVAPnvDFuEauCuimEVHXFtW768AeUqcPOXrHqH6zu9QlimUEUPebsJxjuF2TZ06a yl3McpfzulTR7j7KiUvA1r0pc4fcOQpfkjK6nBOqAp+26JTJTYebNHWW4C35ki664IiB n0tbza+JYChciDhrB87J+8Z4orPrxYpEAxS2yGGNiJD1mq3lOqefb9NdiBkH7dTq/rAA LNl/1BM86j/kPfmbqlkhQC8AXQHs0sR4LKNumGmTmI90EoiL+3DOWeCLBhOxEVmeDzHD Wq9A== X-Forwarded-Encrypted: i=1; AJvYcCVT/em0DDZNpb8K+4MuVx+0GPbaUnH61Dt/YDqBh1UUkTOe9CbKXvmf0XhlMYUABeb+NcuY2rMWvmBLNS8=@vger.kernel.org X-Gm-Message-State: AOJu0YzMWg6l+4kaFwBq7/gMuOiGSBQjLdQhyBfm1AJOpQ6xgqKmlDXQ E7ZiWmmCFm1OrTQcdCiINuOWt2PjyPe0/74vw5W2Bh8K3ng/YWG+DVCrqVZd6WCBFO/Qjggl0V6 uI1zNNryeTSKw1IeBxw== X-Received: from wmsk8-n2.prod.google.com ([2002:a05:600d:8488:20b0:483:6cc0:9daf]) (user=sidnayyar job=prod-delivery.src-stubby-dispatcher) by 2002:a05:600c:1d1e:b0:486:fc95:1a91 with SMTP id 5b1f17b1804b1-48727f2373dmr3081075e9.12.1774560332192; Thu, 26 Mar 2026 14:25:32 -0700 (PDT) Date: Thu, 26 Mar 2026 21:25:08 +0000 In-Reply-To: <20260326-kflagstab-v5-0-fa0796fe88d9@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260326-kflagstab-v5-0-fa0796fe88d9@google.com> X-Mailer: b4 0.14.3 Message-ID: <20260326-kflagstab-v5-7-fa0796fe88d9@google.com> Subject: [PATCH v5 7/7] documentation: remove references to *_gpl sections From: Siddharth Nayyar To: Luis Chamberlain , Petr Pavlu , Daniel Gomez , Sami Tolvanen , Aaron Tomlin , Arnd Bergmann , Nathan Chancellor , Nicolas Schier , Jonathan Corbet , Shuah Khan Cc: linux-modules@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-kbuild@vger.kernel.org, linux-doc@vger.kernel.org, Siddharth Nayyar , maennich@google.com, gprocida@google.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable *_gpl sections are no longer present in the kernel binary. Signed-off-by: Siddharth Nayyar Reviewed-by: Petr Pavlu --- Documentation/kbuild/modules.rst | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Documentation/kbuild/modules.rst b/Documentation/kbuild/module= s.rst index d0703605bfa4..b3a26a36ee17 100644 --- a/Documentation/kbuild/modules.rst +++ b/Documentation/kbuild/modules.rst @@ -426,11 +426,12 @@ Symbols From the Kernel (vmlinux + modules) Version Information Formats --------------------------- =20 - Exported symbols have information stored in __ksymtab or __ksymtab_gpl - sections. Symbol names and namespaces are stored in __ksymtab_strings, - using a format similar to the string table used for ELF. If - CONFIG_MODVERSIONS is enabled, the CRCs corresponding to exported - symbols will be added to the __kcrctab or __kcrctab_gpl. + Exported symbols have information stored in the __ksymtab and + __kflagstab sections. Symbol names and namespaces are stored in + __ksymtab_strings section, using a format similar to the string + table used for ELF. If CONFIG_MODVERSIONS is enabled, the CRCs + corresponding to exported symbols will be added to the + __kcrctab section. =20 If CONFIG_BASIC_MODVERSIONS is enabled (default with CONFIG_MODVERSIONS), imported symbols will have their symbol name and --=20 2.53.0.1018.g2bb0e51243-goog