From nobody Sat Jun 13 11:01:53 2026 Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (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 691B930FC26 for ; Thu, 7 May 2026 20:40:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778186415; cv=none; b=IwHZi0qz6pONbYYtUWTXVWRyHuXriADMsH5xz38vpvku70tkQ5m+A0G+eWlxHTLKe7jZHJ0Z46wTt7SEg1xzgFzK7vLpyc9PoSxJ6LO5Bia3uFDNOBR3Od3MIQFP/uBdSjNX28R0yXAaaCN94Zq3UKq5WJmx81MgOxkLHkuky8w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778186415; c=relaxed/simple; bh=Kdq5NNBpBmf2F409Meltod856ClN2TyEsVnqowPzBrg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=B3RBrlakLTt436OIVQzVwhlJGv0erBYicPVvqq33UQMsr1qIc7nMTfkxXhiO20J/WnLfH5LwDTRhaKemhrJumBuQ06BbMQOYrp0CJrHk2kzSdabvp4S6A6/jLLL1vWrXUMbLbOd3N/9/Kg2CKz3xXqyK+ryOhf6cHIJJp/XXj8U= 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=hQfieDPd; arc=none smtp.client-ip=209.85.128.49 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="hQfieDPd" Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-488b0046078so11145905e9.1 for ; Thu, 07 May 2026 13:40:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1778186412; x=1778791212; 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=X1CnkXYMofkVF0z0P6JiV9z7XyvR/dfwP1bUNpx9s2c=; b=hQfieDPdbO4+r+DGHJszVLwwQEgLLvsh6ZSUHkedKB+x1pqRLJUAiRdy84qmxxvRub HjpyZWdd/YeuSSLTLDxTMzx1ZoefQXRg87hJwMLEZ/3B348HAOCUoRjSex/fUBs93j6Z hbycDhGLi8k80AJNWFIp4ThbDHZqzT63pc8F01taPJjdaVWT7eRXbaz8ifN66cBKwzuP avAjs16wFRSK0eAK5sDrf6Vl119/IaNof156YclBiUBtdsFnqdSKWJy9U4JaMgZAnAHI 841s+gyhfkTuCoWnlB33DrENDjJOM0LIDyvI7Nq+zMkU0bkt4Va3GS7J4boM9OPEz0kA u5Qw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778186412; x=1778791212; 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=X1CnkXYMofkVF0z0P6JiV9z7XyvR/dfwP1bUNpx9s2c=; b=EgvuCyymauTSVfb5iAMwFXtzKht7B/nxYUPHh/ldA9fCfsqK8v4zAVZcBfQRI7KGAg 6ODcPr1FrExKDJA6Yw4ZG89L588rNCRQSOzdB4J3lDlokMtwTvHfz/PwtVZsVnuRr3qU SQ7VMxLMnak9SigaTIHGr5usfcJe/U0h7Tdt6HoK9flvSQYG2/bL2SwjxmL+PK0A8rsY aVgJjm4KmVtFeRLnHXcOEOi/ofqU3E7f4QZJPUKPaHVZtAWbllvxSzA66FBQ1EBHSMAY /srHs1cH4t1PuwQtsXIiEH1c/fAuiR2WbmlmITQA+vcA9lN0m0nuaGYfexjRibxq/Rji 4tFw== X-Forwarded-Encrypted: i=1; AFNElJ93xMKdEphOYIaa/rSEZQEJ35wZeg7GnLIuXTajIoN7E2ABaVODsPNw5LxcLZ8JBRPpEAm2dYQ2gnIPqtE=@vger.kernel.org X-Gm-Message-State: AOJu0Yx3XQMXnY/ZKcoDtHsc5LtadxkbjmROXOSHR0GJxvh23CmooB0B uVhmWP+WlWTZuiWuJtUdkDt+6C9jdNT91/8LJ6sRGueIVF7OReNh0j14 X-Gm-Gg: AeBDieu8dhak6TsPpJOvQdfiHhuYfS5lAR/EV8Ne0/I53EQn671QpJeSbHxwlCw7iGY aE3XBG7T6+gXyIZsq5VhmIXNdk7gpNXrn3iQEAuSOcwg484plzYRh3vTNadJdYBk9XG5x/aMxs0 LR7ZKoHDf9lJsNNTXdaW/hkWB1QVU6r1HaLOT/yBeUtWQwnCF1E3Gomqm3YoluO27orAta+pDLX RC6IfqohWwsGeshOQ7rwDI1kfSbo0dyflQtD7M6r/SjTDc4ov8x/6VVnOe62QVCnbuurj2YHjm9 5j1CKOW4RxgDD4BY0kWiXZjV+BOlg9JH+R6tBNZuHqjwvZATihiXO/Tc5poWyI5CHcOEvkl+G0N Yj3441Q1yB6QvnPI4ORCAm4mc4V8NGq3hpy2L0M+P2j/k3i3Ztu+EnaUQft+aMOn2JMPBiQ3oOj nR+TVWw84x4S/17J+nfeuNnZpC+bKg X-Received: by 2002:a05:600c:8485:b0:48a:76a3:2b9b with SMTP id 5b1f17b1804b1-48e51f32811mr160047405e9.17.1778186411702; Thu, 07 May 2026 13:40:11 -0700 (PDT) Received: from [100.82.231.29] ([185.57.101.106]) by smtp.googlemail.com with ESMTPSA id 5b1f17b1804b1-48e5382a327sm264367515e9.0.2026.05.07.13.40.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 May 2026 13:40:11 -0700 (PDT) From: Jim Cromie Date: Thu, 07 May 2026 14:40:05 -0600 Subject: [PATCH v2 1/5] 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: quoted-printable Message-Id: <20260507-asm-generic-1-v2-1-47c52759d268@gmail.com> References: <20260507-asm-generic-1-v2-0-47c52759d268@gmail.com> In-Reply-To: <20260507-asm-generic-1-v2-0-47c52759d268@gmail.com> To: Arnd Bergmann , Jason Baron , Luis Chamberlain , Petr Pavlu , Daniel Gomez , Sami Tolvanen , Aaron Tomlin Cc: linux-arch@vger.kernel.org, linux-kernel@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=1778186409; l=3982; i=jim.cromie@gmail.com; s=20260203; h=from:subject:message-id; bh=Kdq5NNBpBmf2F409Meltod856ClN2TyEsVnqowPzBrg=; b=Uj4wWShFQLWZ/5Ma1qA7xa/YvM/ZvXLDNQsUAcG/2ldbzAxm0P1oRUXjNlAkvNYqlu1u/vqHt VXbqnLFNSEyDVQQ3CAtSuzcayN9LdymdEoQH429YjHj2kg2xBTTTpSE 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 --- include/asm-generic/bounded_sections.lds.h | 36 ++++++++++++++++++++++++++= ++++ include/asm-generic/vmlinux.lds.h | 30 +------------------------ 2 files changed, 37 insertions(+), 29 deletions(-) diff --git a/include/asm-generic/bounded_sections.lds.h b/include/asm-gener= ic/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_ =3D .; \ + KEEP(*(_sec_)) \ + _END_##_label_ =3D .; + +#define BOUNDED_SECTION_POST_LABEL(_sec_, _label_, _BEGIN_, _END_) \ + _label_##_BEGIN_ =3D .; \ + KEEP(*(_sec_)) \ + _label_##_END_ =3D .; + +#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_ =3D .; \ + KEEP(*(.gnu.linkonce.##_sec_)) \ + BOUNDED_SECTION_PRE_LABEL(_sec_, _label_, _BEGIN_, _END_) + +#define HEADERED_SECTION_POST_LABEL(_sec_, _label_, _BEGIN_, _END_, _HDR_)= \ + _label_##_HDR_ =3D .; \ + 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/vmlinu= x.lds.h index 60c8c22fd3e4..f78300aea8f6 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -211,35 +211,7 @@ # endif #endif =20 -#define BOUNDED_SECTION_PRE_LABEL(_sec_, _label_, _BEGIN_, _END_) \ - _BEGIN_##_label_ =3D .; \ - KEEP(*(_sec_)) \ - _END_##_label_ =3D .; - -#define BOUNDED_SECTION_POST_LABEL(_sec_, _label_, _BEGIN_, _END_) \ - _label_##_BEGIN_ =3D .; \ - KEEP(*(_sec_)) \ - _label_##_END_ =3D .; - -#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_ =3D .; \ - KEEP(*(.gnu.linkonce.##_sec_)) \ - BOUNDED_SECTION_PRE_LABEL(_sec_, _label_, _BEGIN_, _END_) - -#define HEADERED_SECTION_POST_LABEL(_sec_, _label_, _BEGIN_, _END_, _HDR_)= \ - _label_##_HDR_ =3D .; \ - 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) +#include =20 #ifdef CONFIG_TRACE_BRANCH_PROFILING #define LIKELY_PROFILE() \ --=20 2.54.0 From nobody Sat Jun 13 11:01:53 2026 Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) (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 98F6F318EE6 for ; Thu, 7 May 2026 20:40:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778186416; cv=none; b=dRnPfOx6Xkt1eWNOFM5pURcrR6gpx6vr7iBuyOIEnYj/qO3kgKl/HiLU+MEYpHR9csAPGZarjgcsnn4W78LzRLc/yawzpEa+XGM05fiHKB53Jb2Yo5UnJVplAEWZAY9CGny4oNNcDhSGSZJDrmGkg4QkovKHy/Rq08/bJeGF5Ag= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778186416; c=relaxed/simple; bh=gyhl2dDHOhDRfo2EoLm//e3PBy86xHd/L/qSVe14+FQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Z2No95Mq/auBSSuAPpV47QFBj2Tjj6mWYQAaW3dYs9k4iW9BFkATqYQpJxPMaViIzrqYuG8qLQD8ju9U1QjLOorsqRQ/whSd3c7ObXeJP6P4DBOYQxXe6ZNZRwVbbfv/7quLnmh3MLYOlZMVSo2b1qbbdNxOTXOcSBtz5320lAk= 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=JOGsugJX; arc=none smtp.client-ip=209.85.128.42 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="JOGsugJX" Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-48d102471a4so13155635e9.2 for ; Thu, 07 May 2026 13:40:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1778186413; x=1778791213; 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=GsoCp+QEhPQqcC7YciJ1pPB6BZ3pQYi3CKXlL70tQeM=; b=JOGsugJXq6e6VTIZSiJdd+6t8ApBhzYwZQTJ4yl/e7zpQFrG6Pv+gocC9jXnMBBzx0 7TZKHTlJIDu1MyLxlEDbtlQUQB6ldusLPgjpkxvAeKRdKUWQG1fDPek3H8fw8x93qbRk TyFmcHkWrGbO0YPglgGMT3FQWhfJ4aPWJ+QWc1ur5Af7KoX9A/dn/8kg/bJJNuF2b3Nw PCD7lI1X2gEF7eEYcI0KrVAjAjeHh3WfgWCVmaoFhSqH5xVhN55oeNEdiPda8jI/F4gw 3xE6ot7Sy4k4cnbYJ/7IS7cqcP1pr0cAp1/cf+6c6dWyHvJcVw6FyWbXINdzT9J+aMUx mbSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778186413; x=1778791213; 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=GsoCp+QEhPQqcC7YciJ1pPB6BZ3pQYi3CKXlL70tQeM=; b=TetnjE4nQ8MZ7MNWurBCiJ6Tws45HuQa0Tx/stmPPI5I9Euay8RjbOVruTm7F4QWPr tUNlCXZoDRViCXQGtB6frSQCFZe1upKIuOy4qokwq4v1CCwCPnwftO3Ru9OErUuAW71o 0l4BZSkWqLefTYIL1Kq5MnV/v+iVk3BmwQ9v/DLQzRjgqQ+HdqQe43GgW+YtA1LvMqBC bN7I24+vZQ7qX6MJzz2r/De1ABgPnPhFSDi4T9bS2eiBhT3svZE1pCygf80aWBbDlUJP mfoe3i+lArkMICyOVp8s4yDNwaFS99l6PdlUEd3KaLy2O+WxXvFDd0C50499OnuIqxEa gUow== X-Forwarded-Encrypted: i=1; AFNElJ9Myd/1z475Ihwd7ir9QNMAxYkxwYkCrPk7CKNHSY6VGp/PeQgTE4sTHgKGEfqlaZcPsBkDDwr2EwU87og=@vger.kernel.org X-Gm-Message-State: AOJu0YzCJQZWoYKGQSFdGUWjjzUX2RVpjtTXzi7jCRfsqJ7LpDhcNpbA T30w68gyv8l91ZDUz2Ot3j6xBfkkZX6AymHzuTFHd8CyaMXue2+P3f0M X-Gm-Gg: AeBDieuOsKmmaCkLJN8md++S0uDQ927EBGi6ot9A3XaTYeXG0Dj1CaU1M00ZGjfXaaf 7/VMhGs8VXFSjCpllyUTHlVBAwQEcmYMZPFlt9mcbO/tGVsDT4ieUxSDfvaH324U2Un3oR+XQPH pgEi5YVTO6Wrn9W7No22pfTpvP0t52WCic8ET06Xd3VQSqe18LJtWa9ihk1enbl+cPt6SO5XpUX /vcMq9wOL/QgHNMgyGTSoVaJ5T4ZnhiDl4xpdr4AAXr8BJoNZZCQGIzRe0MhOY+J+t8ICX2mDbx BuMOGAbnhy7KSYtBkNNHUnVLa3b+eeURVOT6SlOgVL8J2aMwgQlihQ76c7EQ8aQkXl3RDbjmkTQ 6frd/zx5o1dRHpsI47xf65PSvfjLCjcF/soenDjCGizq7IzK4n0dYMLmyjkoOS91KmQTIV5pyRw Vod/V8CY5XFusGn+CjWk/Mpwc/kqea X-Received: by 2002:a05:600c:4b1a:b0:48e:62ec:f264 with SMTP id 5b1f17b1804b1-48e62ecf39emr25218845e9.17.1778186412677; Thu, 07 May 2026 13:40:12 -0700 (PDT) Received: from [100.82.231.29] ([185.57.101.106]) by smtp.googlemail.com with ESMTPSA id 5b1f17b1804b1-48e5382a327sm264367515e9.0.2026.05.07.13.40.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 May 2026 13:40:12 -0700 (PDT) From: Jim Cromie Date: Thu, 07 May 2026 14:40:06 -0600 Subject: [PATCH v2 2/5] vmlinux.lds.h: drop unused HEADERED_SECTION* macros 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: quoted-printable Message-Id: <20260507-asm-generic-1-v2-2-47c52759d268@gmail.com> References: <20260507-asm-generic-1-v2-0-47c52759d268@gmail.com> In-Reply-To: <20260507-asm-generic-1-v2-0-47c52759d268@gmail.com> To: Arnd Bergmann , Jason Baron , Luis Chamberlain , Petr Pavlu , Daniel Gomez , Sami Tolvanen , Aaron Tomlin Cc: linux-arch@vger.kernel.org, linux-kernel@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=1778186409; l=1428; i=jim.cromie@gmail.com; s=20260203; h=from:subject:message-id; bh=gyhl2dDHOhDRfo2EoLm//e3PBy86xHd/L/qSVe14+FQ=; b=t6utUyvNZn1ZWeXFsFAIGqgojpwWZL9SrREnwncMu0uXb4iRfgx3VSU3T5QwWwhNITGOyPGe3 wvb5yUyUMKYDkqRmNde/XUBB6sSRS0nkvSY0QPGoz86guiANeEAopxR X-Developer-Key: i=jim.cromie@gmail.com; a=ed25519; pk=C6E5ODlPQo7ZBynATXH9wg7K6HxP0pIXyf4s38Qw0XE= These macros are unused, no point in carrying them any more. NB: these macros were just moved to bounded_sections.lds.h, from vmlinux.lds.h, which is the known entity, and therefore more meaningful in the 1-line summary, so thats what I used as the topic. Signed-off-by: Jim Cromie --- include/asm-generic/bounded_sections.lds.h | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/include/asm-generic/bounded_sections.lds.h b/include/asm-gener= ic/bounded_sections.lds.h index 8c29293ca7fb..268cdc34389b 100644 --- a/include/asm-generic/bounded_sections.lds.h +++ b/include/asm-generic/bounded_sections.lds.h @@ -18,19 +18,4 @@ =20 #define BOUNDED_SECTION(_sec) BOUNDED_SECTION_BY(_sec, _sec) =20 -#define HEADERED_SECTION_PRE_LABEL(_sec_, _label_, _BEGIN_, _END_, _HDR_) \ - _HDR_##_label_ =3D .; \ - KEEP(*(.gnu.linkonce.##_sec_)) \ - BOUNDED_SECTION_PRE_LABEL(_sec_, _label_, _BEGIN_, _END_) - -#define HEADERED_SECTION_POST_LABEL(_sec_, _label_, _BEGIN_, _END_, _HDR_)= \ - _label_##_HDR_ =3D .; \ - 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 */ --=20 2.54.0 From nobody Sat Jun 13 11:01:53 2026 Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) (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 368CD31F9AA for ; Thu, 7 May 2026 20:40:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778186417; cv=none; b=cuRlFi+W8tqpYC2IZeUThw624+aLxVO61EUuX0sa6i2mEI4WnttjRqm6gJUaiGNU295HRg+QfGuPjP2U0yaI9odntS2CPJaY0wln5i4he+d6xGzjAo79HZko/1s7g/UiY6GAweNF1A+RsdvflQBjXBGUrVzHmmQvz3730PvkcIs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778186417; c=relaxed/simple; bh=w53HDEgESySdIPfpqzKI102G+UmjiRVHYgmkoAG2z1o=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=sxHg7ymXpXilyavlB0m6VafUhsuJDpR+Llyt0s1bDyFl8oSgm781ls+anKDTsPhtrJD4LxlcZKrsuQJvUCIV+t9fPczSSWMBJ1DirYBKJcR+v0ec5KcXknRO0k+YlYlKMlApP3pONslOv4LRkqm8u3qYaqWtzLiv1vGiBAg533M= 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=O34ACNih; arc=none smtp.client-ip=209.85.128.53 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="O34ACNih" Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-48984d29fe3so15630295e9.0 for ; Thu, 07 May 2026 13:40:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1778186414; x=1778791214; 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=k+93DjYsz56GAfnPLw0kj51QsdMy66v3jRgOgDGePzc=; b=O34ACNihMz4IPYrdx/3RXaUHiMmdzuIxzd7Lg01A67rbir5IPcmZyXbEGQkZ2ZhJRH tWSeUiyA2vV0WP1TpnWo6pbfy/RTyToKGO0yhUwZ0oXU4P2F2IMNUFbd4YlEFzYV5vW3 +HheiR0DEiZcMql/JHWzoaAB+qxxmGSnzg0PaFiz/Bm2nQUiY8EDyDYSz42c57hn3nQX AReueSlt2ZdyeoaCCPdtZ5l69h+1siWQdhN2d8AOrF7dRI28JpO0K2demYpbHvNJ2xCF wWJihp1Z8EpHpOrkYueOLiuGhi4lmnVVLAQxHgJ/lgOypOKdcV2shVWBQmS1OKvbwTRj sr6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778186414; x=1778791214; 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=k+93DjYsz56GAfnPLw0kj51QsdMy66v3jRgOgDGePzc=; b=QyhzpJcpdiQGQwY80DYUSSSO5XUVXoEIzD+i+Zglf+zDjMyFkxudsadCLqmc54uy6i MlDU9rwTb2qwH7csZSBPHo05Lm8h92yv7r29M7Smbz66Tiw+gG4JxkAmornRBmj18/EP SqJg/jrp7BoDW3DCc/xn4dNK7R3ivB4XyiMAXJ52VVBgXmnGDIQ5i5lk8BKIUcGQeggD PKCmyUn6wFEKtoXzxovDQa00PnTDL2fYCfhBl/HV31Jl/5Hd7THspmXRRZz6/N7AkI+0 1W7EjjYAGGr5HUi1iqQgFzB29DXJmHqvrVYxFlur9csrx7kXQwi1pSIoCEtzjSqllwIq PZpg== X-Forwarded-Encrypted: i=1; AFNElJ8KJSHt8GTC5+6g6uHjKTcY+MNWjOKsikmeKD84b/VRogicUOhOxPz3pYZC06kcckCaiwVXf6SCF+GaO4I=@vger.kernel.org X-Gm-Message-State: AOJu0YxWOcxdfFCRXXyu0AV2TS7Y2Cy9TiaeXX+M5yF0nJo8KGBE7lwG Y3XpOCIbm54OX+ydkL9QN1/J9eCjK70TMbzmHUFTsx4GDB7t5H5v8bBB X-Gm-Gg: AeBDietNtTusgeLmigwZ7iu/wjNBvYY4JVFYi+HpYuGbbROHlK3fpTjZlaLvprMARzg ZIdT+faWXsROPhckCgeoCIJRCy0vBcJkd/meRl/k7JYgLdIRnqoLmLeYirAnz4X1RjeRe/4XzVP ujIrqUjr8zNyCK5IIMjdS/YSnjbNXCLkX4J3i9jVkNIL0KIFoVokO7vviidzLjxqtCdczZrZusd ggV8XsVF8ld2wMRjavD9Z0iUn7tvleZ4CapxBa2gZoE0cwS63I8zIRBZEk9xiGQOhDi+IYx6Ev6 OtfIW9gK2l1hgM8bRBp+IjlMZOiXHK3cWtlVvZM4MoOgtXhuN06eTttK4DzFkzVk9R/1XNCD9Hm s1LyksCZzN4R+yWt/IOdFE93KwG/vFGSxv0I/YFowN4h6k4qETT3SMnhKeQRORitBuFmUHnq4kQ Mkz3Le3E20gIv5c7jEQcsDKMrCdspnMlRvEaB3728= X-Received: by 2002:a05:600c:4f0c:b0:488:9fb7:376d with SMTP id 5b1f17b1804b1-48e51f59fc5mr151007445e9.28.1778186413571; Thu, 07 May 2026 13:40:13 -0700 (PDT) Received: from [100.82.231.29] ([185.57.101.106]) by smtp.googlemail.com with ESMTPSA id 5b1f17b1804b1-48e5382a327sm264367515e9.0.2026.05.07.13.40.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 May 2026 13:40:13 -0700 (PDT) From: Jim Cromie Date: Thu, 07 May 2026 14:40:07 -0600 Subject: [PATCH v2 3/5] vmlinux.lds.h: Fix ALIGN(8) omission causing NULL ptr on i386 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: quoted-printable Message-Id: <20260507-asm-generic-1-v2-3-47c52759d268@gmail.com> References: <20260507-asm-generic-1-v2-0-47c52759d268@gmail.com> In-Reply-To: <20260507-asm-generic-1-v2-0-47c52759d268@gmail.com> To: Arnd Bergmann , Jason Baron , Luis Chamberlain , Petr Pavlu , Daniel Gomez , Sami Tolvanen , Aaron Tomlin Cc: linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, linux-modules@vger.kernel.org, Jim Cromie , Louis Chauvet X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1778186409; l=4451; i=jim.cromie@gmail.com; s=20260203; h=from:subject:message-id; bh=w53HDEgESySdIPfpqzKI102G+UmjiRVHYgmkoAG2z1o=; b=jRSS5ScKlTQ6pRNXBqypd33porVG3AuxID0KwFrnH3r9J2naU/yIALxUR2JxeNxc14Cj6nUXq aq9uhMfSd49CorBjCjgpKa4xTh1uBh7TMAxgiXLjWK84zRJwb4eLti7 X-Developer-Key: i=jim.cromie@gmail.com; a=ed25519; pk=C6E5ODlPQo7ZBynATXH9wg7K6HxP0pIXyf4s38Qw0XE= Almost all uses of the BOUNDED_SECTION macros are ALIGN(8), either explicitly, or by being below an aligned section containing x*8 byte objects. The noteworthy exception is BOUNDED_SECTION(__dyndbg), which immediately follows BOUNDED_SECTION(__dyndbg_classes). On i386, struct _ddebug_classmap is 28 bytes, so without an explicit ALIGN(8) in the macro, the following __dyndbg section gets misaligned, causing a NULL ptr deref in dynamic_debug_init(). So fix this with an explicit ALIGN(8) in the existing BOUNDED_SECTION macros, and introduce _ALIGNED variants to handle the cases with an explicit . =3D ALIGN(x) Explicit alignments: EXCEPTION_TABLE, ORC_UNWIND_TABLE update BOUNDED_SECTION uses inside . =3D ALIGN(x) to use _ALIGNED variants, but keep the outer ALIGNs so the symbols between them are not "re-aligned". In particular, scripts/sorttable.c does not tolerate sloppy padding. At the top of ORC_UNWIND_TABLE, add . =3D ALIGN(4) to match the struct orc_header __align() call in the code: commit b9f174c811e3 ("x86/unwind/orc: Add ELF section with ORC version iden= tifier") Suggested-by: Louis Chauvet # _ALIGNED variant= s. Link: https://lore.kernel.org/lkml/177402491426.6181.12855763650074831089.b= 4-review@b4/ Signed-off-by: Jim Cromie --- include/asm-generic/bounded_sections.lds.h | 17 ++++++++++++++--- include/asm-generic/vmlinux.lds.h | 9 +++++---- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/include/asm-generic/bounded_sections.lds.h b/include/asm-gener= ic/bounded_sections.lds.h index 268cdc34389b..8ff3e3420f60 100644 --- a/include/asm-generic/bounded_sections.lds.h +++ b/include/asm-generic/bounded_sections.lds.h @@ -3,19 +3,30 @@ #ifndef _ASM_GENERIC_BOUNDED_SECTIONS_H #define _ASM_GENERIC_BOUNDED_SECTIONS_H =20 -#define BOUNDED_SECTION_PRE_LABEL(_sec_, _label_, _BEGIN_, _END_) \ +#define BOUNDED_SECTION_PRE_LABEL_ALIGNED(_sec_, _label_, _BEGIN_, _END_, = _ALIGNED_) \ + . =3D ALIGN(_ALIGNED_); \ _BEGIN_##_label_ =3D .; \ KEEP(*(_sec_)) \ _END_##_label_ =3D .; =20 -#define BOUNDED_SECTION_POST_LABEL(_sec_, _label_, _BEGIN_, _END_) \ +#define BOUNDED_SECTION_PRE_LABEL(_sec_, _label_, _BEGIN_, _END_) \ + BOUNDED_SECTION_PRE_LABEL_ALIGNED(_sec_, _label_, _BEGIN_, _END_, 8) + +#define BOUNDED_SECTION_POST_LABEL_ALIGNED(_sec_, _label_, _BEGIN_, _END_,= _ALIGNED_) \ + . =3D ALIGN(_ALIGNED_); \ _label_##_BEGIN_ =3D .; \ KEEP(*(_sec_)) \ _label_##_END_ =3D .; =20 +#define BOUNDED_SECTION_POST_LABEL(_sec_, _label_, _BEGIN_, _END_) \ + BOUNDED_SECTION_POST_LABEL_ALIGNED(_sec_, _label_, _BEGIN_, _END_, 8) + #define BOUNDED_SECTION_BY(_sec_, _label_) \ BOUNDED_SECTION_PRE_LABEL(_sec_, _label_, __start, __stop) =20 -#define BOUNDED_SECTION(_sec) BOUNDED_SECTION_BY(_sec, _sec) +#define BOUNDED_SECTION_BY_ALIGNED(_sec_, _label_, _ALIGNED_) \ + BOUNDED_SECTION_PRE_LABEL_ALIGNED(_sec_, _label_, __start, __stop, _ALIGN= ED_) + +#define BOUNDED_SECTION(_sec) BOUNDED_SECTION_BY(_sec, _sec) =20 #endif /* _ASM_GENERIC_BOUNDED_SECTIONS_H */ diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinu= x.lds.h index f78300aea8f6..d3f20b411e16 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -641,7 +641,7 @@ #define EXCEPTION_TABLE(align) \ . =3D ALIGN(align); \ __ex_table : AT(ADDR(__ex_table) - LOAD_OFFSET) { \ - BOUNDED_SECTION_BY(__ex_table, ___ex_table) \ + BOUNDED_SECTION_BY_ALIGNED(__ex_table, ___ex_table, align) \ } =20 /* @@ -833,16 +833,17 @@ =20 #ifdef CONFIG_UNWINDER_ORC #define ORC_UNWIND_TABLE \ + . =3D ALIGN(4); \ .orc_header : AT(ADDR(.orc_header) - LOAD_OFFSET) { \ - BOUNDED_SECTION_BY(.orc_header, _orc_header) \ + BOUNDED_SECTION_BY_ALIGNED(.orc_header, _orc_header, 4) \ } \ . =3D ALIGN(4); \ .orc_unwind_ip : AT(ADDR(.orc_unwind_ip) - LOAD_OFFSET) { \ - BOUNDED_SECTION_BY(.orc_unwind_ip, _orc_unwind_ip) \ + BOUNDED_SECTION_BY_ALIGNED(.orc_unwind_ip, _orc_unwind_ip, 4)\ } \ . =3D ALIGN(2); \ .orc_unwind : AT(ADDR(.orc_unwind) - LOAD_OFFSET) { \ - BOUNDED_SECTION_BY(.orc_unwind, _orc_unwind) \ + BOUNDED_SECTION_BY_ALIGNED(.orc_unwind, _orc_unwind, 2) \ } \ text_size =3D _etext - _stext; \ . =3D ALIGN(4); \ --=20 2.54.0 From nobody Sat Jun 13 11:01:53 2026 Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) (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 B04DC3290A9 for ; Thu, 7 May 2026 20:40:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778186418; cv=none; b=uHDrMsKNKIIQuwNot9Gb0bjaRMusOYyisKH7+jf5dmHKyWlTRbAmlFSYwJPcDzFtnSFgW8JPX6M4bEQP+31MLFPxyiVy9ezQW1na3zyy78APRINJBoIJNZjqoeCGsT3pVTeoKJTGZZE1ba1P+uvbJromR8hKxq3TNTg1E3BtNbc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778186418; c=relaxed/simple; bh=jx+bBZ4Ea0N4OhMqfVeFfhxzER8rbH2ykIENWAaRjuk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=h1LcUKMQ/DybpnLNXq2LXFPbkDbKlUAtKRFL4TsTX7NPJBmT37qJlxH5WJspD8zMCqzREMBXEmMrGW9j0yEZi0g96xn0ZPhJ6i1lf7SAOsOUaM+Ecqd1OAEZ0rQmbu52eUUKasTRhxFtx35C5/AsEm7XhW9c/wuxJJNhqn+1rvU= 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=k6uCvydi; arc=none smtp.client-ip=209.85.128.46 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="k6uCvydi" Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-4891b0786beso9435935e9.1 for ; Thu, 07 May 2026 13:40:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1778186415; x=1778791215; 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=zsRoTlD3yayg24jIZYOgg3Ot8INI+rN2puwSkcqrIrc=; b=k6uCvydirmjonvmr7TkiDi1P90rCzfeVSd88Ac9V6ZibbP8+Ew0VQYDR57BQNTiDBZ JwVj+xV16PfYOTOxqNfnuXP2wcflzIg4pfxh0PjVuzavjUQAuI6Lw/6jBnqGV/VbOmjs PaMeJ6S525xuuBqBZY8vTTfC0Ed/p+ZyISG9PINzuetba31b4+oU/aQ1wvDKRjvYmrRm VhhspDnfdT4MZkoKyE/HW0EA66PHjgib1P7X37rwNsa1hMIv1gdfp6U/iRarYZhTF8z3 2L0F/9iy9VjgtGeCUoOPPI+laCSA0hP3KEKDPMdK/k+KIRkPj9rrg8u7PJQCYLIG/ZFF sU+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778186415; x=1778791215; 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=zsRoTlD3yayg24jIZYOgg3Ot8INI+rN2puwSkcqrIrc=; b=pcO4nqFrg0x4LIV3TFYCJ0eHYXj/vVAMUvkzzx5m3Aw9rE+W/51ufeOK/F7zxS4Paw axBARRYlJ4OFiwVSl42ClXSq5yCniRyKL3vKTN9Pn6uxN0D7Fy/vAojlNy2PYHH/CxCv OHYeDfw1NOuUMuQe/qeomtSlXoEWiGqLEY8hbv0U2qzHdipXF2p46vkZDNXCSh/J+6d4 nHPLifFG9XDhampBgu+Vgp7MaYxIbMWHeBHIAcocw3Fcs3Crv7orb4bayIDYqXfMYF83 SUfDgWxg+zGlwrQuD1wsY7+MTQ7XBVi1diM79QxV2hU92jJvtFaqTcDwmBifyu0Dg5lr 8B5w== X-Forwarded-Encrypted: i=1; AFNElJ+yXyRDtTrdRvXgKR+VBB2mGyrnzpmRMrTEo+I/L+dbNOtFVhlG4drv0VsWuBSWjqiHKFHIwkAYEDftzMQ=@vger.kernel.org X-Gm-Message-State: AOJu0YwDzxTgObEtev+xdoDGWH4ji3EplUVtBNX1wy4jfxx0rX+fgCX4 7R7861mOnfpY7qSDBdfe1n5ZMDY/ZsfKafph3rkfJMFoHfWAr63ap2Zs X-Gm-Gg: AeBDieuAiyUy+6Ry5INzE54cWK0Ond/F+rUTXE+HvnRtCCn9uEvQPm8j9F46tH7HX3K 24707kVuSzAz7uLReKXEWhPQ0yw6qXGKVqY8B3PG+6k9/JaVyw6Yl/CwUXKDD62x/fuFDlolK6l k+3Nf2tnh4JKBAEqOTQx4jwoJYRkrLFThmt0gq31b/D1uQskEspl8fkzQb5vsFxDPFFHExOwMxG ts+F8dD9xyO1YUy1b6mx+o+80OX5C3+0uGYJqMHVLflGXNBWUUDnVj6Te7t6d3Ojlbi753VbSyO A3Oa7NCYRgXM/eq9W5KO8Rj+MFbkMdFNVdD8cC/J9U6x7bmlMzTZGCFKvP46L0Va1kdoD51rHb/ A0Tbg73urp2MSEZx+z9CN5byOqzvUI4+QLitLgqqQbZysMAZVR3bfuiTFBf52Xmf/o1B3UxBPVw 2mVgtHSX2KNP5hV6oYnhIAP9XO8/Oy X-Received: by 2002:a05:600c:4e0c:b0:48d:46a:6e5b with SMTP id 5b1f17b1804b1-48e51e19110mr166556955e9.7.1778186414552; Thu, 07 May 2026 13:40:14 -0700 (PDT) Received: from [100.82.231.29] ([185.57.101.106]) by smtp.googlemail.com with ESMTPSA id 5b1f17b1804b1-48e5382a327sm264367515e9.0.2026.05.07.13.40.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 May 2026 13:40:14 -0700 (PDT) From: Jim Cromie Date: Thu, 07 May 2026 14:40:08 -0600 Subject: [PATCH v2 4/5] vmlinux.lds.h: remove redundant ALIGN(8) directives 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: quoted-printable Message-Id: <20260507-asm-generic-1-v2-4-47c52759d268@gmail.com> References: <20260507-asm-generic-1-v2-0-47c52759d268@gmail.com> In-Reply-To: <20260507-asm-generic-1-v2-0-47c52759d268@gmail.com> To: Arnd Bergmann , Jason Baron , Luis Chamberlain , Petr Pavlu , Daniel Gomez , Sami Tolvanen , Aaron Tomlin Cc: linux-arch@vger.kernel.org, linux-kernel@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=1778186409; l=3579; i=jim.cromie@gmail.com; s=20260203; h=from:subject:message-id; bh=jx+bBZ4Ea0N4OhMqfVeFfhxzER8rbH2ykIENWAaRjuk=; b=pR7CtcOVsz/BJFf7aRw2kJ2a7zTCHIBCb87JxHU2fPGeQjwnzIChkHSJ21YsYHax4e8ojTmtH J00exAM2qTUBTv19Axgq3IS2C8OhHFMt91rHN2t7VrhexpwvfiJFXdg X-Developer-Key: i=jim.cromie@gmail.com; a=ed25519; pk=C6E5ODlPQo7ZBynATXH9wg7K6HxP0pIXyf4s38Qw0XE= The BOUNDED_SECTION_PRE_LABEL and BOUNDED_SECTION_POST_LABEL macros were recently updated to inherently enforce an 8-byte alignment. This makes the explicit '. =3D ALIGN(8);' statements preceding 'naked' macro calls in vmlinux.lds.h redundant. Remove these redundant alignment directives to clean up the file and clarify that the macros handle their own alignment padding. Signed-off-by: Jim Cromie --- include/asm-generic/vmlinux.lds.h | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinu= x.lds.h index d3f20b411e16..d9d2eb708355 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -229,7 +229,6 @@ =20 #ifdef CONFIG_KPROBES #define KPROBE_BLACKLIST() \ - . =3D ALIGN(8); \ BOUNDED_SECTION(_kprobe_blacklist) #else #define KPROBE_BLACKLIST() @@ -245,7 +244,6 @@ =20 #ifdef CONFIG_EVENT_TRACING #define FTRACE_EVENTS() \ - . =3D ALIGN(8); \ BOUNDED_SECTION(_ftrace_events) \ BOUNDED_SECTION_BY(_ftrace_eval_map, _ftrace_eval_maps) #else @@ -262,7 +260,6 @@ =20 #ifdef CONFIG_FTRACE_SYSCALLS #define TRACE_SYSCALLS() \ - . =3D ALIGN(8); \ BOUNDED_SECTION_BY(__syscalls_metadata, _syscalls_metadata) #else #define TRACE_SYSCALLS() @@ -277,7 +274,6 @@ =20 #ifdef CONFIG_SERIAL_EARLYCON #define EARLYCON_TABLE() \ - . =3D ALIGN(8); \ BOUNDED_SECTION_POST_LABEL(__earlycon_table, __earlycon_table, , _end) #else #define EARLYCON_TABLE() @@ -285,11 +281,9 @@ =20 #ifdef CONFIG_SECURITY #define LSM_TABLE() \ - . =3D ALIGN(8); \ BOUNDED_SECTION_PRE_LABEL(.lsm_info.init, _lsm_info, __start, __end) =20 #define EARLY_LSM_TABLE() \ - . =3D ALIGN(8); \ BOUNDED_SECTION_PRE_LABEL(.early_lsm_info.init, _early_lsm_info, __start,= __end) #else #define LSM_TABLE() @@ -315,7 +309,6 @@ =20 #ifdef CONFIG_ACPI #define ACPI_PROBE_TABLE(name) \ - . =3D ALIGN(8); \ BOUNDED_SECTION_POST_LABEL(__##name##_acpi_probe_table, \ __##name##_acpi_probe_table,, _end) #else @@ -324,7 +317,6 @@ =20 #ifdef CONFIG_THERMAL #define THERMAL_TABLE(name) \ - . =3D ALIGN(8); \ BOUNDED_SECTION_POST_LABEL(__##name##_thermal_table, \ __##name##_thermal_table,, _end) #else @@ -404,12 +396,10 @@ __end_init_stack =3D .; =20 #define JUMP_TABLE_DATA \ - . =3D ALIGN(8); \ BOUNDED_SECTION_BY(__jump_table, ___jump_table) =20 #ifdef CONFIG_HAVE_STATIC_CALL_INLINE #define STATIC_CALL_DATA \ - . =3D ALIGN(8); \ BOUNDED_SECTION_BY(.static_call_sites, _static_call_sites) \ BOUNDED_SECTION_BY(.static_call_tramp_key, _static_call_tramp_key) #else @@ -454,7 +444,6 @@ *(.rodata) *(.rodata.*) *(.data.rel.ro*) \ SCHED_DATA \ RO_AFTER_INIT_DATA /* Read only after init */ \ - . =3D ALIGN(8); \ BOUNDED_SECTION_BY(__tracepoints_ptrs, ___tracepoints_ptrs) \ *(__tracepoints_strings)/* Tracepoints: strings */ \ } \ @@ -947,12 +936,10 @@ =20 /* Alignment must be consistent with (kunit_suite *) in include/kunit/test= .h */ #define KUNIT_TABLE() \ - . =3D ALIGN(8); \ BOUNDED_SECTION_POST_LABEL(.kunit_test_suites, __kunit_suites, _start, _= end) =20 /* Alignment must be consistent with (kunit_suite *) in include/kunit/test= .h */ #define KUNIT_INIT_TABLE() \ - . =3D ALIGN(8); \ BOUNDED_SECTION_POST_LABEL(.kunit_init_test_suites, \ __kunit_init_suites, _start, _end) =20 --=20 2.54.0 From nobody Sat Jun 13 11:01:53 2026 Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) (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 3FAB832E126 for ; Thu, 7 May 2026 20:40:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778186419; cv=none; b=Oxt6FrlhPYz+Qq6OGI+OWToLZp4zY/jnArxD3pfK8hiBgQ+Wih24APrjOeZXykJ0F8hYKS3cEszCuOTT8S9V/1wYe3Id/1mIxxkbxG76dA/OKN4UTxqXG8E/3zUamvlTkOKHrTqAe/bboRAZJb9TVHslhienGVbim/I3jkDFFKg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778186419; c=relaxed/simple; bh=LQHJZCxU6Q7ooi37BUaV02Qq/f4agm5h2b+zuvE79OU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Wfq2qXIn/WrSulWGh/XV6VOiFcuuW1y/c7hoTx+cgLhvffM/0GJaHFxj6AwXlhg/VztXDSS9KyxaMGHpv0HJ7QsvJgUC5rh8GfR/VydBFBPS3DYj36Y1X6zYY0C2H2/3ya+Mk89JDC8+optNrvz+g6/ObN5cZOii+T4lhzcfLWs= 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=XWauzlgf; arc=none smtp.client-ip=209.85.128.53 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="XWauzlgf" Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-4891b0786beso9436015e9.1 for ; Thu, 07 May 2026 13:40:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1778186415; x=1778791215; 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=I5Ah0oz6fw0sPiyZmy/m/dxlaFmzyQ2PaO1MKyQmf0U=; b=XWauzlgfzlMVamEYd+xiW2N8oOQrra9fd7OAxtPxr8uSYggHr7kElNcRdHVadAGI/v jP7Jb8UXgtWbjIWuNrqW0QhLl74hcvkyVtDDrRvQJtdpfLlcTj8UGgDc0GX84ju0M04k 5/Ws6vEfSqGhVQcu7QsAx7hmg0ldr/MgsZ0ReeXSSCCGLYp7R8z8+kxw/yxLNTD9XSnL TERLPf+DgUSF3nvI0SmIn2k1c+aAWojON9tO7Mfyp8XVtwAHY6jNt/uhNY7rYbXMJCZC fGSBXF98CUILCF3zCZnSqAcv5BJA+HGxtBYNE0fePLtVMAoFt23h2y1QKIreOZ/mOA6N ms/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778186415; x=1778791215; 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=I5Ah0oz6fw0sPiyZmy/m/dxlaFmzyQ2PaO1MKyQmf0U=; b=MxgY2IjHPgneLpJ/KMEtJpcqsH+tqKuseVOO9WrkEH8b6nvrt8KiJL614DwhwveUCz sgPuxGeZHU7TykMhaUDJoNK6OOe+hDygA4fJH16KSvxpk/SpNQT8FPO76uKVY808NsPw QQvVykr3c8GjqSF5elM8LYA+7p2O9NSrXCOBSamAi4VJWE6mxPBtzaUh1Wf7EbjZTYnJ ZaXsAYymwjOgLv1Hl9S7b67+cq1ov2jndv3k60VmJWzV4I6Yu7L2BIhUymXvSgpMgi+M qHzYrEmQXOMua2ijYr5qO8zA2OCAM1kWjirnXApioywJVWnsQUIitjUAcAUF2MtiuWaq jE0Q== X-Forwarded-Encrypted: i=1; AFNElJ/MNcxWQuL6JHW60shLHOnXMiKRLoFcZyYHkuwOU77LWmjlGFkFJHrhQdSxKCO4FteiiNXL7TEahH0DtWs=@vger.kernel.org X-Gm-Message-State: AOJu0Yy0KH7LNZ2+TUE8tHTreHyokQddheI4gE/1VB3EdlfV9CmqZJ6m eA5UxCvvpJi3+c7BMeWSA/IL3VUDuktFtwTngBOf2oei9UO6ZwWXdKIH X-Gm-Gg: AeBDiev+N1uzOLHwpG2O7PP4pRdXGQG6PV7byKyeGKDaHhagzmUUCpdVeMocwdm+y3Q i/KAd3Gje6EOibUev+Y2+8BAHM11ZcWQCGByrn94NPa72GtZtcxJX7DdEffaxA4lL2pBGrgXr4c HWOBABDhDKNO/hc8y6EGtl484ZwWvm/1eBj1psDijQKTnWcfc4TXaTiCdd49O7CPeU7ePQVRK2d glf7XmwoVInlJMgHD8u+X1iX0O0eo8xGTYuShEQYleoIgw0aPTFkJPWpE5expskq/GVVN/9gwI0 Qy/PATZneNIXwjyBrUeEq9LLAS5ikuTTLtUvoQYx+NUWEKqwPLa3byT1L9va/nyV0HADZF/BPv2 EwCCxqsOphaeuhaxBs9iYkM/e5Hla/XPKvyBYiINXNBdAjUV2DlpWW/ox4gkGvU4/UAUZw0VdsA XUZO3K/OlGb1LfO7nv9s66yBS4mwAW X-Received: by 2002:a05:600c:b8a:b0:48a:5574:3a48 with SMTP id 5b1f17b1804b1-48e51f32bf7mr156015195e9.16.1778186415446; Thu, 07 May 2026 13:40:15 -0700 (PDT) Received: from [100.82.231.29] ([185.57.101.106]) by smtp.googlemail.com with ESMTPSA id 5b1f17b1804b1-48e5382a327sm264367515e9.0.2026.05.07.13.40.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 May 2026 13:40:15 -0700 (PDT) From: Jim Cromie Date: Thu, 07 May 2026 14:40:09 -0600 Subject: [PATCH v2 5/5] dyndbg.lds.S: fix lost dyndbg sections in modules 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: quoted-printable Message-Id: <20260507-asm-generic-1-v2-5-47c52759d268@gmail.com> References: <20260507-asm-generic-1-v2-0-47c52759d268@gmail.com> In-Reply-To: <20260507-asm-generic-1-v2-0-47c52759d268@gmail.com> To: Arnd Bergmann , Jason Baron , Luis Chamberlain , Petr Pavlu , Daniel Gomez , Sami Tolvanen , Aaron Tomlin Cc: linux-arch@vger.kernel.org, linux-kernel@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=1778186409; l=5042; i=jim.cromie@gmail.com; s=20260203; h=from:subject:message-id; bh=LQHJZCxU6Q7ooi37BUaV02Qq/f4agm5h2b+zuvE79OU=; b=mJYphSTpVC76jOzppfFoTvmZdzYnOuVDwN/viBxLujtKCjutc8Sv0WKtsaL6KIwUgcvmeuVcZ piM03q0cm44CiV4/R28PNLheZfLkvtBJes5hv9/L7zlaNtGAgijTU1o X-Developer-Key: i=jim.cromie@gmail.com; a=ed25519; pk=C6E5ODlPQo7ZBynATXH9wg7K6HxP0pIXyf4s38Qw0XE= With CONFIG_DRM_USE_DYNAMIC_DEBUG=3Dy, several build configs had problems with __dyndbg* sections getting lost in drm drivers. Fix this by following the model demonstrated in codetag.lds.h. Introduce include/asm-generic/dyndbg.lds.h, to bundle dynamic-debug's multiple sections together, into 2 macros: vmlinux.lds.h DATA_DATA: move the 2 BOUNDED_SECTION_BY(__dyndbg*) calls into dyndbg.lds.h DYNDBG_SECTIONS(). vmlinux.lds.h now includes the new file and calls the new macro. MOD_DYNDBG_SECTIONS declares the 2 BOUNDED_SECTION_BY calls, but wraps them with output section syntax to keep them as known and separate ELF sections in the module.ko. The KEEP fixes the lost section. dyndbg.lds.h includes (reuses) bounded-section.lds.h scripts/module.lds.S: now calls MOD_DYNDBG_SECTIONS right before the CODETAG macro (consistent with their placements in vmlinux.lds.h), and also includes dyndbg.lds.h This isolates vmlinux.lds.h from further __dyndbg section additions. CC: Arnd Bergmann Signed-off-by: Jim Cromie Reviewed-by: Petr Pavlu --- v2 - Address linker script review feedback for relocatable modules. v1 of MOD_DYNDBG_SECTIONS() used the BOUNDED_SECTION_BY() macro, which proved problematic for kernel modules for two reasons: 1. Unwanted Empty Sections: BOUNDED_SECTION_BY() automatically generates `__start` and `__stop` symbols. When applied to `MOD_DYNDBG_SECTIONS()`, the linker assumes the sections are populated due to the symbol definitions, forcing an empty `__dyndbg` and `__dyndbg_classes` output section in every compiled module, even those without dynamic debug configuration. Since the module loader uses `section_objs()` to locate data via ELF headers instead of relying on `__start`/`__stop` symbols, these assignments are completely unnecessary. 2. Non-zero Output Addresses: During relocatable linking (e.g., `ld.bfd -r`), omitting an explicit base address causes the section to inherit the current location counter. This results in non-zero sh_addr values in `.ko` files, which is confusing, degrades compressibility, and can cause issues with external tools parsing the ELF. Fix both issues by dropping `BOUNDED_SECTION_BY()` in favor of a simple `KEEP(*(...))` constraint and explicitly defining the sections with a `0` base address: `__dyndbg 0 : ALIGN(8) { ... }`. --- MAINTAINERS | 1 + include/asm-generic/dyndbg.lds.h | 19 +++++++++++++++++++ include/asm-generic/vmlinux.lds.h | 6 ++---- scripts/module.lds.S | 2 ++ 4 files changed, 24 insertions(+), 4 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index 882214b0e7db..54bb257b60ee 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -9070,6 +9070,7 @@ DYNAMIC DEBUG M: Jason Baron M: Jim Cromie S: Maintained +F: include/asm-generic/dyndbg.lds.h F: include/linux/dynamic_debug.h F: lib/dynamic_debug.c F: lib/test_dynamic_debug.c diff --git a/include/asm-generic/dyndbg.lds.h b/include/asm-generic/dyndbg.= lds.h new file mode 100644 index 000000000000..844f1cb82020 --- /dev/null +++ b/include/asm-generic/dyndbg.lds.h @@ -0,0 +1,19 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#ifndef __ASM_GENERIC_DYNDBG_LDS_H +#define __ASM_GENERIC_DYNDBG_LDS_H + +#include +#define DYNDBG_SECTIONS() \ + . =3D ALIGN(8); \ + BOUNDED_SECTION_BY(__dyndbg, ___dyndbg) \ + BOUNDED_SECTION_BY(__dyndbg_classes, ___dyndbg_classes) + +#define MOD_DYNDBG_SECTIONS() \ + __dyndbg 0 : ALIGN(8) { \ + KEEP(*(__dyndbg)) \ + } \ + __dyndbg_classes 0 : ALIGN(8) { \ + KEEP(*(__dyndbg_classes)) \ + } + +#endif /* __ASM_GENERIC_DYNDBG_LDS_H */ diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinu= x.lds.h index d9d2eb708355..54897d742c6c 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -332,6 +332,7 @@ /* * .data section */ +#include #define DATA_DATA \ *(.xiptext) \ *(DATA_MAIN) \ @@ -345,10 +346,7 @@ *(.data..do_once) \ STRUCT_ALIGN(); \ *(__tracepoints) \ - /* implement dynamic printk debug */ \ - . =3D ALIGN(8); \ - BOUNDED_SECTION_BY(__dyndbg_classes, ___dyndbg_classes) \ - BOUNDED_SECTION_BY(__dyndbg, ___dyndbg) \ + DYNDBG_SECTIONS() \ CODETAG_SECTIONS() \ LIKELY_PROFILE() \ BRANCH_PROFILE() \ diff --git a/scripts/module.lds.S b/scripts/module.lds.S index b62683061d79..2e62dc5bd5d4 100644 --- a/scripts/module.lds.S +++ b/scripts/module.lds.S @@ -10,6 +10,7 @@ #endif =20 #include +#include =20 SECTIONS { /DISCARD/ : { @@ -61,6 +62,7 @@ SECTIONS { *(.rodata..L*) } =20 + MOD_DYNDBG_SECTIONS() MOD_SEPARATE_CODETAG_SECTIONS() } =20 --=20 2.54.0