From nobody Fri Jun 12 11:28:07 2026 Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) (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 99279426EC4 for ; Fri, 15 May 2026 08:58:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778835509; cv=none; b=BAtkE+bovVQD4gSuN5ulk/KUfSN+ZoSp/AsmAZB3X7XwlsN5s4waFPlT3jpbRQfjQ1HjjGMjDW0ouwFAZ47r+Ty8QCQlNfIQ1Fx/cViMAkvTt8JcGqhQphoJo7lD3B9ICQu+yFbYTYPJx9a3patieiOeGC3gVURzPt9n5Loe/yY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778835509; c=relaxed/simple; bh=pg9cpl0bo1AtFElQETrwEKQ1mUnu0drU6Mzj79jx4XY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=MdwgLZtB/w0lAXcMDHeqYccbNtSEvRvdcbyBSMio9k9/R0XduuScWkoyeEnp1QDOm4UDjjdMYcWVIcviSkErVQP3/G8P4beLAvp2yp2PuJypG92FbuWzy9EeBd90GMAefsdSGRRupp/LEL8hT7lojQPaQ8VfmTAUWJr0d+ySJTg= 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=L6tKe9od; arc=none smtp.client-ip=209.85.221.47 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="L6tKe9od" Received: by mail-wr1-f47.google.com with SMTP id ffacd0b85a97d-44b052142e1so4981795f8f.1 for ; Fri, 15 May 2026 01:58:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1778835506; x=1779440306; 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=L6tKe9odUYOe12UFe5Z3atpqr+ybXcHgoHcMBRF1L/sD38/3KOzhCu/8P2WMyieZEo UTfGMQzPgWwmybeuxP8WWJY930PQZtEeyuyfr3lfGxY98WEw7qKeQOV4YA7lCIkEZmgn djWNCDJwYLU9gp5/v/dVzq4GuPw6UZI6W/brmYCle8jYcPBKri/jml0iV5N4yTE3osQA KgcdTHXnE4QY3lB1AtEdm4AzVh1Q6qIAxCnXL5tjGZbkNZ1JVvxsymA8F3ieO0YXiJQK 4Fk46XibwP72XsE4u5/R7sHCl0Nx1F6rAAmgG6OIHj0KDQJeEJQxmi77fW+dolZJZ0Es n80w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778835506; x=1779440306; 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=UCYmurHXKhS0bEi3v6ENw0AKMtTht2m2VG6wqurKXFyrMwsBEWIR1RwgkdqWmEAhrr Rvaq/zJJJ9WWGWtaL+bd/Z2IBuEjCdCcFGFqp0RL1qWGO/CCkZfuHkX/2BjWXIhNU7zr 6pXurtN9RhKdI70F5MUHE5TwPHOo9nXDkwplY1fodlpxfED1vXkCBTERGi2DB0wCQHnm q9lHA2TDW6OvHRTZ2ZaKyZxAnaqS6CBBcLzyYrOoqyV294jUHOXJPUhRRTgOa+j01+qh U9TxEhwzshsRyD5leSCKFyAKvlybrN28r+rhkLYaM4+U6piFtw6IVZpshw687sfchoBL iG6g== X-Forwarded-Encrypted: i=1; AFNElJ8GOrtKD/sdCnIIExuMjLGT/k0hC8UvFnQn28uf8qXfBPjqZ/99cxwceC62iClzFmynXRHCN0ldQPASvY8=@vger.kernel.org X-Gm-Message-State: AOJu0YwBHIkkUcaoA5YP3rj21aKOoMeBSGP4MuqPErwRYVY8i7pkc2S8 JKMep+CEsmfZW2VmNgcyZF2fL841lg4j1d9jAIDumJxfdXaFa6hYhT5+UB18FdHJQDM= X-Gm-Gg: Acq92OHFlJPGZOYk6upy/+kdJ59PTQznvJLyQFHbR0p0Sjo5cDX/k+run46BGrYDehq cUn2gtKJgcJ4dpHUVDEuO7QE2QN/wNpT0/H60TTYq7wr+EcsBi6L7s5exsBQGDqOO+gVADBfNEQ 4P6iFVE5kyxowJksBuRRY+krYG2GMsQF/G3gaSDDNbgQtag5Cr5Dr0j0OsccknsMxNWeg+aHSkO f7wUp7qz+UMSKyeixoQs6gdBbOIsNgt4ZcduIiNQpEGG2bNlbRQ0oyr3L5HGUAjYGEdH+kAzsED X0OE5i8ueD2OaTXU0874J9P5l4LLxcszV7zIfb4JCbYa7oC9fUWrUlgbBVlcs4owJYApKoLkvTj tSg7fAFvnCmLgCS61OLMWfapHrRSfEl/5sOZG+9KG4y/ZCq+4doqMHornUr1z8ECAgq/+M68KMz QyjCOjpi6qUeKLvsalb2UC373H9mJGDqiV X-Received: by 2002:a5d:5889:0:b0:45e:5b92:1e45 with SMTP id ffacd0b85a97d-45e5c60d55dmr3656820f8f.40.1778835505710; Fri, 15 May 2026 01:58:25 -0700 (PDT) Received: from [192.168.1.210] ([2a00:23c8:33b9:3b01:f7b1:b7a0:6254:c325]) by smtp.googlemail.com with ESMTPSA id ffacd0b85a97d-45d9e768c4fsm13142610f8f.8.2026.05.15.01.58.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 May 2026 01:58:24 -0700 (PDT) From: Jim Cromie Date: Fri, 15 May 2026 02:58:10 -0600 Subject: [PATCH v3 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: <20260515-asm-generic-1-v3-1-680b273666d4@gmail.com> References: <20260515-asm-generic-1-v3-0-680b273666d4@gmail.com> In-Reply-To: <20260515-asm-generic-1-v3-0-680b273666d4@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=1778835503; l=4249; i=jim.cromie@gmail.com; s=20260203; h=from:subject:message-id; bh=pg9cpl0bo1AtFElQETrwEKQ1mUnu0drU6Mzj79jx4XY=; b=UDcB0IA+uJ7wRttA1XdEmqAlGqtAr/TYTORh8uXa/ljuE9kcGbu/8l+g4/1/jRM3kY4vjLwSw c7LctSEq/n2DMZO9tKi+XB61IRdc9hFqaSOqyA4G5H31nLX6al8Rt29 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-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..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 */ =20 +#include #include =20 #ifndef LOAD_OFFSET @@ -211,36 +212,6 @@ # 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) - #ifdef CONFIG_TRACE_BRANCH_PROFILING #define LIKELY_PROFILE() \ BOUNDED_SECTION_BY(_ftrace_annotated_branch, _annotated_branch_profile) --=20 2.54.0 From nobody Fri Jun 12 11:28:07 2026 Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) (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 1B301428490 for ; Fri, 15 May 2026 08:58:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778835510; cv=none; b=P2ToFl2NLs9VIRUi4dHo9HlXemCLW8GxoMGE+fVPMfyHhFXpFERPAJACfjyZi0VmFD8BZOF3Rk7M4P6i4OVhAB6GApbLBk2PO6f5EEhAIrJaX4Cq/tvYRyyVbJZn/EzNhFutjvM1KW8j2kvX6naPylDkTd/2BSPoOfzd+ONFBm4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778835510; 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=T04VaXHth4IUb/2XOqYEqLHT8vhQQhdO4YAP9Rq3ioRo6r2Rl12Pmb2hpq2X/PXuzp7cuioH+hP0CIq/Q6AyoqZg2PtPZQvsmeoPTJFhLcGykAzLyRrxYNiIc7TtFlrANzCKLQob4GqnA/fX3ySmYC3wRzjn9bxgUIX14oHZOeM= 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=SE22AeMa; arc=none smtp.client-ip=209.85.128.44 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="SE22AeMa" Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-488e1a8ac40so84533285e9.2 for ; Fri, 15 May 2026 01:58:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1778835507; x=1779440307; 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=SE22AeMa4y0p9G2ebtHOBT6PoM5knccgVfQTg/7dbkzFc/MuTKZUUgNeQlq51wMrec szh73S1rntMT275Hu1JOh/xokhqmIdr3nxE4Y00nHBI24oMB8hWS6WUk8te5u4sRj13X i8NV/Vt1A/D26GBHsQbJz8B/UBj+m2zGj/8PKWEtPzKplS9Ye73xMKBc/Pln5kU2DRrT 4jGVAaGsx81YzU8IlZSfJmdZTXlsZ6UbjGI/V25Ews/lcjAAN3E7oL3pCrnK1Kv1zfEy k/tAzIQFvQhSUDJo6qEqFaOnmitqJTsz2NwFY0gqQpN1eZuDTN7YMLDEFxgywK8Vcror VSug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778835507; x=1779440307; 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=GKZL/d02vwvY0wCGF+WI2U2OU6vj7CUPM2l8bi9+d1Oi5fedFVFr4I9AoVZc/Qmcnb crOwDTr0BucrO0RdAsQrOmSDP9YVEpqaVbMbTwrVF8TcF7xsSlha10YyyoxP0Dj+S4/T nwRpm3wUh+A+7COs5h0EdqNdcy+BL0crxXtCDg0hST3nWflgHZC+6I7hUjof075wZSjE hRTpTBdaXwRC2A8g38mewtClWLkRAXGNP8dc2ysTTgxAUg5g01Ai9xsDAsRpSmFcHUIM bR8T9lSnhjRShojibPDhyr8bTETceB8vK01smzeqn+PG75oLkpw9yrIAG8gatNOiJLur lk3w== X-Forwarded-Encrypted: i=1; AFNElJ/Q4WBjYZGUY1pB+/jC3EUCMya0a6XGL/3J52itRR3KlPZZQg1vdLctbrXlXkPF6Cbfj6CLJlzsFUOrDYw=@vger.kernel.org X-Gm-Message-State: AOJu0YzDHwbr6qRseZ/3XRnCgAhi3nCEIeZO06i/opKsAj3TkLjbCzVn EuUWKStMFhC/9UbkWfA2cJsxNOZ4BupbxeDHv8aeDldI2h3Uq3ZDWTcOR4CCum4XQgM= X-Gm-Gg: Acq92OHFlkb+1Llq9ly5waW2V//owjgj6Ww6lQp0yNLXnxyZZ+bKLkLulKptnkyctHr KsNAXDusIf7DAkzgzIFfss7ow2RNAXYzdcwx4fK0Dgdo8v7sCe6hKXi7GF9xADHl6CZuYq3dRSI VxiWuCnLF2oYRVB+K6PIVHA1X8XWt9bliu5g8YmjztrOgJHiWY0drLeS6X3kZTGx7b0xYjxOlJV 80yEWpd6pFO84KvcdTWVm6Yn+V9PzNfJjnrdEs1amOFc/MLn6xvJWDeZrMkFmjPJFnBgGewFC/U kPLKCa162ST9pz2Sx/HypgMAjHrznAibOlDbomuubCtZ4UzBYvOk6gRSmYkEQvcV/2Y+r95E9tw Mw40mrREtDtES3d7ri5pKwj6xTG9eVr/8pktL0VVd1fLsnWBp0ecLy0RoCDs3UQmKhPORWq/AZW ME+HU1svKeZL6sMEPR23FgiTOAuO0h7h80 X-Received: by 2002:a05:600c:a406:b0:48e:82cc:4d4c with SMTP id 5b1f17b1804b1-48fe6514939mr34162615e9.23.1778835507163; Fri, 15 May 2026 01:58:27 -0700 (PDT) Received: from [192.168.1.210] ([2a00:23c8:33b9:3b01:f7b1:b7a0:6254:c325]) by smtp.googlemail.com with ESMTPSA id ffacd0b85a97d-45d9e768c4fsm13142610f8f.8.2026.05.15.01.58.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 May 2026 01:58:26 -0700 (PDT) From: Jim Cromie Date: Fri, 15 May 2026 02:58:11 -0600 Subject: [PATCH v3 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: <20260515-asm-generic-1-v3-2-680b273666d4@gmail.com> References: <20260515-asm-generic-1-v3-0-680b273666d4@gmail.com> In-Reply-To: <20260515-asm-generic-1-v3-0-680b273666d4@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=1778835503; l=1428; i=jim.cromie@gmail.com; s=20260203; h=from:subject:message-id; bh=gyhl2dDHOhDRfo2EoLm//e3PBy86xHd/L/qSVe14+FQ=; b=L/oP8BWsqawvQgaTIpLI6bJW6/Dgk4EFPfl3GtndwTpLopRn4f5F/IvWmCxuGgLxeV/fs3Zhr YrEnU2EC6gxCMJd+euyuTbKN+TDZyBrca3AEmHlpVirwpvcxkl2/JlW 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 Fri Jun 12 11:28:07 2026 Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) (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 58178426ED0 for ; Fri, 15 May 2026 08:58:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778835512; cv=none; b=X6Bs0dqVwk7n1uZnejekR7uqOryBYnOTTaMKrZBrDePyOPjWjZktzydvhEwm+mDnKzEGtTZRHMF0rdOqt8Yjmgu9y0iG3bZ5sAj+xJEUINpfV5m6mXGSXeJTSA7pFDjiAzn6BqlDXORkEnLlx1Cg5cDqG/h6jJ674adfAUfq5rY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778835512; c=relaxed/simple; bh=5GFT8c6pS8ZPOp8E9e2DvTwZwRrYlvW21YT8WQ/gfj0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=UoiJEqwJjng++6EChhqAaqCiuZ9Ih3t1dA5lpdi66H7JUwL+kULR/rnG5RWZ+htngu6xFQcMM49xRak4x79KQF1dmO5QY0MDtLL7jjY1HSJGZAE5sawp77Z/JmmPfK/uCW/RmHXiZ4RQYlzuwyeutr50OkGZOgB/13tDH4GeFcE= 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=JX4McymA; arc=none smtp.client-ip=209.85.221.52 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="JX4McymA" Received: by mail-wr1-f52.google.com with SMTP id ffacd0b85a97d-44b330c5cc6so6459912f8f.1 for ; Fri, 15 May 2026 01:58:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1778835509; x=1779440309; 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=vyDbCKNB7s28klaeaxcFwFyz+m8AFVwNSzp9KnR1vME=; b=JX4McymAgn46VrLR682iCMPePkKsDXIhHXKP8qBlR01LYyRTGREKSoyFhkt8BlF5UR SZA1Mqe3YD++M3XT8/GSbG/Ca0Fy0AHnmRKTDPNOX8oF1F0F4mq1WYe7TEBEd0ZFVxCG lMcb9vVMGX7e1vW4EhM69svEhl/wAD2PkMuO6+N8pXOOix5o4TJ0GqP4Afs0oTRtQEqS ZfmhLIE4M0Nz3CrxgGNRe9hynrfN1YIOQM1Uki2CHF6mtBRdYmZIrV0gPkmirOF4FLFJ cbmVF7nxresGc+7YVjeeAcDmgsH++dGg6AOlmSXQAY5e11f2NFH6YP1LICCrz6rA3wAZ AyLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778835509; x=1779440309; 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=vyDbCKNB7s28klaeaxcFwFyz+m8AFVwNSzp9KnR1vME=; b=c86nPS44cMLVAPdUdVlp1JamZWvY2UjWASGdepR+LwUzt7J7ZV4MywtEO3GOsJkg8C 25cwzMonJf3of/2NXfaCHdcPpA4LRxx7P5dpbddA8P+kgtSrwuhOHyyCLo1fUOmN0J14 aoMJtht8iHoDVGcfoQuBur+E53UBUipjzOCVV2Hi+T0lhY0CfC4wI4P5ZCESIMaAE87h 5zRxFXeoawnSISwGc+WWLvtLmeGPheEn/k1rw9x9HRjXxafvU9HIWw3s8jqj0aQcmPWL fo5Idi7NOyesrxEOcLRIPiPGuLhujnrpkyVM5ys/xi/3Cdxka9fSUEXJDh/CBHbswv0e 9s8A== X-Forwarded-Encrypted: i=1; AFNElJ/r+mqoCTdpHcoSswYsrtsLv2wol1hnBwPiVHoiQKPISI0hhk3yh33ayzYulmmiUnSveV0UI2FUbJU8zFs=@vger.kernel.org X-Gm-Message-State: AOJu0YzFNKcWv5R+N9reGupLImKv5Wnl2mrTA5BMa8WSx4oJwKzyrlH3 X5qUZCLOuUlA6CqejFO1zAEUTO8FYLyNuQvH7uP1HJLjpOMsR5rsRiIbXy0SfXMNm2M= X-Gm-Gg: Acq92OEyGtxYzSMLJTbnPZ48lKQ5x06umBql77bJV4rdObLhY4nyWqDztAPPCEYQ2vt idiLsl7TE9ZS+QtGhyvZoChY25X2m03kYExLBmIUcSYwGQYa3/dZUx0ByuZyaTHmj22RWPhT9DG gh5PBYaP57sdTpIRklYOvt+yFpT9ebzJhCGLradqQLq1MGw3yB6K+6M5JrVRtJXl6ygCaN3YPnn NNRW5vt7Mtto1Ze8iJXqAnmZwvARWkFBXghF5ha5/UFV7Q2zzMYO6REu2aJ6OdPpIquy7n5+O9g 04H2d7ZJZkSj/IaNBuQLbnLijtXx5YHUzKL//U9M8fvZ2QhD3CZ7QwJxn8PO/7DggZszNmhUB+y tZa0E/eI2CO3u1YoWS8rdItT+bsE/dWR37X6V+0CiJoa71/9V284w6AMcM60BzdaT0Vw8lxdRse jAnRBCb94hOpavEEE45b9fFKTSUuW+Z/53OQ32K4Ilgm8= X-Received: by 2002:a05:6000:1acc:b0:43f:e721:76b8 with SMTP id ffacd0b85a97d-45e5c60a375mr3885216f8f.37.1778835508407; Fri, 15 May 2026 01:58:28 -0700 (PDT) Received: from [192.168.1.210] ([2a00:23c8:33b9:3b01:f7b1:b7a0:6254:c325]) by smtp.googlemail.com with ESMTPSA id ffacd0b85a97d-45d9e768c4fsm13142610f8f.8.2026.05.15.01.58.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 May 2026 01:58:27 -0700 (PDT) From: Jim Cromie Date: Fri, 15 May 2026 02:58:12 -0600 Subject: [PATCH v3 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: <20260515-asm-generic-1-v3-3-680b273666d4@gmail.com> References: <20260515-asm-generic-1-v3-0-680b273666d4@gmail.com> In-Reply-To: <20260515-asm-generic-1-v3-0-680b273666d4@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=1778835503; l=4451; i=jim.cromie@gmail.com; s=20260203; h=from:subject:message-id; bh=5GFT8c6pS8ZPOp8E9e2DvTwZwRrYlvW21YT8WQ/gfj0=; b=5d2E+jRpUIih+m4j+0pG1oniOu01tH5wE30jvuG/P0BgKGNvfuzlCkDhurcRsCPf8NxMTHEkf xRbMptwL/L/CF5XKctmw6hO7cxCWz0Uid/aVRzu0knLxqy1DCIjhhft 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 9c61dd083f26..6892cbec0554 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -640,7 +640,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 /* @@ -832,16 +832,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 Fri Jun 12 11:28:07 2026 Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) (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 A75244266BE for ; Fri, 15 May 2026 08:58:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778835513; cv=none; b=NNlBTXvVlo4crP+UdpJjUdMaP7ktjErjemCueaNx2PFdOdIy79fLV7f15ZA4nozquGoq1HGOiCmZeKW4/R/hujixYTLXy+eXrcx96n6WDTO4EksPoY4usF5TIOO+fW+rukn/s0Jz7zQ+amDaUoC3eOqLdQ/qgM+M3LIbNiuwNBo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778835513; c=relaxed/simple; bh=NSY+wy4a9um1N1lW6bfsaEQo0J9IZ0qw+K4qR7XW5p0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ZWAEohP7gRZjVnHbQZiGjV7nLE0oGCS8f+ip5Adj7Sj61rlzgVR0zH0TxOonCzMomFr6VPY+cBX+1QsFOWKlcRO+fOMKfpnm31uupRfCBoavK/CafUB8Y38/8iNa4jF9uz47myXFDqDkaG/LNTFgqwmXIFZ2N9b87mE0UB9l95Y= 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=BGxeZVJO; arc=none smtp.client-ip=209.85.128.52 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="BGxeZVJO" Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-488a9033b2cso77734345e9.2 for ; Fri, 15 May 2026 01:58:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1778835510; x=1779440310; 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=zeHLaAh47MPke7rCXxz6cz21C0/tHZ4OetnIzHSea3A=; b=BGxeZVJOst0uJxl7qzwFEi8QmH/rGDuPCV0Kq/WCENjY+DKZaqT6eN1DqQfgICSLbw zqXPj1d8PkGDHt7BATKn3y9uCMc9NUcaGdfApF7cQx0Dn90DhmhhnD+GfAbKigbBYS0c 38+XfDWPwEOuVuKH42Iu0AlHzsjvdSOwQccq2sfEIqKxz3VNm2eNYBN8V1iqlbtGSQpE BTvEznOVjL6cebOl8rAnjFlZbCAMNWMHhDl1X0Kv9X473EzJ6qNa7Vh+tPeD0+m/pEQe GIgv1DCToN1L2feVvvT1O+e0s7zfBG+59A13Bgt/5gY7H+047c4mhhWBUCVD90itVGBe WcfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778835510; x=1779440310; 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=zeHLaAh47MPke7rCXxz6cz21C0/tHZ4OetnIzHSea3A=; b=FR8Rji8tpsRqYSrG7YvZy/gSubTu/lVQ7ncOxF99Xt6vyDXFhmwFvvMtf62ufDnhFw MW+VdU48z4xLm6JePpitKbHR17DzapY1x7Fkfc2ougm0Sd4KHLHgiGK0q7vlKI0nxqI5 rYEReb+dkaSWSMaSPEnFLbHvGKrlrPGDN2Z9IWSSSwKKYT6KPrDzLJHDGjlhE5+qQpae EpUZeK+yFskcfglWlglSoxN/eRfbkLiuqplwKY4wlYwfKAzfXYKb+g2G13WvhnqOiyIb qbr3OwQvaNdtyqUShiRJOn+GdRcqhnAF5uz8isoo5TtqGKHOc1WpJh2LdVnS9mJo06kL sBfg== X-Forwarded-Encrypted: i=1; AFNElJ/dwDA0sqYz5IO5TZ6tj1oMVlETsGPgnibwxoii2CrhyTTKLSRQBhWspKUpn1AoooDL3Bs+lWmlT2fFv+c=@vger.kernel.org X-Gm-Message-State: AOJu0YxlzJmZYDwe+goDiM/LVULEZkVUlGV9681jUVL3vRR3whmEzsv/ FnuTCYeiVb820jprCDModrG4zzijJd96ZADDxxhp30bbcLOfl4l3T9fOkd/Idpy7HKE= X-Gm-Gg: Acq92OEkDWj5n4uOwkZMjqO2eRCt3arnqtOmkJtb9Jd7xMuNq5EdiNCS+xbQDBfUr0B ye70jUQDixH0HnKxc7AHrfPx4sns9Ld8qUZ6nZFWZevijz6YFKtWMU0o/3+DKrOSp28EM0pOKBo PwZVH2OkznEqq5oGnBzuZg4EPir5IW1bYGN5Ltz67yVH9VPkPddlwDjoeRDEE2V3XeOaxjDvVrr 1wrIu6vOy0hyfFwakCVfO5GXV1rhySElnN7/EnjAzqA/9lp0r06PaRX6o6UrAUjbUbNarOCm7mr rM+MAswKFplsYalnZ6d5IPkUQO2P5Eae5J2mZrmN0rymYDGPc/c1qcjzD1OJLuEvOsw1KSUfRZb sXb6mg7naNayObHhiIuygVjtWZYI12eSNk16ahCFJr6oCxlYSLJpuAyYcse44el1qGPYQpe2tH9 /OZNW9mBg+III0Yeux6hlraiCYBP6gQ8gP X-Received: by 2002:a05:600c:c10b:b0:489:1c2d:211e with SMTP id 5b1f17b1804b1-48fe5fcdedemr32339345e9.5.1778835509725; Fri, 15 May 2026 01:58:29 -0700 (PDT) Received: from [192.168.1.210] ([2a00:23c8:33b9:3b01:f7b1:b7a0:6254:c325]) by smtp.googlemail.com with ESMTPSA id ffacd0b85a97d-45d9e768c4fsm13142610f8f.8.2026.05.15.01.58.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 May 2026 01:58:28 -0700 (PDT) From: Jim Cromie Date: Fri, 15 May 2026 02:58:13 -0600 Subject: [PATCH v3 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: <20260515-asm-generic-1-v3-4-680b273666d4@gmail.com> References: <20260515-asm-generic-1-v3-0-680b273666d4@gmail.com> In-Reply-To: <20260515-asm-generic-1-v3-0-680b273666d4@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=1778835503; l=3579; i=jim.cromie@gmail.com; s=20260203; h=from:subject:message-id; bh=NSY+wy4a9um1N1lW6bfsaEQo0J9IZ0qw+K4qR7XW5p0=; b=T5nINbZ1a7L72QdYwZrsP6UKr71Z+kVDeZOQlclBvGfVo2BEfioYXOO1wowxHm0J00KlJeTCO s4nXq6z3FrEBomuKcdWxLSPamCzWMamz+PX2PlbmxwS0deHZAyYWUQv 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 6892cbec0554..9fa11baf27d3 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -228,7 +228,6 @@ =20 #ifdef CONFIG_KPROBES #define KPROBE_BLACKLIST() \ - . =3D ALIGN(8); \ BOUNDED_SECTION(_kprobe_blacklist) #else #define KPROBE_BLACKLIST() @@ -244,7 +243,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 @@ -261,7 +259,6 @@ =20 #ifdef CONFIG_FTRACE_SYSCALLS #define TRACE_SYSCALLS() \ - . =3D ALIGN(8); \ BOUNDED_SECTION_BY(__syscalls_metadata, _syscalls_metadata) #else #define TRACE_SYSCALLS() @@ -276,7 +273,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() @@ -284,11 +280,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() @@ -314,7 +308,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 @@ -323,7 +316,6 @@ =20 #ifdef CONFIG_THERMAL #define THERMAL_TABLE(name) \ - . =3D ALIGN(8); \ BOUNDED_SECTION_POST_LABEL(__##name##_thermal_table, \ __##name##_thermal_table,, _end) #else @@ -403,12 +395,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 @@ -453,7 +443,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 */ \ } \ @@ -946,12 +935,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 Fri Jun 12 11:28:07 2026 Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) (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 6EB8942B743 for ; Fri, 15 May 2026 08:58:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778835516; cv=none; b=uucoz46bCdJeOIJrt3KbQzXcVYTgmBHmExhV9xDykXR3R4/Ovi9+mm/L4Gy2hlrn3m0z7nMs5PfVhMHVKAn4SZCSoyxqlRM9p5qRSdp+PRM+qHxxZgTVToxEo8wzBhxVpggmDukWrMEBbM9JnagxkrOBfwyvoRN2FCPceVW96Go= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778835516; c=relaxed/simple; bh=kUSow6akBfhQlY1Zb90I/sAp9Gjz8mVUGJE3qqGhnlg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=JTaLpviobTDnXcOLqHVQ3xTOrsU7jj7hQ7LfXKsCh2MAOo/bvq/LgYt8X6dVDfrjjMy0/a9FAV/bGb/LlLzP0PfenFZzA4cS6SdTnkbYyblw6csUqagEr+ekaxdD/IOVhi6UKILGR3EHDCgFBllc6hlt1DMS8X5iUMyJw0Q0peo= 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=h3bvVlQO; arc=none smtp.client-ip=209.85.221.45 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="h3bvVlQO" Received: by mail-wr1-f45.google.com with SMTP id ffacd0b85a97d-44e1860558fso5745357f8f.0 for ; Fri, 15 May 2026 01:58:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1778835511; x=1779440311; 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=SGQvnLQVKY/YqzA8GEWJP9yasc16ZREqdYGYIRZWIfE=; b=h3bvVlQOG7Eg24Qod0XJBa+rpaZWwbEa198EXRNoyuXgmzKNA1xmXb3snNuQilLSqm iNLNXVxUP7VZPWIdsQXaF6KqGysFwMBuBu+rgpi0Q3aQ0xM+67HFsJVIQtS756LpK52H Ygw2HlhCseQ8bcV6JPcYdjjhcRZa8mQYxzFKNAmJfICseQ43QYrgC/6RHK1oq3lyNsrn cXV/KBL6y2pQPrfEinzvz2xqUGvcKiXvErhYGCxODtbR4runMVC2O7jAnRfrXL+COAXi iDf874eDL6i8U6sD8G+3rj0RY/6eMYPTqCvBzD06ET33MWUTT/ODLuV/gRLpabISKxw9 Gc8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778835511; x=1779440311; 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=SGQvnLQVKY/YqzA8GEWJP9yasc16ZREqdYGYIRZWIfE=; b=ZY4Yv/YWF/O6GRLKt0EUolNZ3neduC+Kzj9CO0V1wwfHTrWDvst+8cFm197RV5cITS dq7P0WLYxjFjRRACDcwH/eqE9MwoOqjkVFnt5dU0gf++iVyzRFAGdeyWQ7IJQrNeYLly K0dRARGTwTtKJCpZBJ/kKsj+KKznKF1vNfTH+FEJ3YLEXWITZMCXP6hmhIaBYvCcyTdI 7NnW/r+/UdNrgTHqTVHrmQQWOO/bwRdk7vCDWBMnIJCSdY9UyUWJqVLB88kkRJZdmGdJ sJW28Ohi4TgDcrp4MENIfKdA6D4yUCINVyOHY2vVgN1iRJkVRGTzv0ux4zdjjZqhnfM1 9HlA== X-Forwarded-Encrypted: i=1; AFNElJ+UPOzpqDcrsn2wu78AjWEB91QK5qp4SfWEMM/UuJSx8l7ayU/7Fww7JNvLgEYrzrIQMW0/Dz57WmST8lE=@vger.kernel.org X-Gm-Message-State: AOJu0Yxwk1tC2MZc2gJ7cYJKs2tQEdWF9lMa7f5Q4iF0vhIR/TwgTDC5 H/aQuVViyoIGDFPSbSxi0/XnzTpJ7009NPIJTRVCmfROCCjilPELGezYBxitc0VXqJU= X-Gm-Gg: Acq92OFuwdlSbTjiTtC1om9DJrtqAv1e2TMT+9eEESZ2esc3gzZui/176YEbOqds26Z Wpvzul83AtGy0U/vgxmTGMo8EfnsM7Oz6QhvHWz2V6R/6GSiu/EJKE72PSlnFs6ziw8vN4ZUKr4 QDjSFM3P1EleMnQxVdCz6KaREmX+bPC/9xaoCMWbpDyw20WfDA91xWDedkL9mtWq2n8BqtKDPxY q/2IM+r3khgPKWH3JtJmqwHalJy7qXGAoI6MmtlszoASr4c7P06FJiFX1PdGwccKT1vmuVOJXQe zrbp8Wr/XWGxO2aPtlt4IU9k6BPRbU/+te2B7A1L3DJ3ItEbadLpGZ2E7Oibw+DvQh+NdA7BGIC 57Ek9sg9PQcmihjDsKt5iJmtNj2QiC+P3i/or/d7TeYm1xAucgJ2JsMjFCYnK0Xmuf9UaPfPcA1 Hoot+ngQ+FfZhRiv96kulVqjpcs2B+OSFU X-Received: by 2002:a05:600c:3104:b0:48e:89b8:7c6d with SMTP id 5b1f17b1804b1-48fe63074edmr39610915e9.25.1778835511104; Fri, 15 May 2026 01:58:31 -0700 (PDT) Received: from [192.168.1.210] ([2a00:23c8:33b9:3b01:f7b1:b7a0:6254:c325]) by smtp.googlemail.com with ESMTPSA id ffacd0b85a97d-45d9e768c4fsm13142610f8f.8.2026.05.15.01.58.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 May 2026 01:58:30 -0700 (PDT) From: Jim Cromie Date: Fri, 15 May 2026 02:58:14 -0600 Subject: [PATCH v3 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: <20260515-asm-generic-1-v3-5-680b273666d4@gmail.com> References: <20260515-asm-generic-1-v3-0-680b273666d4@gmail.com> In-Reply-To: <20260515-asm-generic-1-v3-0-680b273666d4@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=1778835503; l=5183; i=jim.cromie@gmail.com; s=20260203; h=from:subject:message-id; bh=kUSow6akBfhQlY1Zb90I/sAp9Gjz8mVUGJE3qqGhnlg=; b=KNsqVyKxqwSY91LXSENqvLLbOQ8Bb2cS+RTLuSWlHKZ96ZekMdw6xLAlCb23wBDkZCbMQ44T8 VhpdygpGFpYCuq2SFOE5ecaFO1zMm9SZPj0pZi7bYDAKxRw7DUpINy4 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 --- v3: move #includes to top, drop extra ALIGN(8) in DYNDBG_SECTIONS, add RvBy v2: Address linker script review feedback for relocatable modules. 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) { ... }`. fixup-inc-vml --- MAINTAINERS | 1 + include/asm-generic/dyndbg.lds.h | 18 ++++++++++++++++++ include/asm-generic/vmlinux.lds.h | 6 ++---- scripts/module.lds.S | 2 ++ 4 files changed, 23 insertions(+), 4 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index b2040011a386..2ef1e481af26 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -9073,6 +9073,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..9d8951bef688 --- /dev/null +++ b/include/asm-generic/dyndbg.lds.h @@ -0,0 +1,18 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#ifndef __ASM_GENERIC_DYNDBG_LDS_H +#define __ASM_GENERIC_DYNDBG_LDS_H + +#include +#define DYNDBG_SECTIONS() \ + 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 9fa11baf27d3..016ca653232e 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -52,6 +52,7 @@ =20 #include #include +#include =20 #ifndef LOAD_OFFSET #define LOAD_OFFSET 0 @@ -344,10 +345,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