From patchwork Mon Mar 4 09:01:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilias Apalodimas X-Patchwork-Id: 777737 Delivered-To: patch@linaro.org Received: by 2002:a5d:4b84:0:b0:33d:f458:43ce with SMTP id b4csp415565wrt; Mon, 4 Mar 2024 01:02:34 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXE+0/8RzBd/p/NC3XK6Ja0+iKglL4eo04/hxoWJDj4uCeb48pisotyOL3Xi51w3uHBjCvXnLgD3Ms+DUK96ioN X-Google-Smtp-Source: AGHT+IH4U7wf3ctkapS9auombyaBvHTJkyYbEx+1OkqgvQIifUp5c94/B5c0oaR65JrKHhD59ktL X-Received: by 2002:a05:600c:1e26:b0:412:e55a:7503 with SMTP id ay38-20020a05600c1e2600b00412e55a7503mr875219wmb.25.1709542954659; Mon, 04 Mar 2024 01:02:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709542954; cv=none; d=google.com; s=arc-20160816; b=bn79eaGuD6Y4jI4V3p3Ifqr4O41QzJgU68nMoi2jf9KSATTlz8oxYF3UBhrR3qqrIv zlpwv1ojF04D9v+r2h9I6mwGiroGX0vmuoHNn63g1cxVDSw/2OlXmLoYyTGYqdXiYVJq AxoCO9wGCTsn3HywszieylclKDZ8rDOO5LGl04t6vi6mI1KaWSvjVC2jBpBWFVL2uL91 kSjob2p81KIFYCL3j/9aMAkig4pzLD7AA8E/IVdmL0S8rRqKhuaNjfWSp1HFIByQj8Go A7pkfO5OjcaA2rantgwnOjS4KZpUsO6HiMdMA31mr6J6BYcphrCvosxPPDRQQGPiff77 FtdQ== 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=uCjEZk+hn7YNvUHPw/I6m4Ni9W92nQmew7vxuOthRyA=; fh=h6c+xPqZoaZ+hxDehYH61okRtmJqZz06MxEejd36ji4=; b=m9zALETiVMGNkq1nmSAtSGS4J4tIzMjH8Yvr5Vjx2utfDwUUUqe5N+8cJG2jczk75p TkcP9Ln6PtO2LK7/OM1yvcVk8mQWC75qAJWcJQ9GZVVSXXK8fJxASJ6CPvcFnlTryXgy V8c10V3QS3/pf2Oia2B8+cuYlhXLaMuIOqkphN0FVjMn7OrtGnA2lG/e5Bad82fBqI/M UsAN3UoQ3NPBUwzcXGVqct/H1Yp2lb+w18NRlkSMEZ2TCrK1JwlTSd+qduja8BClGNok Sge1It99Mx79KRH31PgS00ZeOc8AWwTi6/UfaOYKWKGPKfnf+Lxv8kuAP+5m4oZr21Fg aA0Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="F/srCyH8"; 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 g15-20020a05600c310f00b00412768552aesi5321114wmo.53.2024.03.04.01.02.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Mar 2024 01:02:34 -0800 (PST) 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="F/srCyH8"; 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 A825587DAB; Mon, 4 Mar 2024 10:01:53 +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="F/srCyH8"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3DBD786FCE; Mon, 4 Mar 2024 10:01:39 +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-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) (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 02EC587DB7 for ; Mon, 4 Mar 2024 10:01:29 +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-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-412de18edcaso6959155e9.3 for ; Mon, 04 Mar 2024 01:01:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709542889; x=1710147689; 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=uCjEZk+hn7YNvUHPw/I6m4Ni9W92nQmew7vxuOthRyA=; b=F/srCyH8fTcinHhSPgmUsvHmcyHxTdaRUW1Regp2yG7Fcs2eI+dNvyLpVPPg67AKxc olPogIpWkkvH3RdUDKTVkIcapqdPEoUTO40sXDfcubhWb3wWa5BZtItKCwyNJK0ojP4E jYk+KRRnWzZyMqLpeB3TLjGfopK3JEbksPuUkqGycfjsMHsjGh7gfo2ayNuGXsv/w4ZA Qpu+kD7B1Z8ivwhxJkREQ+PhMTBR2jYtKv04/+mSvjiVZsbjBfaK864RjdCYu4H64/mJ h2Jorm48L6xT0H/TBn8B7T5p32BJ4HJrc3H1nAiVwZ0mZLEGEW2W4zLKPGkTr97UX16Z SftQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709542889; x=1710147689; 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=uCjEZk+hn7YNvUHPw/I6m4Ni9W92nQmew7vxuOthRyA=; b=cZ6YD65M/L4f3m90nJVAUk//OmqdGj1PRDo3DoECfXNAYwpDiCkyvHf7bA0Ueq1Gfa ll7ALZX28w32EPcb9FXjyObC14op5aA5/9JcA5NjwqmymGnces6Ws+wzI7u+qHU3OE5s HIcG5YZM3PQwAUqXMpNPUNxngiZ2WU3saDxRUM+gli5XH1bjenwh2H6VRQWT362JIPSR EHKeV5PUtZa2xB1ZgFhvzGdxv1DCuk6QvKiMBlXJI6MykLfXwT6ebxFhSMcuhzOaBGhd 6dsLMuVyq4FnQAdqG/NnDJt4jy0ufIbVDnNDwAiWbGERwREj8EBI5r/Xe8+Im3aSgZ6y tkmg== X-Gm-Message-State: AOJu0Yzwv9XZEzlcXIch8OYZxvO0+pxykHSkcdeDG3n6KbQu1++49PQV NJPCDFHwF88r5b2MW8PeaC8D06p8hW9/9famTI1SNdf0a/fYDQIT66d15xOtHZFSz4OaUb2m/KO Ask0= X-Received: by 2002:a05:600c:474e:b0:412:c2a3:4431 with SMTP id w14-20020a05600c474e00b00412c2a34431mr6750780wmo.14.1709542889369; Mon, 04 Mar 2024 01:01:29 -0800 (PST) Received: from hades.. (ppp046103107123.access.hol.gr. [46.103.107.123]) by smtp.gmail.com with ESMTPSA id t11-20020a05600c198b00b00412c8117a34sm10281167wmq.47.2024.03.04.01.01.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Mar 2024 01:01:29 -0800 (PST) From: Ilias Apalodimas To: u-boot@lists.denx.de, trini@konsulko.com, cfsworks@gmail.com Cc: caleb.connolly@linaro.org, sumit.garg@linaro.org, Ilias Apalodimas , Simon Glass , Philipp Tomsich , Kever Yang , Michal Simek , Yegor Yefremov , Heinrich Schuchardt , Shiji Yang , Bin Meng Subject: [PATCH 3/6] arm: fix __efi_runtime_rel_start/end definitions Date: Mon, 4 Mar 2024 11:01:08 +0200 Message-Id: <20240304090113.1410575-4-ilias.apalodimas@linaro.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20240304090113.1410575-1-ilias.apalodimas@linaro.org> References: <20240304090113.1410575-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. 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. Signed-off-by: Ilias Apalodimas Reviewed-by: Sam Edwards Tested-by: Sam Edwards # Binary output identical --- 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(-) 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 90d329b1ebe0..70e78ce46672 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 8d3259821719..66a9e37f9198 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;