From patchwork Fri Feb 13 20:24:06 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1848 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1771014283; bh=eKK6MMxHedpJmVo2z158WX/GtqFGGEQdDhHHu1a3FzE=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=gWfMK4CFv1s/HzSlDHdoLdOSgkNRk1MymBQL5gLe7rb8fkESxrgUm8lW291PfDwWk 6SwetaorqtvA3ICkngSk8m7C7o+oN0lFihiXmN3tjUhoQqjJUB9UUxJSgBDbzuFrz9 2Mih/IFFTfwiyo3syybF0rt6fHPK3QgsA62FuwLCmx+Iz7HPXMXjI2l/+txu2Fkjzl KMxwelz7j25YcH3q9mSLK5w7t7rbnFEe0d4a43Y+f/Tid6tJL6BbH9eHrBK6XwcWmU Uzu6Pzunu4gPx+D9Yo6cJ224pIDl5sVIeLXpYUOg91aFR/TG4VdY3tPm0/JqV+FBtE vhN351ChhJ6ZA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 7CF2769B2D for ; Fri, 13 Feb 2026 13:24:43 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id Wxp9CY3ERWjD for ; Fri, 13 Feb 2026 13:24:43 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1771014283; bh=eKK6MMxHedpJmVo2z158WX/GtqFGGEQdDhHHu1a3FzE=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=gWfMK4CFv1s/HzSlDHdoLdOSgkNRk1MymBQL5gLe7rb8fkESxrgUm8lW291PfDwWk 6SwetaorqtvA3ICkngSk8m7C7o+oN0lFihiXmN3tjUhoQqjJUB9UUxJSgBDbzuFrz9 2Mih/IFFTfwiyo3syybF0rt6fHPK3QgsA62FuwLCmx+Iz7HPXMXjI2l/+txu2Fkjzl KMxwelz7j25YcH3q9mSLK5w7t7rbnFEe0d4a43Y+f/Tid6tJL6BbH9eHrBK6XwcWmU Uzu6Pzunu4gPx+D9Yo6cJ224pIDl5sVIeLXpYUOg91aFR/TG4VdY3tPm0/JqV+FBtE vhN351ChhJ6ZA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 6B4ED69B34 for ; Fri, 13 Feb 2026 13:24:43 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1771014281; bh=SqFb9yTvEUgxRK6OSXx9tGwz2hHWuXYr7QOjEXdrEOY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=B/ZONEPMF0LFAgVedsYkUg+A3aknPJlUWTqPiwgoIrl66T/TE/Y3B8nF/spmVdcbM geRj+TbEuHLq29Fed7EPGu+btyiX5tQN6jqqSqPo05hWlt1YZMdys7RMV/QJjbkPkZ S/WPiyc8AXOrZS1+Ns4BgAmYdUJ88kwXU62TP2pILs+hZRZZro8Y0rRduDuq9f3ciT Zd44TGp+7kkzo9jvtpRwXfu3doOYXTkmb2wCL5FULOBHH99iWvnN7xRFiSqKmPkmpZ rYHUBaoJHnwN9PuR8xkBctLQtBgXOpNx3SHyGcmyQFB4GyvsnRohbiPxc9z6fOTdFl fbxJ5uamVicgQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 12D7C69B34; Fri, 13 Feb 2026 13:24:41 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id 6I4LOjhGpSzd; Fri, 13 Feb 2026 13:24:41 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1771014277; bh=SOfKjelA/BKZNl4ZEkjhsKc0o8HJn/zu5MoiYyPkjGw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pJva16hb+LZcFccUmhTxxT+dEH0dDk7psMP2xnZ+2lR5q/h5AXdyLBl4XkcZmi/ZW lRcUlkYvma+m8nVL9CLjz14LTiSx/tOhU48SRW7mfl6ukuB0sEwjnSW02XtMAdF6rq 0uv+yg92m0lSyAhr4E+lo6K+Muic1YJgoUPx8UfusxYX7uLAv4ryLknYvnbV3uoJ7t /JJgMjOOsXIJg2C0wYf2nc17VxFztulcWtbAqRfVYMjvrQN1no7NXfijKbDzk8hd+D jNTzatDcdm8Qr53/sa6Ef5bZ4JQQQy2nf4vVWkc2g01YFRqYJv7EsDDBkYOlRAac6+ ASmpTDmXFWNOQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id BB8BA69B0E; Fri, 13 Feb 2026 13:24:36 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Fri, 13 Feb 2026 13:24:06 -0700 Message-ID: <20260213202417.223068-2-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260213202417.223068-1-sjg@u-boot.org> References: <20260213202417.223068-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 6P6UCARSZGGFTJ2ORCWG23EKZYBE263U X-Message-ID-Hash: 6P6UCARSZGGFTJ2ORCWG23EKZYBE263U X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass , "Claude Opus 4 . 6" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 1/8] dm: Fix linker list alignment for ll_entry_get() List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass The extern declaration in ll_entry_get() lacks the __aligned(4) attribute present in ll_entry_declare(). When the compiler sees an unaligned extern reference to a linker list entry in the same compilation unit as its definition, it may increase the section alignment beyond the expected struct size. This causes gaps in the linker list array, which the alignment checker reports as failures. For example, sandbox_dir is both defined and referenced via DM_DRIVER_GET() in sandboxfs.c. The compiler applies 32-byte alignment to its section instead of the 4-byte alignment from the definition, creating an 8-byte gap before it in the driver list. Add __aligned(4) to the extern declaration in ll_entry_get() to match ll_entry_declare() Co-developed-by: Claude Opus 4.6 Signed-off-by: Simon Glass --- include/linker_lists.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/linker_lists.h b/include/linker_lists.h index 6a018f175ca..470dcfc621a 100644 --- a/include/linker_lists.h +++ b/include/linker_lists.h @@ -284,7 +284,8 @@ */ #define ll_entry_get(_type, _name, _list) \ ({ \ - extern _type _u_boot_list_2_##_list##_2_##_name; \ + extern _type _u_boot_list_2_##_list##_2_##_name \ + __aligned(4); \ _type *_ll_result = \ &_u_boot_list_2_##_list##_2_##_name; \ _ll_result; \