From patchwork Tue Mar 12 14:08:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilias Apalodimas X-Patchwork-Id: 1911098 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=iBp5ThKK; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TvFrd5pKPz1yWt for ; Wed, 13 Mar 2024 01:09:37 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8A71C87FAD; Tue, 12 Mar 2024 15:09:08 +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="iBp5ThKK"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B0EB387F78; Tue, 12 Mar 2024 15:09:07 +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-ed1-x532.google.com (mail-ed1-x532.google.com [IPv6:2a00:1450:4864:20::532]) (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 A789387F69 for ; Tue, 12 Mar 2024 15:09:02 +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-ed1-x532.google.com with SMTP id 4fb4d7f45d1cf-568107a9ff2so6257127a12.3 for ; Tue, 12 Mar 2024 07:09:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710252542; x=1710857342; 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=EyTGDcjnbgrI/Feob4SwLA7ZO6R4QQDrl/SKUTNkZvw=; b=iBp5ThKKi69dIKMAVr1mcufMFdeNwsQK1BCYmqqBGl0qkyH2FE/zzM3JQ/j2RXNsAl EuQ0ANlgK583TIDgydwJhzjFdZ10NXe8LgZZsxLuDi+fx2+sAtyBmPH5eFjIrzW3Csr7 Ffz8g523a9xksvql92CiYOiHziJAZqw91FSarafYW5N7zU0cP0TUAXrn8gM8/IzD0W7l dFCYOMdDVjim7C0Xvy+VGxUUmOZKOvmedsjTwhnRLoW7YllXIbbmAw7Uacm0kjEVF5L7 wjOQ62SD6Dkl1Rc/LaLn64kVlNxEfKBjD8JAAlGUQgEG96YlMaJyajy7MwGuu80189AQ 4/qQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710252542; x=1710857342; 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=EyTGDcjnbgrI/Feob4SwLA7ZO6R4QQDrl/SKUTNkZvw=; b=WZVU1YP7IUSn5OgIN0vDcx44lDNSek3YtEb71TTIbeG7AaPSC9t/KtrmRtGbr0dHY+ BEKnFP8DjRDvgpLvBTqV5Tbb3HoG7fZ+LqjBWLFInCq5XPzxvag7BDt2qr28LlHPTT33 /bpKxkdqHE1sSGbpobJEDYB5AtjYN/oAup8dcY7pHZ/nFZmy/Woqnz5guQKGqFXnPbEN jPzZK/RePf0kIsRy7/xssefoExHMegiQpiFl6OpwcCWMFx5Emv5hGg92HYt9szFZ5WkE LbDfTBQJDdOc9IbU6Eog+43PDMnIpX29vNo2wBRaDHvNFwXEwvSQtI4aum0wml39nZz4 VaJg== X-Gm-Message-State: AOJu0Ywl0HDx+wvn9PsakEkbceuVKIPP4ijz0gilzUIk29qyPiUOOTvr RzEnRA0Uq76oOnKTucPkJ0Mko0sYNEWOHa3vBPKYbYpFgbyDMOsa690kXdkcKGIFbIFL6oprQR+ 8B00= X-Google-Smtp-Source: AGHT+IFeHq7dMtYZ/Fq3sykOppM9UyyKnwbF/FcEfdC5chseddugxzDYlCY1mtVLhFHNrig0ON2AXg== X-Received: by 2002:a50:d618:0:b0:568:2ad2:5d96 with SMTP id x24-20020a50d618000000b005682ad25d96mr355184edi.40.1710252541919; Tue, 12 Mar 2024 07:09:01 -0700 (PDT) Received: from hades.. (ppp046103107123.access.hol.gr. [46.103.107.123]) by smtp.gmail.com with ESMTPSA id d23-20020a056402001700b0056857701bf5sm2246086edu.81.2024.03.12.07.08.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Mar 2024 07:09:01 -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 , Sam Edwards , Ryan Chen , Chia-Wei Wang , Aspeed BMC SW team , Joel Stanley , Simon Glass , Philipp Tomsich , Kever Yang , Michal Simek , Yegor Yefremov , Heinrich Schuchardt , Shiji Yang , Bin Meng Subject: [PATCH 5/7 v2] arm: fix __efi_runtime_start/end definitions Date: Tue, 12 Mar 2024 16:08:27 +0200 Message-Id: <20240312140832.1968215-6-ilias.apalodimas@linaro.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20240312140832.1968215-1-ilias.apalodimas@linaro.org> References: <20240312140832.1968215-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 __efi_runtime_start/end are defined as c variables for arm7 only in order to force the compiler emit relative references. However, defining those within a section definition will do the same thing since [0]. On top of that the v8 linker scripts define it as a symbol. So let's remove the special sections from the linker scripts, the variable definitions from sections.c and define them as a symbols within the correct section. [0] binutils commit 6b3b0ab89663 ("Make linker assigned symbol dynamic only for shared object") Suggested-by: Sam Edwards Signed-off-by: Ilias Apalodimas Reviewed-by: Sam Edwards Tested-by: Sam Edwards # Binary output identical Reviewed-by: Richard Henderson --- arch/arm/cpu/u-boot.lds | 12 +++--------- arch/arm/lib/sections.c | 2 -- arch/arm/mach-zynq/u-boot.lds | 12 +++--------- include/asm-generic/sections.h | 1 + 4 files changed, 7 insertions(+), 20 deletions(-) -- 2.37.2 diff --git a/arch/arm/cpu/u-boot.lds b/arch/arm/cpu/u-boot.lds index b1065ec8063d..df979986a5ef 100644 --- a/arch/arm/cpu/u-boot.lds +++ b/arch/arm/cpu/u-boot.lds @@ -43,18 +43,12 @@ SECTIONS } /* This needs to come before *(.text*) */ - .__efi_runtime_start : { - *(.__efi_runtime_start) - } - - .efi_runtime : { + .efi_runtime ALIGN(4) : { + __efi_runtime_start = .; *(.text.efi_runtime*) *(.rodata.efi_runtime*) *(.data.efi_runtime*) - } - - .__efi_runtime_stop : { - *(.__efi_runtime_stop) + __efi_runtime_stop = .; } .text_rest : diff --git a/arch/arm/lib/sections.c b/arch/arm/lib/sections.c index 1ee3dd3667ba..a4d4202e99f5 100644 --- a/arch/arm/lib/sections.c +++ b/arch/arm/lib/sections.c @@ -25,6 +25,4 @@ char __secure_start[0] __section(".__secure_start"); char __secure_end[0] __section(".__secure_end"); char __secure_stack_start[0] __section(".__secure_stack_start"); char __secure_stack_end[0] __section(".__secure_stack_end"); -char __efi_runtime_start[0] __section(".__efi_runtime_start"); -char __efi_runtime_stop[0] __section(".__efi_runtime_stop"); char _end[0] __section(".__end"); diff --git a/arch/arm/mach-zynq/u-boot.lds b/arch/arm/mach-zynq/u-boot.lds index 16245fd4ac2f..fc0ba0ed9a84 100644 --- a/arch/arm/mach-zynq/u-boot.lds +++ b/arch/arm/mach-zynq/u-boot.lds @@ -22,18 +22,12 @@ SECTIONS } /* This needs to come before *(.text*) */ - .__efi_runtime_start : { - *(.__efi_runtime_start) - } - - .efi_runtime : { + .efi_runtime ALIGN(4) : { + __efi_runtime_start = .; *(.text.efi_runtime*) *(.rodata.efi_runtime*) *(.data.efi_runtime*) - } - - .__efi_runtime_stop : { - *(.__efi_runtime_stop) + __efi_runtime_stop = .; } .text_rest : diff --git a/include/asm-generic/sections.h b/include/asm-generic/sections.h index 60949200dd93..b6bca53db10d 100644 --- a/include/asm-generic/sections.h +++ b/include/asm-generic/sections.h @@ -35,6 +35,7 @@ extern char __priv_data_start[], __priv_data_end[]; extern char __ctors_start[], __ctors_end[]; extern char __efi_runtime_rel_start[], __efi_runtime_rel_stop[]; +extern char __efi_runtime_start[], __efi_runtime_stop[]; /* function descriptor handling (if any). Override * in asm/sections.h */