Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F3A67C433EF for ; Mon, 11 Apr 2022 22:15:25 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5FF6583E27; Tue, 12 Apr 2022 00:15:23 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=gmx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; secure) header.d=gmx.net header.i=@gmx.net header.b="OiSsV+63"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 05AFB83E93; Tue, 12 Apr 2022 00:15:21 +0200 (CEST) Received: from mout.gmx.net (mout.gmx.net [212.227.17.22]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id F3ACA835B9 for ; Tue, 12 Apr 2022 00:15:17 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=xypron.glpk@gmx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1649715315; bh=fNFScd9OJYVy50J5wKBFXOaAkll94TQEiB8oabDeVAE=; h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From:In-Reply-To; b=OiSsV+63upD66NsM1fW2OEM3KsWEyRhGpYRtbpYwWckWdykcwW2GoHIZ4WJbTTXn7 u7PWDH5PwM0fghjLM2IxpgylqEga5u4IqSP3tLjJVAmkE6J1AGD8q1HZFCQZyZOR1C dNVPHevm95jbr2QTy0kiqzYZilP4R5l59ti64+Lg= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.123.94] ([88.152.144.107]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1M5QFB-1ndDV8354H-001OQ9; Tue, 12 Apr 2022 00:15:15 +0200 Message-ID: <1c79cb39-35ea-db00-bec4-91be603f6c19@gmx.de> Date: Tue, 12 Apr 2022 00:15:15 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Subject: Re: [PATCH 01/11] sandbox: Set the EFI symbols in linker script Content-Language: en-US To: Andrew Scull Cc: sjg@chromium.org, seanga2@gmail.com, u-boot@lists.denx.de References: <20220407094123.1752236-1-ascull@google.com> <20220407094123.1752236-2-ascull@google.com> From: Heinrich Schuchardt In-Reply-To: <20220407094123.1752236-2-ascull@google.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:Tq6G9KZaxAmUSxYiqcxduZB/+38py9/IR7CHsVCfSzmeplQVut2 UK6pXCxCDFyE4ObmIOdP1NqCGE8iPZ9ZPEmUZMg/Xew0lSfvIzwbFRahjGHKHoOV2uelJK2 tYBljpOThrrDIAULYt8WyyqkBR9I8xUMkwdapggzQ7gd8CTs3ObQSc2AChcgbi7T2qLLgaU OY5AEEUbtC7HNt1v9YDog== X-UI-Out-Filterresults: notjunk:1;V03:K0:90yMSoo/Hqw=:XMl5f0A3kW/AJawNQfAdEI GzSEssnAnjQ5qx0ppPDJ35DuCSh4O7XyV3rSNx7ey6O2hPdOhhrBaX83HNvJh0dAIsM7T4rEN Xs+koPuA1lF/8zUFqKNEQOb8deXLc6U0ogFmTnrh26ZtaJxuifcd0BDD8lIAwsYYSmVJvPDlj 9XqGVaq5ZR3oqBP2JWdMiXsoVEj1kNqGSely+uGWsyunseBEWmRhqiuaaAjG9EnEZuS4Pv8Cg mEzC4Eg59Gg/38zTRLJKUOdktpxTSatjsFLncdYxgK/RTZvVTsWHbs93kQU5kjkicrPxMIb5Q 6s405UaSQR5gcwToosVdsFtdb6Tx/temaXglv1i4kIsg2xuqJypVXVwZvhLbPJNmPWDxcfyfh ocXlrDV0qx4T4RKagraBGFZpEGwNZmPOge2qJ8EjQHwUBF98OPUojce9QjoOaxRSSMbttbwUO eJoQvCCmZVwuI47e2P5FEl9x0GcWci5Wg74JQD40mZDdeg5Wc0K7rkfRSUIeENK1Jq+tN18uY fUvGwR4oCTTAMO5EqYE3sK823R2KwSDS6JYCOUfsHIs+s5zTHJYTleDqywziS34W1KJVZeO3z tPprs1GC6dcJVWr/rXjqjw55MQIInuQc6MSNBltJsvOvTD8wxCnDMluvy8Ae1JpXo4+GNc9UP L9PzOEZOcsUHe+4kyfFOikR7uN/woR4D44URhO1t7N3aGTRR419O3Z89t+lGrk6RpFF60jTh8 iaY9N7zXC3gRt9RSzDJbFO4ABvAKir10xpu2/yEMgQYalmC4DyMe9UzBG4LtlA7UDkf4nysAc NcO0Jbn9ZgNRUQzwbqkDFyUvVfNIi9D3EJ14EvIiVaNEkSNuoY+TDYSZsgel29HPAALJg7jhh tdufF87iplfIg9LfprB+bkJLxAq9itHcKBUkyydDQs6GbBP6UMAFxw3Hv0kSEfBnghQ6RLJh9 2uAwomiWkAgcm6uMe9l/tb8OBtEUanNExR1Ms1ZW/YVV66zuXwzVZWm9z52mz8aAZPfESa5S/ UpV2SMJ9JRu+GHG0vX7oeMWGmTI2sPs0HsBOad8o1Y7WNy8MPVdhHsjZtkcxGCMv2uX+HWmCg bjWbRlc371e/Aw= 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.5 at phobos.denx.de X-Virus-Status: Clean On 4/7/22 11:41, Andrew Scull wrote: > The sandbox doesn't populate the EFI lists so explicitly set the list > start and end symbols to indicate that the lists are empty. This > simplifies the linker scripts, removed references to non-existant > sections and removes '.' prefixed sections that conflicted with clang's > ASAN. In u-boot.map I see: 10636 .text.efi_runtime 10637 0x00000000000df50a 0x72d /tmp/cctuEBRS.ltrans19.ltrans.o 10638 0x00000000000df50a efi_get_time 10639 0x00000000000df519 efi_set_time 10640 0x00000000000df528 efi_unimplemented.lto_priv.0 10641 0x00000000000df54a efi_update_capsule_unsupported 10642 0x00000000000df559 efi_query_capsule_caps_unsupported So there are definively functions that should go between __efi_runtime_start and __efi_runtime_stop. If ._efi_runtime_start =3D=3D .__efi_runtime_stop, there is a bug in the linker script. Deleting the symbols is the wrong way to deal with this deficiency. Instead ensure correct placement of the functions marked as __efi_runtime and the data marked as __efi_runtime_data. Best regards Heinrich > > Signed-off-by: Andrew Scull > --- > arch/sandbox/cpu/u-boot.lds | 32 +++++--------------------------- > arch/sandbox/lib/Makefile | 2 +- > arch/sandbox/lib/sections.c | 13 ------------- > 3 files changed, 6 insertions(+), 41 deletions(-) > delete mode 100644 arch/sandbox/lib/sections.c > > diff --git a/arch/sandbox/cpu/u-boot.lds b/arch/sandbox/cpu/u-boot.lds > index 6d710618f5..dd675cc3d2 100644 > --- a/arch/sandbox/cpu/u-boot.lds > +++ b/arch/sandbox/cpu/u-boot.lds > @@ -19,33 +19,11 @@ SECTIONS > *(.u_boot_sandbox_getopt_end) > } > > - .__efi_runtime_start : { > - *(.__efi_runtime_start) > - } > - > - .efi_runtime : { > - *(efi_runtime_text) > - *(efi_runtime_data) > - } > - > - .__efi_runtime_stop : { > - *(.__efi_runtime_stop) > - } > - > - .efi_runtime_rel_start : > - { > - *(.__efi_runtime_rel_start) > - } > - > - .efi_runtime_rel : { > - *(.relefi_runtime_text) > - *(.relefi_runtime_data) > - } > - > - .efi_runtime_rel_stop : > - { > - *(.__efi_runtime_rel_stop) > - } > + /* Sandbox has empty EFI runtime lists. */ > + __efi_runtime_start =3D .; > + __efi_runtime_stop =3D __efi_runtime_start; > + __efi_runtime_rel_start =3D .; > + __efi_runtime_rel_stop =3D __efi_runtime_rel_start; > > .dynsym : > { > diff --git a/arch/sandbox/lib/Makefile b/arch/sandbox/lib/Makefile > index a2bc5a7ee6..05f06180f8 100644 > --- a/arch/sandbox/lib/Makefile > +++ b/arch/sandbox/lib/Makefile > @@ -5,7 +5,7 @@ > # (C) Copyright 2002-2006 > # Wolfgang Denk, DENX Software Engineering, wd@denx.de. > > -obj-y +=3D fdt_fixup.o interrupts.o sections.o > +obj-y +=3D fdt_fixup.o interrupts.o > obj-$(CONFIG_PCI) +=3D pci_io.o > obj-$(CONFIG_CMD_BOOTM) +=3D bootm.o > obj-$(CONFIG_CMD_BOOTZ) +=3D bootm.o > diff --git a/arch/sandbox/lib/sections.c b/arch/sandbox/lib/sections.c > deleted file mode 100644 > index 2559eeea38..0000000000 > --- a/arch/sandbox/lib/sections.c > +++ /dev/null > @@ -1,13 +0,0 @@ > -// SPDX-License-Identifier: GPL-2.0+ > -/* > - * Copyright 2013 Albert ARIBAUD > - * > - */ > -#include > - > -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");