From patchwork Wed Mar 13 16:23:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilias Apalodimas X-Patchwork-Id: 780040 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:ed0:b0:33e:7753:30bd with SMTP id ea16csp10171wrb; Wed, 13 Mar 2024 09:24:49 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVyqXW29cKQdCg9DvBk+0SLY7ziwn8SHr8YfAa6pOL6k5eq8mvTzfzNoMRsq0qlabrLy648BgXy7H1WrgkS4PYf X-Google-Smtp-Source: AGHT+IHezNCwV/rIMXhKNwxdlllkapVejPlrBE9RO8NVSV9+Y35Fo+0ScfsiA1wLTc31KAZQAB1D X-Received: by 2002:ac2:44b1:0:b0:513:c195:1c56 with SMTP id c17-20020ac244b1000000b00513c1951c56mr3646920lfm.16.1710347089270; Wed, 13 Mar 2024 09:24:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1710347089; cv=none; d=google.com; s=arc-20160816; b=ydTUAC/XbkfLZTqcEFZu1XgjaP/6oCzsASrv+wXUyyooGaDzEAclhbX2iP1jycaW8U OsfajZ0FxR3LXcytVXHmBPjNFvf5jb/Sg5LetKSDQ/JJUKzADkUn89R//s0Qm/NZGJ5r g3pDyyO5TBt5Lk/GU5g8RbOjSVM6nVLPaH+hlSKB9FSYmp7bUR12reTvhDc0PsybkYOk 3tn11TnuLAcfCF5FI8dRy9XpVaFa2giQdXg09YCDugQyid7w+PHjFIfWZNfI8V9j3UeY iZWmxoG1wuLFRrnMIWHxz4q7lHapvwJHWAgT97uslKmboahPmpsNMTI1BDFdJnhR+qrU 350Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=PeH0jtFq/Xmys6wW7yvXInFyA0E/rY6c14SEeWX+QjE=; fh=YgAnvytc3PkIme27WTI0tmSPC4jrks+Z9IcIvi2eGZA=; b=DxUvD/HlZzwAGhx0Rec28+W11i7Hifm0YF3rPmmZdQbzVP4FztTLc0cxa794U+qcdj vepaYqsPsuHVAT9M5VMxUs87W5qJVGhp04QR5YuD38JeOm5ou9tw+gxo8CIU5DcCuj9W 3HhC2dQ25D+TVUSpScshwyp1eaLfXGSMw/Ot0iXKxVA3lbvaxO4Lur/G06pQWKSDNOmy aA7BASLkRoSPN6DhLubKanOmrQS0Mn/GFtqyWy/ccHX5ObNzLk+VpnmzMRMv7v0epgDf gTm5qG83jx6iFb2lE0kMt7Oz4NG5mQyJ1yzbJq1p7zHu5V3l+MQRnE4zn6gJARhTIwHZ TBiA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PLm9rkYV; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id e22-20020a05600c13d600b00412fa37d354si1010142wmg.107.2024.03.13.09.24.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 09:24:49 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PLm9rkYV; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C8F8187EA9; Wed, 13 Mar 2024 17:24:09 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="PLm9rkYV"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id DC7618272A; Wed, 13 Mar 2024 17:24:08 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com [IPv6:2a00:1450:4864:20::130]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id C996287EE3 for ; Wed, 13 Mar 2024 17:24:06 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=ilias.apalodimas@linaro.org Received: by mail-lf1-x130.google.com with SMTP id 2adb3069b0e04-5131316693cso61783e87.0 for ; Wed, 13 Mar 2024 09:24:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710347044; x=1710951844; darn=lists.denx.de; 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=PeH0jtFq/Xmys6wW7yvXInFyA0E/rY6c14SEeWX+QjE=; b=PLm9rkYVG+St9FmZenFOhYJGeaB0a1VvQWXB2pikZOT2X5RvEEkvzWZyzCJPjCIYcP 4mqhjZEc3xYnkI95ndDsSaX1xtXo+EzZaMFupWOcfoIzu+N1lir0ne+B/WrRnK+i0NE1 ka3O58M2ZqsBJDRqaLyeucHQ4HqsGnlBU702Woi5XmDuW6++5GCEH9KvVr8cuJcTLmCm jtFaCkxHZIT+7qHnZagmSW+Jtac77VvpbTrG0jfh67/VZx9/aIG+gHO+vqr6Fk/X/1Bd unHc820+/oR3L0ZdbEQes0QK4X8Gwt0R7fj0sYwuwIXY1gr/EtsQx3uhasrRLjXXGXJg G4bQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710347044; x=1710951844; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=PeH0jtFq/Xmys6wW7yvXInFyA0E/rY6c14SEeWX+QjE=; b=PtD2/TNY6pCHvyO49fgGOoZF4qdkgll6nv+VlXl9cIYTLBI7JTgSa1M23eBrpYVq7L FyfkPfdrXn6pwkWHV10uGuG42ywddbpcHnoPt6YIIZRFU4RX2tFdgriKRo+Km25dIhKH IiJTOyePRSSreAbV3iPWubouMyLuNGtNrcJH32oBNsG1HW72hVqX/3V7GPIZxWvxp8SD c0o52CvC0H7MSsaKSZ3yHe1MQRTm/REyTOYrbRv/MPIBP7HFrwveLfhypLRslNmvWx5T AXwuE/q+W6fl4/DynadIgzBIeDtRnbYh5LzsgrBjiYfDfC+FN2k+aH6+CknCyQEe9ZFk gipA== X-Gm-Message-State: AOJu0YzhvxermvluiNQ0OxQHg9c1LgxRVpxwAlQea4j5R5GHZX84UQYP gxkLohWASLzjuNVdXUGbAVUvTYwX+Y1U8Xyv8+8HK7l02kDAdCejqNgtEc7Bxzm9nDRJzJnBarq hm54= X-Received: by 2002:a19:740f:0:b0:513:cba0:1caa with SMTP id v15-20020a19740f000000b00513cba01caamr1016436lfe.36.1710347044722; Wed, 13 Mar 2024 09:24:04 -0700 (PDT) Received: from hades.. (ppp046103107123.access.hol.gr. [46.103.107.123]) by smtp.gmail.com with ESMTPSA id bh21-20020a170906a0d500b00a44efa48c24sm4998860ejb.117.2024.03.13.09.24.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 09:24:04 -0700 (PDT) From: Ilias Apalodimas To: u-boot@lists.denx.de, trini@konsulko.com, cfsworks@gmail.com Cc: caleb.connolly@linaro.org, sumit.garg@linaro.org, richard.henderson@linaro.org, Ilias Apalodimas , Ryan Chen , Chia-Wei Wang , Aspeed BMC SW team , Joel Stanley , Simon Glass , Philipp Tomsich , Kever Yang , Michal Simek , Yegor Yefremov , Heinrich Schuchardt , Sam Edwards , Shiji Yang , Bin Meng Subject: [PATCH v3 7/7] arm: remove redundant section alignments Date: Wed, 13 Mar 2024 18:23:21 +0200 Message-Id: <20240313162324.2117909-8-ilias.apalodimas@linaro.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20240313162324.2117909-1-ilias.apalodimas@linaro.org> References: <20240313162324.2117909-1-ilias.apalodimas@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Previous patches cleaning up linker symbols, also merged any explicit . = ALIGN(x); into section definitions -- e.g .bss ALIGN(x) : instead of . = ALIGN(x); . bss : {...} However, if the output address is not specified then one will be chosen for the section. This address will be adjusted to fit the alignment requirement of the output section following the strictest alignment of any input section contained within the output section. So let's get rid of the redundant ALIGN directives when they are not needed. While at add comments for the alignment of __bss_start/end since our C runtime setup assembly assumes that __bss_start - __bss_end will be a multiple of 4/8 for armv7 and armv8 respectively. It's worth noting that the alignment is preserved on .rel.dyn for mach-zynq which was explicitly aligning that section on an 8b boundary instead of 4b one. Signed-off-by: Ilias Apalodimas Reviewed-by: Richard Henderson --- arch/arm/cpu/armv8/u-boot.lds | 9 ++++++--- arch/arm/cpu/u-boot.lds | 8 ++++++-- arch/arm/mach-zynq/u-boot.lds | 4 ++-- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/arch/arm/cpu/armv8/u-boot.lds b/arch/arm/cpu/armv8/u-boot.lds index 147a6e8028d5..857f44412e07 100644 --- a/arch/arm/cpu/armv8/u-boot.lds +++ b/arch/arm/cpu/armv8/u-boot.lds @@ -115,7 +115,7 @@ SECTIONS KEEP(*(SORT(__u_boot_list*))); } - .efi_runtime_rel ALIGN(8) : { + .efi_runtime_rel : { __efi_runtime_rel_start = .; *(.rel*.efi_runtime) *(.rel*.efi_runtime.*) @@ -125,7 +125,7 @@ SECTIONS . = ALIGN(8); __image_copy_end = .; - .rela.dyn ALIGN(8) : { + .rela.dyn : { __rel_dyn_start = .; *(.rela*) __rel_dyn_end = .; @@ -133,7 +133,10 @@ SECTIONS _end = .; - .bss ALIGN(8): { + /* + * arch/arm/lib/crt0_64.S assumes __bss_start - __bss_end % 8 == 0 + */ + .bss ALIGN(8) : { __bss_start = .; *(.bss*) . = ALIGN(8); diff --git a/arch/arm/cpu/u-boot.lds b/arch/arm/cpu/u-boot.lds index 798858e3ed6e..707b19795f08 100644 --- a/arch/arm/cpu/u-boot.lds +++ b/arch/arm/cpu/u-boot.lds @@ -43,7 +43,7 @@ SECTIONS } /* This needs to come before *(.text*) */ - .efi_runtime ALIGN(4) : { + .efi_runtime : { __efi_runtime_start = .; *(.text.efi_runtime*) *(.rodata.efi_runtime*) @@ -146,7 +146,7 @@ SECTIONS KEEP(*(SORT(__u_boot_list*))); } - .efi_runtime_rel ALIGN(4) : { + .efi_runtime_rel : { __efi_runtime_rel_start = .; *(.rel*.efi_runtime) *(.rel*.efi_runtime.*) @@ -156,6 +156,10 @@ SECTIONS . = ALIGN(4); __image_copy_end = .; + /* + * if CONFIG_USE_ARCH_MEMSET is not selected __bss_end - __bss_start + * needs to be a multiple of 4 and we overlay .bss with .rel.dyn + */ .rel.dyn ALIGN(4) : { __rel_dyn_start = .; *(.rel*) diff --git a/arch/arm/mach-zynq/u-boot.lds b/arch/arm/mach-zynq/u-boot.lds index f6c99a8ce218..3e0c96c50556 100644 --- a/arch/arm/mach-zynq/u-boot.lds +++ b/arch/arm/mach-zynq/u-boot.lds @@ -22,7 +22,7 @@ SECTIONS } /* This needs to come before *(.text*) */ - .efi_runtime ALIGN(4) : { + .efi_runtime : { __efi_runtime_start = .; *(.text.efi_runtime*) *(.rodata.efi_runtime*) @@ -52,7 +52,7 @@ SECTIONS KEEP(*(SORT(__u_boot_list*))); } - .efi_runtime_rel ALIGN(4) : { + .efi_runtime_rel : { __efi_runtime_rel_start = .; *(.rel*.efi_runtime) *(.rel*.efi_runtime.*)