From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 48F3ECD5BD1 for ; Tue, 2 Jun 2026 22:48:22 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A918510F64C; Tue, 2 Jun 2026 22:48:21 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="gScpHOXm"; dkim-atps=neutral Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) by gabe.freedesktop.org (Postfix) with ESMTPS id EC16510F64C for ; Tue, 2 Jun 2026 22:48:20 +0000 (UTC) Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-490686877a1so554905e9.0 for ; Tue, 02 Jun 2026 15:48:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1780440499; x=1781045299; darn=lists.freedesktop.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=AgjU2Qt2uFal6066puOiKcG/bH5c3F/sQ7Yrgz0f2yo=; b=gScpHOXmbMH17LZ/T3ClFKgIKKZQRlYfRBElnSk303dpBVpr3ErJn4Z2gaUZJxKdv1 +K6HwpS3duikeZGs9SzBz6OpkJjnS2b7w6ZEbs9zRQkoUZQaI8Y3cV0UrfnYMdoBA/6G mkXVYPZZc5mDxDDjrrNPHSdTSFgoP7NAmi5mjs7xyswp15eSzb7oxIIGrw0DM11xKl/M rC+n21uiYfFEJ0WLT0/AaINo5xF4pCalHfEEsuVthl41JCjIQ2b/aebZtM9++9YbvJgC ERhpOm60dzsRlMLJM/6ejQcYrra7ug+KPZ2SyKANXTL7D36eMgGfSrIQU4yaCwjBnM6t eJCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780440499; x=1781045299; 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=AgjU2Qt2uFal6066puOiKcG/bH5c3F/sQ7Yrgz0f2yo=; b=S/vUKn93vsVMHvnYEzSfz+fVIkJF7wKhwu1yxXq0bXtLOuxxLR//+7fE5xcSPGEEn4 Q+c0UTANDNsX4jo5EFHAht/F6Ws/LvRpv9zp9pkYdsc3WuTPHTQu1QL/ZNoP/fgM8Dof zotlepyPx4UrdBXdYksV1GTqzz72r3+miEHM6KnBM0jn9LKHLMPnY7MCAZcE0A30FJ15 TO1kS5J4PwDztq0KGH6zlkWQhMSBWcck9kxKQ90yRkJwWbRekCmVy3ahcD5M55QQy4jI 6rKI2Ur3cGyc/ziVbY/n5zXWynr7ABKkGlCer7bpQWYh/f3C7BbQCPltH/jj8xt4hWpm 9B5g== X-Forwarded-Encrypted: i=1; AFNElJ+mHeW75my3TqiIOrdJxNEIkfuz4ruZAR1BOsSczp1gcx7rmS7bFm6SapwnvU5VVU/v+DWHaj52Gl4=@lists.freedesktop.org X-Gm-Message-State: AOJu0YwApR+Xj8DB7vrWHd65XrSnTN8QWVN0/dxIsMmIaYScvuch3973 x4MGKpUmKzK9nv/Q0x1tBb8ILvUlBd9NMjLQHd4OwIl/8BYmaRoTV42w X-Gm-Gg: Acq92OEQdcVJswSFcvucgGhFUYYDYXFesBIkQ8WunGwpiJcQOxGAKNXUS9QV3FxtSbv /mw14n3aQs7qCU1Sv8VlJmsvKrotn5Jv+ZpJPX4vx3p53kD6I9VEFbMpweVmc7ysJsNIbuaNy73 HAAuOn0edM92HIeHPvB4zM3+wRNW+ccW1+4I8fmvciyC1rPsDfauwhpQX6B88l2uHAff/cnj+dw NWnLDUY1VF4aRuqEw/aP2c1MovrCaW9HrgtVihde3Z2vxleBhP/HgSMRKNaa96xT01TkTjCFuCJ rmDgfucv0BChidcdz1OPWm04owGY7acxAOrGzPlsmHQy0Kl5BbNCiJJZLYCkVsZOd7TM039GxXj g4vEr4L9AWeb/V31tELvRU0M1n/lVfBr+79U9zO2Nr+r17QWLddujrpYMdNvvnJRLOBa8EmQx8G +MAbT0ggALXGCnAI4U500hasxyNPNiqW8a5WmZVQbW5g== X-Received: by 2002:a05:600c:3586:b0:490:b080:4835 with SMTP id 5b1f17b1804b1-490b5ed385fmr9521615e9.0.1780440499499; Tue, 02 Jun 2026 15:48:19 -0700 (PDT) Received: from [172.16.188.153] ([213.181.114.83]) by smtp.googlemail.com with ESMTPSA id ffacd0b85a97d-4601f2f2710sm1999791f8f.14.2026.06.02.15.48.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2026 15:48:19 -0700 (PDT) From: Jim Cromie Date: Tue, 02 Jun 2026 22:48:00 +0000 Subject: [PATCH v4 03/25] vmlinux.lds.h: refactor BOUNDED_SECTION_* macros into bounded_sections.lds.h MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20260602-dd-maint-2-v4-3-19a1445585a8@gmail.com> References: <20260602-dd-maint-2-v4-0-19a1445585a8@gmail.com> In-Reply-To: <20260602-dd-maint-2-v4-0-19a1445585a8@gmail.com> To: Jonathan Corbet , Shuah Khan , Arnd Bergmann , Jason Baron , Luis Chamberlain , Petr Pavlu , Daniel Gomez , Sami Tolvanen , Aaron Tomlin , Andrew Morton , Shuah Khan , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-modules@vger.kernel.org, linux-kselftest@vger.kernel.org, dri-devel@lists.freedesktop.org, Jim Cromie X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1780440488; l=4249; i=jim.cromie@gmail.com; s=20260203; h=from:subject:message-id; bh=pg9cpl0bo1AtFElQETrwEKQ1mUnu0drU6Mzj79jx4XY=; b=PCbuEwQZdW6szL958qPtN2q+zMt4zTLcoGfE6vSsy9ddJg9N8GB0rMqs9omnhc5qIM1axWwgb JWqDFwcoyPoBGXBOz9hnvLRwlK/S2RSIVu0TO650z7JAaGNP0niqcfU X-Developer-Key: i=jim.cromie@gmail.com; a=ed25519; pk=C6E5ODlPQo7ZBynATXH9wg7K6HxP0pIXyf4s38Qw0XE= X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 60c8c22fd3e4..9c61dd083f26 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.54.0