From mboxrd@z Thu Jan 1 00:00:00 1970 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 C98AF3DBD5A for ; Thu, 5 Mar 2026 16:54: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=1772729674; cv=none; b=sXiCiiI8AMSqlRdckuDNQLzJaZ1JLQ6yah9eLoDM9OsfKWeqHUJ8fUodPQS1+U20Ja1DlH90UxqydZ3uP0128XVerwc1XHbPNXWvdrySJCfRxzYmqpeWqBr/T383IK0Bv255hQ7pIsRprd6xJfJlaOpavz1lLKrmU53ULAq28hY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772729674; c=relaxed/simple; bh=P86ac5my1fDlI8n2GQxcGL87lpW9m2344uJNQZ3J/J4=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=sFCBdE0VqSu+LdF/V+IhLbxrWFzZ2BMjke0cvtkpki5C7CX25Ht0UKp9k3N6Eh9MFLPqpJEXSGxHWskhCmN3J+e8Oql7d+7ZygAum6xnKg5PRfe54p3ZWrcFMvZ1+Czyr7Rl1fV1K+9lQhmgPWDCoycNTKP7PPI+bpIEn8Y5Tqc= 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=CIC9YsA/; 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="CIC9YsA/" Received: by mail-wm1-f73.google.com with SMTP id 5b1f17b1804b1-48069a43217so83130575e9.1 for ; Thu, 05 Mar 2026 08:54:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1772729670; x=1773334470; 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=DbFvhwKwxof5OBDT/AFQVHeuEBUcV4eoWuedVaHu8Hg=; b=CIC9YsA/S7B74m6EcNsCBGM+3FTucRXi0kJgFe58qZaaPk6P6OpTVNGuLwuwuO7PLY LWtEfrCHamzxiYXBm1Ofpz/KBeQqi+uBNNI+PreXdCLVJvG2+LDyokB1l7a4SRH/hbuZ LAG/1Qnd34hDOye8VTsP7ZrlNmcpC1aZhcN330xTTrxkX2t4TZypQb67PBGGBYx6ae0y hgGAj4PyulvCiISCq7/+MqE8z4cbT4C5/pZxcoQ7O5eOOEcg1Pr7OlzhGVhkjWKyOu3U KT5Zj0kzFm2jEf2u/I33zgCYBkUbZHSyUgEX+bq8PTK1iGm8dqmFDe4N++0F/zPz/2Pk 6lcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772729670; x=1773334470; 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=DbFvhwKwxof5OBDT/AFQVHeuEBUcV4eoWuedVaHu8Hg=; b=ppQWiWxQmJKPt4MTkNSerdA/qbMp4rdd6xTeokmrfckK1gyps6bHGmxyOkWgDTNQnP kmtqJGQKrZJGyA+7Q6ARaNh6qoOyJpPOInyThQxbEL+aA/eDJlJD1FAJhLfHFkhbfGS7 oDXB0hMGB4q4LcI+4BBUS6pl0jEOU3Ub5n+G9vxixRRAat1CWG6Ywl87aPwzy1O506HB u24DcgCplBs5FTuoKUixXft0TZUhLxY66NznIsEYTC2vu1lpE3A3b3lo7ORjz7Uy6tAl LEpvV7OdgdG0FnY1oLtMPSTosgFDwvOxFvXHHr1fUZvBeEMB0/AIdHeLZYth4IHjG3oA vwZw== X-Forwarded-Encrypted: i=1; AJvYcCWBHHu3LV9jWrsdI8yTVxgMNsmiYVjB+vMH7PwJDVDerLgg2lIAwiJJ8FOyrcD1kU90AksTW0VjP3M=@vger.kernel.org X-Gm-Message-State: AOJu0Yy5aTdvfbrMTFbI1DSEY+5n1+YMyc/RNU1gHOmyChVc5PqjFWyQ GGWMALtdDyPVqsIp8GdQkl/Q2UNhoAOe8CeXobvb/vEFwlURZPVzH8CDtjgwE0JoRcSXZT8d4ZX 03eWXzQFCoMORX3cWEg== X-Received: from wmap19.prod.google.com ([2002:a7b:cc93:0:b0:483:26c3:383e]) (user=sidnayyar job=prod-delivery.src-stubby-dispatcher) by 2002:a05:600c:35d6:b0:477:54f9:6ac2 with SMTP id 5b1f17b1804b1-485197d662amr130569275e9.0.1772729670078; Thu, 05 Mar 2026 08:54:30 -0800 (PST) Date: Thu, 05 Mar 2026 16:54:22 +0000 In-Reply-To: <20260305-kflagstab-v4-0-4fe6eea27e30@google.com> Precedence: bulk X-Mailing-List: linux-doc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260305-kflagstab-v4-0-4fe6eea27e30@google.com> X-Mailer: b4 0.14.3 Message-ID: <20260305-kflagstab-v4-2-4fe6eea27e30@google.com> Subject: [PATCH v4 2/8] linker: 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" 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 --- 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/vmlinux.lds.h index eeb070f330bd..8f825dcbfae4 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -536,6 +536,13 @@ __stop___kcrctab_gpl = .; \ } \ \ + /* Kernel symbol flags table */ \ + __kflagstab : AT(ADDR(__kflagstab) - LOAD_OFFSET) { \ + __start___kflagstab = .; \ + KEEP(*(SORT(___kflagstab+*))) \ + __stop___kflagstab = .; \ + } \ + \ /* 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+*)) } .ctors 0 : ALIGN(8) { *(SORT(.ctors.*)) *(.ctors) } .init_array 0 : ALIGN(8) { *(SORT(.init_array.*)) *(.init_array) } -- 2.53.0.473.g4a7958ca14-goog