From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) (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 0CC983BD64E for ; Tue, 2 Jun 2026 22:48:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780440504; cv=none; b=TTGKBeJQmHexsSCvsvJTr1UlYSwreuB/W6zN5wieZbwVGFL82lK7xewlBMzG958notTc9CQdwCOJ2iVZ6Pu6V7q/v1fSggk6duOaRVSpzUYfKn3HDieySJrkBzcHT0Ce8uRaDFEpsMInqMAzBSG0u8Ni/RZCoR9r+PHW5ryMNqk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780440504; c=relaxed/simple; bh=pg9cpl0bo1AtFElQETrwEKQ1mUnu0drU6Mzj79jx4XY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=JWJ8o3SR/vuly8uk7Lgm7HQFX8giAYDD9juNCGAxsQwU7cQgIf6kj4FU40/b8NHoR5eTMKtCERtn3LWurEm1kCzE6E8xmwzAgd8QMK+1pkqXXYwk7V+nr2R4toogWRzLbC7dHo54acNn29f3mZSAyPvprhIlN6ILU8BPyxfRKKs= 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=JBFMYl0c; arc=none smtp.client-ip=209.85.128.43 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="JBFMYl0c" Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-490b3e03939so416775e9.1 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=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=AgjU2Qt2uFal6066puOiKcG/bH5c3F/sQ7Yrgz0f2yo=; b=JBFMYl0csfWsyVAWBMvOQ+IbPkuhDsGXQrfztSt9iJF2REyqZr4T1EiPEL34fqbH51 ONthIVFW5w44iED8xABZaOBMvANhB++pZFqX4/jsLGIu9FNJ9TdqsEKNWJ7uTng35aBY w9ZhbpOe3bS6VAbDFgJELS4aCexEHd+oKHEkHDf6hxIQo0PAsmb/qWUd4q7IBT98E/PD 5ujv4TAnZa8U9RQosp40dseGaN3Wwgz3z1IXRXIcD3sF7Z+qgOk7TXXCD4hkAK4vV5TN qNvN4fdPaDbbcVbPVC40oaIVK8iBkpA87JYiN5rIgShFtgtTVLT8f4fyCu+ofll8QHiI Ad7w== 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=J+zutNV/LaMhIwTVNiduu5E0Dm+2SClDzXgsunGurUITM0ega411NT4/8IoKVr3lhC yqgeRsvSvP9KqIZYBnhfmSjHh3trzSG3lZW5OrIOM3pqkollQjGH+K7npHPvSQO9Ckxj FfFJkceIgb720g7qOkAIwu1aF5BIJFi5mnHpl4VsuJbCCUSsHpqvkfFA4uJPDk0IgGpg SmchpXVM5wOU0LeYVSYCGc/a+TwE5k41nHhyMmBJqgzz2iTl5IEMiRNZk+sCASZlKOHo uSUD4HF+PafSiF+TfaMKePEdiW6i1rNUPUglEPvgS28YV/JgS4ArFaUL9j89ixhKeQfg i0YA== X-Forwarded-Encrypted: i=1; AFNElJ9YEO9JYEVlxHII+rR9icD4wdULW6GqRzlDOX41bWRNBP0H0qys90Ijv8Ans/rse6efGMJNbiMkSVEgdWw=@vger.kernel.org X-Gm-Message-State: AOJu0Yy/8LWEpSCFOLz4nzSBpIyTrQdKP/LATFHwsIf+pQcAp0hrIj8G Vij61qLIOashbejyCcwTpcD9K/jNVK9u+vWE2T8qlTGq6Yx2sO8Apxqe X-Gm-Gg: Acq92OERCZ6N2883HCqSuvpEnYggCvJIAY6czY4J0LM3j4/mZUZmo5hKa5KnlHVuXU3 HSzfZhVDAqRhKbMnu1swqai0bSOb4YUlaFoMqNlIAMj9x+K2QpiJPA3QyPX6FDXcvpB9CB9Gmsa bRLkrFTLIxHXYlaRmGKcFhuWmNTEeW8Slr633CToDMCIyJsRM8rs58bWxeTl7Birikaw8AaMqnZ HzInnpPjvfAc+xkgppdQAWPUgLL6wPIXoB5TFtXqFN52acN/GgxkbgDMWtyUG6QL6M8m7dgsTzt wSfanw5Osk6aAyhzE/a1Rgi7ON1YvNU751UpFzB+CVgC/nhENHxmN9XFIDN5OzuctLn/J6BcHad CzVGhfC3hOaWuCDYJ5KVav/wEERF5DfVSpxJnzbgf2D0dyA7NUuQjaTv7jlsx0L5iSSqGKyz1eM RRbyxRhXrdFDAD9GESBAAEGLcAG+w0Qio8Pb49Cl1tXA== 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 Precedence: bulk X-Mailing-List: linux-kernel@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: <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= 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