From patchwork Fri Mar 15 06:43:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilias Apalodimas X-Patchwork-Id: 1912361 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=rUGbldvJ; 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 4TwvrP3ztpz1yX0 for ; Fri, 15 Mar 2024 17:45:09 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0055987FBC; Fri, 15 Mar 2024 07:44: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=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="rUGbldvJ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 41CAA87FC0; Fri, 15 Mar 2024 07:44:27 +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-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) (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 F2BED87FAA for ; Fri, 15 Mar 2024 07:44:24 +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-wr1-x435.google.com with SMTP id ffacd0b85a97d-33e966f56c7so1808634f8f.0 for ; Thu, 14 Mar 2024 23:44:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710485064; x=1711089864; 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=bjKrvGkOI7iiwRM0lPDhhs6RRG3TK0w+7djk6/pkbKo=; b=rUGbldvJ0cdBhzugyBCaf9WARmE5dcoqfXECUkgO261Tyxy/DpeJ4pV9mwc0oFtAK7 u5JgMZqEeDHYKy/6/jPh9D4eF+59Gys+e/eJuC6/y7sjo1krEPl/Jip6IWHoDpD5sDMT JpPCF+UjweSPpdsMUz7h6MFuBzF9SD2FUTeQ6l9R2e2dITfOvuMbbuZFya6Zcge7BzrJ aFrHIsO3yATOmAIEy18VccAyNBYHFXA6T1WQ/r1PSV9tVg2iVaEOURfqWIhxSW1yo0fz fqHuLnVTeBWkF3f0D+TiDmVtbylXimNimQ2sBmYHRKAeggAjT20HrScgYU1Tzy8ACz77 mVog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710485064; x=1711089864; 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=bjKrvGkOI7iiwRM0lPDhhs6RRG3TK0w+7djk6/pkbKo=; b=K81BaR+zlfWO+lzdwTeaIAd5395reEDVK5W8lCF7nbLk6QrwCR5Y7BiWGl98Qdl051 b/E6zwUxvmX42UlxzdxayNN7hPGlPjekpdj8EonZws4921MnhHttW1FAigYX1GpjSaLr KYiiKN0IgPf40KqDdbYSeqUGhCPa7UaaLtEgcjCv6O78J9JNQeREGtgl3Hz+s+i953go wyJUAnnlewEfR5QJ1qP/rwIPkW97mMhRyqAr2tVnclfpYBlvl3/vnGChggtVG2U1p9hI LgXIyqK7zLoKIiweP0UaCPq/GuUu+SMSy56nWM36VRpWxcoX3zkDraXcjdxtMC54JeY+ Gamw== X-Gm-Message-State: AOJu0Yy829DxDn1tRpeOMLijG/eYuAD6qR/IqF/9JmDOe5vG6Xe+x1h+ seZ5qhP9QShpCaJrKIKMdfEXGeii5l67+j5m7EDeqQgX1Zz7gmCnuxMvz/3LdsbwLpB+gAnnulF u X-Google-Smtp-Source: AGHT+IGmnM0Vst+kD3zlMGFfk+zihOeLh4tUMnebgfB1SDUCcux3wcXKGMFFg8VRFG7hLgvKhq9Fag== X-Received: by 2002:a5d:694c:0:b0:33e:7637:51fd with SMTP id r12-20020a5d694c000000b0033e763751fdmr1697868wrw.48.1710485064344; Thu, 14 Mar 2024 23:44:24 -0700 (PDT) Received: from hades.. (ppp046103107123.access.hol.gr. [46.103.107.123]) by smtp.gmail.com with ESMTPSA id v18-20020adfe4d2000000b0033ec9936909sm2398658wrm.39.2024.03.14.23.44.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Mar 2024 23:44:24 -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 v4 5/7] arm: fix __efi_runtime_start/end definitions Date: Fri, 15 Mar 2024 08:43:49 +0200 Message-Id: <20240315064354.2215266-6-ilias.apalodimas@linaro.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20240315064354.2215266-1-ilias.apalodimas@linaro.org> References: <20240315064354.2215266-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 Reviewed-by: Sam Edwards Reviewed-by: Richard Henderson Tested-by: Sam Edwards # Binary output identical Signed-off-by: Ilias Apalodimas --- 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(-) diff --git a/arch/arm/cpu/u-boot.lds b/arch/arm/cpu/u-boot.lds index 0682d34207fa..6813d8aeb838 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 3b1f0d349356..9eac7de0dcbd 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 */