From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oi1-f176.google.com (mail-oi1-f176.google.com [209.85.167.176]) (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 6D2F33AC0FB for ; Wed, 8 Jul 2026 02:18:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.176 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783477109; cv=none; b=js9dijZizWanxbxQwJCCRy11V3lDGzhuiHgvs/2zd3blgEUt7DpztmJnSyu2DHuMLugN2SnhHInCicZJTo+VfPBYscYMU2lcasJFd8iFEXhsFgu3dZ+dL/OJRIgOs4d9HXIejxOpEJbaoNIugO+GsWUQxH/SHbUXy8HVhkCZxl0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783477109; c=relaxed/simple; bh=0NmENmK0/2sRvdDIHaL4q/g343CMSJD/KWi2ZY5I1ss=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=CoMxTapURNUTjFQANPGdvgM48bPeb/PA7IaqWELbwbTB1mUv5B12lwFcF7y+RaFhOpWbJvWocOH/jqEvB0KMhF4GLbNpE5AcMUoVHVGsH/K15gYMgBOPlTuL4GRPLFZC1SWqHWERwqYPLmNkhRaxV5tpQLlu35XwUOMSv4mEJ1k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=chb653We; arc=none smtp.client-ip=209.85.167.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="chb653We" Received: by mail-oi1-f176.google.com with SMTP id 5614622812f47-495b98b4f6aso91668b6e.2 for ; Tue, 07 Jul 2026 19:18:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1783477106; x=1784081906; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=y4NFPrNHM8NGh27YAZAj6cHMKoI1eI/0WdJe3lAHUCg=; b=chb653WeF7ERtPfV88c89axP55atVFNMNC5YeBw0ediRZaLF494Q6mSoentWIFtk7F ONpJ+HA/DhnWo0TXH8HqHgnCR/+OD908Biybo41xfMomdtF5TzJOb2yLyklO+8GEkCCf MmPl7tSm/cCE0tJ2RB2NkQH3EA8yPcnu90IYn5exq9xVZs0i1WdOo66kougbfxHVTjh0 aqbwqGqpetmTHuAk87BAbJIYpzeIsxVq40CFea1jZmYPbfE1hhmZHNas+cMmbL+HRJPd aU4eZbchvotSMA3pNGVVXXVfvFw6WZnQzB7riuOZKsDpX1gzcWwH9fz7Sss51wa7Vro2 hhNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783477106; x=1784081906; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=y4NFPrNHM8NGh27YAZAj6cHMKoI1eI/0WdJe3lAHUCg=; b=KZTL4zaz8HWhtL8P2a1gPOpHiI925nia7GZuQOXSqVz1ha21ob3hHgMrxlFZIx97a1 fYnNmNI1e0o/EbGBgZai9YZas5sMEvP0Fic2v0zbpppbLphbTzLswXPo8fMzlLdqFrCL OdMwRZzzHLw5Pz2SYRODYo9Mi9Bex6ijAq8s/bLGTIwDiwzKyp9BhiQyASKvRAKvPKv6 sxjfXSO4/h2FtA2w0TxrOQD8UqnQ2rG4k7gFbovs97Zw72sE3NMQxnuJkFpOo1aZOHjJ 7ZGSqEFWs7lCiUlYBdet2qa2UL0EW2Z6OZGa9KQCj9caMnYus4fm3ShCDUt9Yc6ECa0X c71Q== X-Forwarded-Encrypted: i=1; AFNElJ+0IVcFA9vYfOE7yepQpkKasAzzigB4l/D7FnwEuTgJWgszhT09bUjomCtqSgxuri90bNlTpqdHVG9eZ2Or@vger.kernel.org X-Gm-Message-State: AOJu0YwQhAWBRk8dkj/p3CPypDUXSRZFk2ErvU0Q7Qvo4CUgcKoAqppc lW+dTO9qgiDpogHUWlXMi+IF0HZldXN0e84249X1ARSntAu61Xk0aaOA X-Gm-Gg: AfdE7clUTdKc1CqBVZ7US529aEWpDXw9ZwIaAj4n8JVCvXz3jH5I8vsnqBQt3XGgrdp 3rHBRfJPgV+3KlmOpTvi1V1VXg/fJmtkHWOW+VAblVDkdM7tIVd5Ze7heEc+bGRVijIiUWS8Lsa XHFMX1ctv6K0/VplMhxYFum241y24blZbtEz22VZmaGOPlQB69hSQIjFHp7Kr4P4T85dTfpYZUA 4ibtfByWQwkQ++NBx+lN1in+LFcZAqdc8Y4bJwk55YM9cDc9Iniy2SdpYEjcgMiR/R+BKOJ4cBc n7a7pKd9UVrwL1iY+phCGSfBbMofln094q6qAQAgAOt3R6V8Jvd2bow24Hg5uAST+i8cy1C+r5c zl+2FEdzx0pjHvBgCFM2TCPWLiaWX5++kdBos/YOvxP+FI3gegL5XLOpJ7pOeN1zTd820AjvYZF Ed8Iha5tWIT1adroBwoVErQMt8L02ibsSiBzqU0XbB81XghAJBbFU= X-Received: by 2002:a05:6808:d52:b0:497:e39e:a002 with SMTP id 5614622812f47-4a204ce54bemr328581b6e.30.1783477106446; Tue, 07 Jul 2026 19:18:26 -0700 (PDT) Received: from [192.168.0.245] (c-98-38-17-99.hsd1.co.comcast.net. [98.38.17.99]) by smtp.googlemail.com with ESMTPSA id 5614622812f47-4a1aa006f74sm799975b6e.0.2026.07.07.19.18.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jul 2026 19:18:25 -0700 (PDT) From: Jim Cromie Date: Tue, 07 Jul 2026 20:18:01 -0600 Subject: [PATCH v6 01/24] vmlinux.lds.h: refactor BOUNDED_SECTION_* macros into bounded_sections.lds.h Precedence: bulk X-Mailing-List: linux-modules@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20260707-dd-maint-2-v6-1-381f3edb0045@gmail.com> References: <20260707-dd-maint-2-v6-0-381f3edb0045@gmail.com> In-Reply-To: <20260707-dd-maint-2-v6-0-381f3edb0045@gmail.com> To: Andrew Morton , Jason Baron , Greg Kroah-Hartman , Jonathan Corbet , Shuah Khan , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Arnd Bergmann , Luis Chamberlain , Petr Pavlu Cc: linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arch@vger.kernel.org, linux-modules@vger.kernel.org, Jim Cromie X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1783477102; l=4249; i=jim.cromie@gmail.com; s=20260203; h=from:subject:message-id; bh=0NmENmK0/2sRvdDIHaL4q/g343CMSJD/KWi2ZY5I1ss=; b=J5qh+4g10P6PxlYU4nAckTFiyCYyWy8E12UFb35F97Nw7iIf6MPXOCAEx5iDTUw+fHx2cU5pf cf9ZNbHSrxBDC+PzcTD/aLHqo1Ed7y4Hj6FhQAs+Z0+HxpF1ROodkbk X-Developer-Key: i=jim.cromie@gmail.com; a=ed25519; pk=C6E5ODlPQo7ZBynATXH9wg7K6HxP0pIXyf4s38Qw0XE= Move BOUNDED_SECTION_* macros to a new helper file: include/asm-generic/bounded_sections.lds.h and include it back into vmlinux.lds.h. This allows its reuse later to fix a failure to keep dyndbg sections in some circumstances. NOTES: These macros are only for use in vmlinux.lds.h, where the _start & _end symbols are needed. Modules keep sections separate in ELF sections, with their boundaries known, so the _start and _end are not useful, and may confuse tools not expecting them. This patch ignores a checkpatch warning, because new file is covered by "GENERIC INCLUDE/ASM HEADER FILES" in MAINTAINERS CC: Arnd Bergmann CC: linux-arch@vger.kernel.org Signed-off-by: Jim Cromie --- v3: move include to top --- include/asm-generic/bounded_sections.lds.h | 36 ++++++++++++++++++++++++++++++ include/asm-generic/vmlinux.lds.h | 31 +------------------------ 2 files changed, 37 insertions(+), 30 deletions(-) diff --git a/include/asm-generic/bounded_sections.lds.h b/include/asm-generic/bounded_sections.lds.h new file mode 100644 index 000000000000..8c29293ca7fb --- /dev/null +++ b/include/asm-generic/bounded_sections.lds.h @@ -0,0 +1,36 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#ifndef _ASM_GENERIC_BOUNDED_SECTIONS_H +#define _ASM_GENERIC_BOUNDED_SECTIONS_H + +#define BOUNDED_SECTION_PRE_LABEL(_sec_, _label_, _BEGIN_, _END_) \ + _BEGIN_##_label_ = .; \ + KEEP(*(_sec_)) \ + _END_##_label_ = .; + +#define BOUNDED_SECTION_POST_LABEL(_sec_, _label_, _BEGIN_, _END_) \ + _label_##_BEGIN_ = .; \ + KEEP(*(_sec_)) \ + _label_##_END_ = .; + +#define BOUNDED_SECTION_BY(_sec_, _label_) \ + BOUNDED_SECTION_PRE_LABEL(_sec_, _label_, __start, __stop) + +#define BOUNDED_SECTION(_sec) BOUNDED_SECTION_BY(_sec, _sec) + +#define HEADERED_SECTION_PRE_LABEL(_sec_, _label_, _BEGIN_, _END_, _HDR_) \ + _HDR_##_label_ = .; \ + KEEP(*(.gnu.linkonce.##_sec_)) \ + BOUNDED_SECTION_PRE_LABEL(_sec_, _label_, _BEGIN_, _END_) + +#define HEADERED_SECTION_POST_LABEL(_sec_, _label_, _BEGIN_, _END_, _HDR_) \ + _label_##_HDR_ = .; \ + KEEP(*(.gnu.linkonce.##_sec_)) \ + BOUNDED_SECTION_POST_LABEL(_sec_, _label_, _BEGIN_, _END_) + +#define HEADERED_SECTION_BY(_sec_, _label_) \ + HEADERED_SECTION_PRE_LABEL(_sec_, _label_, __start, __stop) + +#define HEADERED_SECTION(_sec) HEADERED_SECTION_BY(_sec, _sec) + +#endif /* _ASM_GENERIC_BOUNDED_SECTIONS_H */ diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index 5659f4b5a125..f5ddf31b7f26 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -50,6 +50,7 @@ * [__nosave_begin, __nosave_end] for the nosave data */ +#include #include #ifndef LOAD_OFFSET @@ -211,36 +212,6 @@ # endif #endif -#define BOUNDED_SECTION_PRE_LABEL(_sec_, _label_, _BEGIN_, _END_) \ - _BEGIN_##_label_ = .; \ - KEEP(*(_sec_)) \ - _END_##_label_ = .; - -#define BOUNDED_SECTION_POST_LABEL(_sec_, _label_, _BEGIN_, _END_) \ - _label_##_BEGIN_ = .; \ - KEEP(*(_sec_)) \ - _label_##_END_ = .; - -#define BOUNDED_SECTION_BY(_sec_, _label_) \ - BOUNDED_SECTION_PRE_LABEL(_sec_, _label_, __start, __stop) - -#define BOUNDED_SECTION(_sec) BOUNDED_SECTION_BY(_sec, _sec) - -#define HEADERED_SECTION_PRE_LABEL(_sec_, _label_, _BEGIN_, _END_, _HDR_) \ - _HDR_##_label_ = .; \ - KEEP(*(.gnu.linkonce.##_sec_)) \ - BOUNDED_SECTION_PRE_LABEL(_sec_, _label_, _BEGIN_, _END_) - -#define HEADERED_SECTION_POST_LABEL(_sec_, _label_, _BEGIN_, _END_, _HDR_) \ - _label_##_HDR_ = .; \ - KEEP(*(.gnu.linkonce.##_sec_)) \ - BOUNDED_SECTION_POST_LABEL(_sec_, _label_, _BEGIN_, _END_) - -#define HEADERED_SECTION_BY(_sec_, _label_) \ - HEADERED_SECTION_PRE_LABEL(_sec_, _label_, __start, __stop) - -#define HEADERED_SECTION(_sec) HEADERED_SECTION_BY(_sec, _sec) - #ifdef CONFIG_TRACE_BRANCH_PROFILING #define LIKELY_PROFILE() \ BOUNDED_SECTION_BY(_ftrace_annotated_branch, _annotated_branch_profile) -- 2.55.0