From patchwork Tue Mar 12 14:08:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilias Apalodimas X-Patchwork-Id: 779730 Delivered-To: patch@linaro.org Received: by 2002:a5d:604e:0:b0:33e:7753:30bd with SMTP id j14csp2039888wrt; Tue, 12 Mar 2024 07:09:14 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCW8pHhGlbTOwPItnnaY7zbhYblP19qnEc+b2qWGYCiEC4XBqWGtYth6Vt1Rrp0Vyyg0KcZLlwtRSU8/m4WFqB/b X-Google-Smtp-Source: AGHT+IFYG4/2kyw2UfoFLyy0+Fl3SjGZeOxL0XhGCf+UdVs5GZEqAWaz12o2aOa3Hk+eHlFuuXsR X-Received: by 2002:a05:600c:468f:b0:412:b8ce:fa1e with SMTP id p15-20020a05600c468f00b00412b8cefa1emr7027923wmo.29.1710252554177; Tue, 12 Mar 2024 07:09:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1710252554; cv=none; d=google.com; s=arc-20160816; b=HQxBP2jKiLTQLzsMbjpjEHZnDxAuNqAcSSQ5Nbf1WTX+syf0S9EQw5ptMqQKV0Kgs+ lWaIbm51nP7NdeNkEo+ykcKsQjMSQogWlHMHthLbKPqmfHu5hGxBvcpAId6Ar6RHyxYe S/CUnQ3eod0ewRmc+V+iISDOMm3d4b9FdB+0h5DVqX8z42cdTCsy2A+hDjQTWTZwmXVE HG679xhs1ohHRr6JoxYbdiDi2uj5yfEAGeYVvO9R+fQEFn/nPOiu9EAwgxEzRudZoxZ1 UII62K+RoVvqzUZZzQRb1+uIonyVTMikCVLTWsk09WPV6Fg22X5FWQYpNLGSFYIJ7EtW A2Qg== 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=J6pvg5Oa7u0dLpTLS16+tVIbHYHC3s3NEBv9Yf4lmgo=; fh=Dl9U/cWBAjt0RA0ekDL4vfSYX5rQ4ZX9RknwKNQFT0M=; b=onSlFACB3nCDDH0bv6pxWWY9ZgoKLgdt0ypoyDu7t/G1+cl5B69g4roOnrph3oATug h8Zjy/9S0O6g+9QvvaUu4QetnRn/KFgysl/jhWV9YPGPAMxzieqRrOLcaR81HN6MjEa6 VrEWB/4G5DgwiQ8otopuRNE1kTlv0rDi8UPFH7+qxicn0RxLK5DvQBxsr7/cmlOptSXn Q+OMdYwPiYox2ihBtNWvwRHW7ZK3Bplsm7ru8aaX3ZFf9UNtctgQfrCKrPwaIEs8YTgF K3niRExy1QMxwN0NUd3PiWHIH/7SfMR/tXFsbBaQGnDBaSSPViHuSk8ZWwGb+ZJ21RHv 5p2Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="A/oaeD9l"; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 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. [85.214.62.61]) by mx.google.com with ESMTPS id q13-20020adfea0d000000b0033dda858aa0si3892742wrm.595.2024.03.12.07.09.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Mar 2024 07:09:14 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="A/oaeD9l"; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 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 5D76487F80; Tue, 12 Mar 2024 15:08:55 +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="A/oaeD9l"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5AD6B87F80; Tue, 12 Mar 2024 15:08:54 +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-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) (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 5370487F69 for ; Tue, 12 Mar 2024 15:08:52 +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-x536.google.com with SMTP id 4fb4d7f45d1cf-5683089d4bbso5442713a12.2 for ; Tue, 12 Mar 2024 07:08:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710252532; x=1710857332; 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=J6pvg5Oa7u0dLpTLS16+tVIbHYHC3s3NEBv9Yf4lmgo=; b=A/oaeD9l5ZdFHsCwaP0iigaKq/7trpyiSoBFB/5RMYsGyxTjOXfUlhDWA8S5GGXWJ/ blmw5lW2RCyL/BPfFUYMbXEBlvAYpF9d17LtwwbdtB+UsFRfCySgnLH1gMqSWvJVhxGy tP1atVK33ht8p5eg8UrMh1XPDCGpmLb4rvxHh8x0/Tzi8dnnQ2fCCH8D9D4pq/pXjiFr HYenqsXZj9eRwkptvjmPZdtd9Q2/3yWp4jtET8I5QKz6Vvql4YVOxAEiTx3ncParzfCj pQVMldMAvSDqsLAXZ7fSn0J8MUPnNixq2fFYWbFLZ8KONHp9HMrcjgGEiuPnPWlS71So Gg8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710252532; x=1710857332; 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=J6pvg5Oa7u0dLpTLS16+tVIbHYHC3s3NEBv9Yf4lmgo=; b=HI/UV/62HFWmBbv0JAKH4T3gzN01ln7nwVlHLvU93F8cvthLXNyxu0+h5cqaecSRL/ 3wF7/wzTXrUuj1IJZ/65snCun5eTT5EXZPm221NgzGP4ZcYu7hi5WHg923GavNcG9ufJ evuDjS0YQyUnfbFYrKhSKIBYJxqeVSZLIMxTfgY2t9XtQI1rWYw7NaiRMVPchnGIV+tN EKg+xAj/fdhHs/FkVIobs5OPawNJZ7oNsuC6IQIdkNiBaYEKJibXRNCwTBVeapsPhXsl jx3IyXHYZgHOpY/OEHsoZUs8PJYAkI76Hpt4OGhtr2IBg8j57aRamGZZ3zrJMR8n0fA8 ePsw== X-Gm-Message-State: AOJu0YzTC0SlIqpPTHqoVw81/c1IZxQCb342dp8KzPpE1cS/Qu0ePCYa 4xKIM9VJCQY3Zg7XMJliN7zP1QAlRDAaMBzUvVM4bPJhrg+LbrfRJltHoljC/hBmyRh9XVTewXD tTTs= X-Received: by 2002:a50:8e17:0:b0:565:6c72:40a9 with SMTP id 23-20020a508e17000000b005656c7240a9mr6050407edw.28.1710252531701; Tue, 12 Mar 2024 07:08:51 -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.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Mar 2024 07:08:51 -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 3/7 v2] arm: fix __efi_runtime_rel_start/end definitions Date: Tue, 12 Mar 2024 16:08:25 +0200 Message-Id: <20240312140832.1968215-4-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_rel_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/armv8/u-boot.lds | 4 +--- arch/arm/cpu/u-boot.lds | 16 +++------------- arch/arm/lib/sections.c | 2 -- arch/arm/mach-zynq/u-boot.lds | 16 +++------------- include/asm-generic/sections.h | 2 ++ lib/efi_loader/efi_runtime.c | 1 + 6 files changed, 10 insertions(+), 31 deletions(-) -- 2.37.2 diff --git a/arch/arm/cpu/armv8/u-boot.lds b/arch/arm/cpu/armv8/u-boot.lds index c4ee10ebc3ff..eccb116d3cfa 100644 --- a/arch/arm/cpu/armv8/u-boot.lds +++ b/arch/arm/cpu/armv8/u-boot.lds @@ -115,9 +115,7 @@ SECTIONS KEEP(*(SORT(__u_boot_list*))); } - . = ALIGN(8); - - .efi_runtime_rel : { + .efi_runtime_rel ALIGN(8) : { __efi_runtime_rel_start = .; *(.rel*.efi_runtime) *(.rel*.efi_runtime.*) diff --git a/arch/arm/cpu/u-boot.lds b/arch/arm/cpu/u-boot.lds index 01accb109fad..37f4cd27d79a 100644 --- a/arch/arm/cpu/u-boot.lds +++ b/arch/arm/cpu/u-boot.lds @@ -152,21 +152,11 @@ SECTIONS KEEP(*(SORT(__u_boot_list*))); } - . = ALIGN(4); - - .efi_runtime_rel_start : - { - *(.__efi_runtime_rel_start) - } - - .efi_runtime_rel : { + .efi_runtime_rel ALIGN(4) : { + __efi_runtime_rel_start = .; *(.rel*.efi_runtime) *(.rel*.efi_runtime.*) - } - - .efi_runtime_rel_stop : - { - *(.__efi_runtime_rel_stop) + __efi_runtime_rel_stop = .; } . = ALIGN(4); diff --git a/arch/arm/lib/sections.c b/arch/arm/lib/sections.c index 8e8bd5797e16..ddfde52163fc 100644 --- a/arch/arm/lib/sections.c +++ b/arch/arm/lib/sections.c @@ -29,6 +29,4 @@ 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 __efi_runtime_rel_start[0] __section(".__efi_runtime_rel_start"); -char __efi_runtime_rel_stop[0] __section(".__efi_runtime_rel_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 25c81b21018b..11b6e7278a9c 100644 --- a/arch/arm/mach-zynq/u-boot.lds +++ b/arch/arm/mach-zynq/u-boot.lds @@ -58,21 +58,11 @@ SECTIONS KEEP(*(SORT(__u_boot_list*))); } - . = ALIGN(4); - - .efi_runtime_rel_start : - { - *(.__efi_runtime_rel_start) - } - - .efi_runtime_rel : { + .efi_runtime_rel ALIGN(4) : { + __efi_runtime_rel_start = .; *(.rel*.efi_runtime) *(.rel*.efi_runtime.*) - } - - .efi_runtime_rel_stop : - { - *(.__efi_runtime_rel_stop) + __efi_runtime_rel_stop = .; } . = ALIGN(8); diff --git a/include/asm-generic/sections.h b/include/asm-generic/sections.h index 1e1657a01673..60949200dd93 100644 --- a/include/asm-generic/sections.h +++ b/include/asm-generic/sections.h @@ -34,6 +34,8 @@ extern char __priv_data_start[], __priv_data_end[]; /* Start and end of .ctors section - used for constructor calls. */ extern char __ctors_start[], __ctors_end[]; +extern char __efi_runtime_rel_start[], __efi_runtime_rel_stop[]; + /* function descriptor handling (if any). Override * in asm/sections.h */ #ifndef dereference_function_descriptor diff --git a/lib/efi_loader/efi_runtime.c b/lib/efi_loader/efi_runtime.c index 18da6892e796..9185f1894c47 100644 --- a/lib/efi_loader/efi_runtime.c +++ b/lib/efi_loader/efi_runtime.c @@ -15,6 +15,7 @@ #include #include #include +#include /* For manual relocation support */ DECLARE_GLOBAL_DATA_PTR;