From patchwork Wed Feb 28 10:48:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilias Apalodimas X-Patchwork-Id: 776455 Delivered-To: patch@linaro.org Received: by 2002:adf:e94d:0:b0:33d:f458:43ce with SMTP id m13csp226965wrn; Wed, 28 Feb 2024 02:49:24 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUaeo1QvZiXIAb22Ey4Ppa4UabwyjnVearJ1S1qFqZu107KJ7HJBdtL4ZaH4/qjqXICuodKfAa8lyOXkkyO9J7L X-Google-Smtp-Source: AGHT+IH3uxiANVxAVHkiRrVF/NYfI+LF1FxhiWDDZNjuyDhmdy/rYM6JqhD9Ly6Egu78hF8AusPz X-Received: by 2002:a2e:b8c7:0:b0:2d2:64ef:9be9 with SMTP id s7-20020a2eb8c7000000b002d264ef9be9mr8774515ljp.50.1709117364451; Wed, 28 Feb 2024 02:49:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709117364; cv=none; d=google.com; s=arc-20160816; b=CAljmlIuEIdJlqdq2EQJkqYHu1a2kps2sDe4CWANJOHhrkH47fTnZVerc+Ttif+ne6 Paedfw0s+WRQnpD5ENPiDyBgoBryWP70szz/XUklKxvGMWjm9zaVWFeKDVz265+TM17S LmXODbeKW1PUSa7rK+Vk6ddlEMWILP6Mtj5NuEFz9ZPKG5RIeNaJvOK2gJYtHA6PIKg5 QJ5wz4tQezKjrjdeEQI/UGz+lmGWmpi9s8VtiQqNh9wT5YTYa38EseMDXAlqDg0LVoiD 643ZyKIW8+tfFL380KrLzvNfQ5zXA58OmTsW3Gb4lcLSn4o1A+EJOqhIflPwObWinrrC niRA== 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=Qc7Bwm8F6A6m2T1dNMTqiCGSn6FsxQ9ndhZ8EDBeZTo=; b=cHYxV/lnDnptOxuW+dh1qGE/Tmpp4m+1YJJwTq7zX8mHOWVCUXIC0uipvPA8iTvCWZ kyBccHRpwlQVA8mMlfEnSR4URCQmCIMUkYZkdVXLYrVjjoL/i6G+LRYb6cMuvn2Rozjh r5/N+j6DRJIY0R0BBm3KvEIagr99IrWcqFkB1TRUBwLD3u71Y9BwvZ8jjtGBArQPonnQ NA6W7dhqC1HW8IXWsQgGKByObxdb8V4Y7TRh2TzQZgDd/kV6MvRElyMVJHz4PQ7BMeC4 AyHhS/NBnFQMkuFYvJ74nn17aF0MLrLhhQbv0VDA0emWbrgSZ6xIEzaijbOjPp73WlWi aVZA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FJRMU1uc; 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 u6-20020a05600c19c600b00412a33731c8si696889wmq.202.2024.02.28.02.49.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 02:49:24 -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=FJRMU1uc; 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 8F8FC88026; Wed, 28 Feb 2024 11:48:47 +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="FJRMU1uc"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id CA54B88007; Wed, 28 Feb 2024 11:48:45 +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-lj1-x22c.google.com (mail-lj1-x22c.google.com [IPv6:2a00:1450:4864:20::22c]) (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 B04468807C for ; Wed, 28 Feb 2024 11:48:42 +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-lj1-x22c.google.com with SMTP id 38308e7fff4ca-2d2305589a2so75605461fa.1 for ; Wed, 28 Feb 2024 02:48:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709117322; x=1709722122; 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=FJRMU1ucFh0EprrSU+gO16Z0QSOgpOhEpvFhoR49GGTJM4e1XhM5FEXp1kXDMq8rjI jDmXSwAcEffyWp2WmUfLPbZKO0dEKyDtdHUf7xM1syJAP/l6ezZ+krX7Qe9Stop5FuE+ GitaOZKRzUIYkDr40dxJ8yABygrBAD6cQW7iiR/7n3NrB6rO6nLO38Lo2cWm0L+YSYg9 ExIy+5vLXsOQBeVvQfZkCgN4FylIwn7BO8a27qc0JG5Y2iis58JNSFlzb3g9NDd+k/4H 0CUi9mj0rLLIniugNrZh97J8GswrY+KYiqRKSLgwGQfAUJf0fuA3IzEZSZLL/oKsiMP8 bxbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709117322; x=1709722122; 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=NH1VPGxk2WjhNVosXb18loGHTXbK0OfID2VJs7+9Wyy4+rgPSEylaoAKLnBJBbVWTN AyF4qdd+EwcRahd6UUndyo+LX9ezJakM2tQPG2hgL8Nu9SiJWJISw1ADveT775WM8EoW 94zfjXX+RUxIO+Tuzp5yV1l+lyB/+6ngmDvY0vgGy0KxIijU2uZrUb+TepzF6vxlDGuK 04h+vi6MJd0lG7vXcMqhBHmQd2LP/EJjwrDs9DUVbZBuDubdbT+J72H9IvhsVLkWS5zH 93bEIvT1HLZ2eTPDsqHZi17PmAcsKxO4NcozxPreV+5FifaDRpwgeHjFhcezX17CcEy2 Jprw== X-Gm-Message-State: AOJu0Yw569i5L7X3q3iZa7FNT1wGjfam1pYd3vYnyM03DhM02pEdyYSh m1mlRIqa25BEKskwGWs4lbzYTnkETqirkTPy0sDju6hpxWGc6wxWc5YsoDwUQH1wQm5ffraHeJN WKpQ= X-Received: by 2002:a2e:8e90:0:b0:2d2:2e7a:e070 with SMTP id z16-20020a2e8e90000000b002d22e7ae070mr7500431ljk.10.1709117321898; Wed, 28 Feb 2024 02:48:41 -0800 (PST) Received: from hades.. ([78.87.146.252]) by smtp.gmail.com with ESMTPSA id x1-20020a05600c2a4100b00410dd253008sm1680314wme.42.2024.02.28.02.48.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 02:48:41 -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 , Jorge Ramirez-Ortiz , Yegor Yefremov , Heinrich Schuchardt , Shiji Yang , Bin Meng Subject: [RFC PATCH 3/6] arm: fix __efi_runtime_rel_start/end definitions Date: Wed, 28 Feb 2024 12:48:06 +0200 Message-Id: <20240228104811.1366694-4-ilias.apalodimas@linaro.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20240228104811.1366694-1-ilias.apalodimas@linaro.org> References: <20240228104811.1366694-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 --- 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 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;