From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oo1-f42.google.com (mail-oo1-f42.google.com [209.85.161.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 5C6383537D0 for ; Wed, 8 Apr 2026 20:02:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775678541; cv=none; b=Srr9prAvEPCRc8CIUawRYrXVoqGvdnXoSS+1hfJ+tPUyUF5MoO+c6rdX8YVJqA8RQ6wfXf9p164I0V5Pl3nnK9z3jjz3BgcIR7DPEK0iY+J+Jp81a6iXJjMgSDZwuHF+62tFz8s7Kau9ZPhTYGCtWVXjbg0uvLApbGvhKxJukMc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775678541; c=relaxed/simple; bh=M7qGYFcYxQ1ijPO4FPbquaFZxM7YrcQnkWktshoCzb4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=O8iUlKpEfwRV/q0+hKGe/9C+yUf8L0pbveqPlvIvzvnWJ9gmXsvJQsCMae2HW6x1zcE19W0+kDBlj+cpHuHLAEis4GO6xq7NtUZVbTWaweZ5+NEJVe94flgRfY5aTWSX9I1h853QB0zp0tmMyBiS8inzCkmAFfsIC8VXjxDbNkc= 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=LJpm+CZr; arc=none smtp.client-ip=209.85.161.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="LJpm+CZr" Received: by mail-oo1-f42.google.com with SMTP id 006d021491bc7-6841e6a5e51so81675eaf.3 for ; Wed, 08 Apr 2026 13:02:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1775678539; x=1776283339; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Jl0zqIzGDZsFGD9VB82Xk4qavMNkml4BIjsBRoCBMtY=; b=LJpm+CZrKgc5Ajof8yBVvsRqq87Bhd9Y+aoOq6JS0RScv0bwHtPTHCvk1laz96fFbC 5I1yOO7OkV10ubOkF620r8hLLaN7+t/DoDD0HMhUyGkDg8/pUJVfXonYcynG4/GBaqr4 W7p7S6BOMHlFmUBBplSXiK4za2B0g9U2Bp22fum50Aw8WzaRn/9tJRvycWuyn7RMoGVQ hq7GwKr4dFMMmy6loeQvQMkKD2qFcBXHucWlByjP/tYdPPKjlaTN5kcE15He6ERjtBBc cRd3GUotJutWP0Q1QPPrZqblFVJp2/Fr0DrsRVilGQqPhZBbrLCkjtB0pLjiQPGjVY26 Q9Fg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775678539; x=1776283339; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Jl0zqIzGDZsFGD9VB82Xk4qavMNkml4BIjsBRoCBMtY=; b=PcG3PnT2wFixD8Zwo8R9a6vHZRyTAFnt6Uo0yHrqNtJ1qaHWrhMLNY5o1wKN3O4sxA 3CM3Z9Ii39C4+7uoP3IHF6KSqZ420kGDlbu8t7910QWvTbsNdKaUU4gn6bQmH+NME642 +77T19H76JLgnx4CgmFwPNq062qaKO4MvQy87veAuZPww6ujf/V73/n/WTn6UIUQju2U yVLuezQg1lmRBYGj7KoIOzYHjRuT3lwH6YNI0SVMkkfd8AlPvsbiF+hWubrDwGX4ip03 WyJzETysq2VWaPR4l6Da8AXepRmId725RWET6/0dNIxYW6XYgO2ync9y4NW57YVcayk0 O50A== X-Gm-Message-State: AOJu0YyCYbmCUoTZc3SEh0ZkscxCpkWO6nCRYYtacT2gMeEUPE/yRbP7 W6g2x2m2hTDf0Rsf8yF5y8FhZ8XFEud/fP1KY0hL6DXaHecx3z1vnjYQ5nKkfQ== X-Gm-Gg: AeBDietJ5aK9BOeCCKo9G5cJsfszSiC2YUnKsgc71ihD1b5ohOI9nrLnlbTAx7Cz+3d JQI40vuEjbS8ahgYOSP0PoUb3P1anMOCqkQeEeqcSGEsMWh/R+FMq5cvO36/Ldo6jVOzv/fVgnc Sdafkn865xFLZb0djAHW0tfeP27j1TMECiF/TOiAs7OR5OHWrr+dOo+qDqGOuam0NmxaxUutoTc Z0jaodGd3TLWf13RZccRx52QwU/6HF9mxpUbcH0AzveSL2q4uqkTLBGQbnbrrSjIoUa3AxldXye j9Q1rkvTsfJTgthclNV9Foicy+wz7gxu1rbga+ojfTvursVYjWtHV/s10O5fq+NMOzxfdXbijpj n7WjLMxVoPtxUt63l09GoMoJyrFoaLfjhp+lffOwseolbfMVqqAYskU3mqYTvqRVqyUhU/XkuSe 4e8l53/hl8XZESht0f+KVdZm36tB4bcYxQEmrfWCkCYqct+MjcMj0QtVMWIiEsik4aoUY4Gur6R ls= X-Received: by 2002:a4a:edce:0:b0:680:3739:650 with SMTP id 006d021491bc7-68a63c89b82mr570950eaf.60.1775678539047; Wed, 08 Apr 2026 13:02:19 -0700 (PDT) Received: from frodo.raven-morpho.ts.net (c-98-38-17-99.hsd1.co.comcast.net. [98.38.17.99]) by smtp.googlemail.com with ESMTPSA id 006d021491bc7-680a63c7fd1sm12254208eaf.8.2026.04.08.13.02.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Apr 2026 13:02:18 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org Cc: gregkh@linuxfoundation.org, jbaron@akamai.com, louis.chauvet@bootlin.com, Jim Cromie Subject: [PATCH v13 02/36] vmlinux.lds.h: move BOUNDED_SECTION_* macros to reuse later Date: Wed, 8 Apr 2026 14:01:37 -0600 Message-ID: <20260408200211.43821-3-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260408200211.43821-1-jim.cromie@gmail.com> References: <20260408200211.43821-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 future problem with modules failing to keep dyndbg sections in some circumstances. Signed-off-by: Jim Cromie --- include/asm-generic/bounded_sections.lds.h | 36 ++++++++++++++++++++++ include/asm-generic/vmlinux.lds.h | 32 +------------------ 2 files changed, 37 insertions(+), 31 deletions(-) create mode 100644 include/asm-generic/bounded_sections.lds.h diff --git a/include/asm-generic/bounded_sections.lds.h b/include/asm-generic/bounded_sections.lds.h new file mode 100644 index 000000000000..280a893bbe29 --- /dev/null +++ b/include/asm-generic/bounded_sections.lds.h @@ -0,0 +1,36 @@ +#ifndef _ASM_GENERIC_BOUNDED_SECTIONS_H +#define _ASM_GENERIC_BOUNDED_SECTIONS_H + +#define BOUNDED_SECTION_PRE_LABEL(_sec_, _label_, _BEGIN_, _END_) \ + . = ALIGN(8); \ + _BEGIN_##_label_ = .; \ + KEEP(*(_sec_)) \ + _END_##_label_ = .; + +#define BOUNDED_SECTION_POST_LABEL(_sec_, _label_, _BEGIN_, _END_) \ + . = ALIGN(8); \ + _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 58daa551420b..462f124ad457 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -211,37 +211,7 @@ # endif #endif -#define BOUNDED_SECTION_PRE_LABEL(_sec_, _label_, _BEGIN_, _END_) \ - . = ALIGN(8); \ - _BEGIN_##_label_ = .; \ - KEEP(*(_sec_)) \ - _END_##_label_ = .; - -#define BOUNDED_SECTION_POST_LABEL(_sec_, _label_, _BEGIN_, _END_) \ - . = ALIGN(8); \ - _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) +#include #ifdef CONFIG_TRACE_BRANCH_PROFILING #define LIKELY_PROFILE() \ -- 2.53.0