From mboxrd@z Thu Jan 1 00:00:00 1970 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 9FD11C433EF for ; Mon, 30 May 2022 10:01:15 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E570E843DD; Mon, 30 May 2022 12:00:54 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=google.com 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=google.com header.i=@google.com header.b="g84lx8GE"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 39EA8843B3; Mon, 30 May 2022 12:00:39 +0200 (CEST) Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com [IPv6:2607:f8b0:4864:20::b4a]) (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 4447984386 for ; Mon, 30 May 2022 12:00:32 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=3vpWUYgYKBlczH1JAA5DD5A3.1DBJ-0DDIA7HIH.23CM.23@flex--ascull.bounces.google.com Received: by mail-yb1-xb4a.google.com with SMTP id 10-20020a250d0a000000b0065ca0e7be90so3846097ybn.17 for ; Mon, 30 May 2022 03:00:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=TZfn+2Kxarg4GzLbsX+MIHE01gP/+ke5P3IQTgTDwbY=; b=g84lx8GEL+ieKOHxQvoIV7cLdUAw0eTZQNWdVoHwoQu4hns8fmF33w1a2PugoW56yl Q+gBkmUbBekjb4/5UfybRWghV6004iCVNsBrH7XotjgLtj49X9x9C4XDKAgEFOYd0Z7K uDRwxoPx73FSoojDUMXJGlpm9oI/gGUTYz5ESPkt3YRaUIHOkqIGDVFzU05ceBCCu3UJ YuAAE+pl1yAbuLiLdZGtQR9ScZKwOlYu/ezOY/es48AQcI6GFfs8cbUpYntEstySPU/z T4k2uRjyC354q+weM0h/48OjPq+5YBcKdXLWapC4W+L4cxK7cTVStF0uLw2OxwArLQgm 5+yw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=TZfn+2Kxarg4GzLbsX+MIHE01gP/+ke5P3IQTgTDwbY=; b=WtB9fADRosgv7lvDvVFaClMvMnyYMVgCdzOXKptvC7XdqClhWbTS++PHIJKdnARnOE qGfDwtVmPQoDTIyhAJbjflAVJG5jShXPeroO94H0+fHNXR6fWI0HWfL3DQXNGlG+UfrC LoPLBK2TQDA4okiAeoRKzpx4CdhxBUa97tv6r0ocSIuCBONDDSWzottHAlKdCu8NUOEw /8QkTYMXL9rhB2Qej1rV2q9eVrydyuUlndvo02Y184QXtdGzVfiBv2qtPrbGf/5v64S7 O3tyLnWRQWdQFnfjO1YC3a5c0O6Inf1HOk0ooCueTfkj/JxYHgNO41glYrRtB2HXymaz q3oA== X-Gm-Message-State: AOAM5317dwVFiMIXp/9oaoeu+dqmAwv/FkRQb/ZOcK8b3iphWad1dnx5 vCw+pr9t1594Qawy1YfrSTBh/Upf60xE/AfvykuM8PtvXAmfkSe1bXbDlBIfT0xBROpj/NPHOOY Q2sFbTQnWbI20VgJa87hObm2QkZbkOBvWJ0+RlIXHPx6mEBU6F/abRSwpR20= X-Google-Smtp-Source: ABdhPJzMgHTorzpt7Zozy1cwe/LWzIUBK78bBN6mTGNEBn/J9O3Hfl11scApdMuqin0pF0wxeLh9UY7jKlw= X-Received: from ascull.c.googlers.com ([fda3:e722:ac3:cc00:28:9cb1:c0a8:1510]) (user=ascull job=sendgmr) by 2002:a25:7307:0:b0:65c:b98a:f592 with SMTP id o7-20020a257307000000b0065cb98af592mr6899773ybc.380.1653904830686; Mon, 30 May 2022 03:00:30 -0700 (PDT) Date: Mon, 30 May 2022 10:00:02 +0000 In-Reply-To: <20220530100013.3753780-1-ascull@google.com> Message-Id: <20220530100013.3753780-3-ascull@google.com> Mime-Version: 1.0 References: <20220530100013.3753780-1-ascull@google.com> X-Mailer: git-send-email 2.36.1.124.g0e6072fb45-goog Subject: [PATCH v3 02/13] sandbox: Rename EFI runtime sections From: Andrew Scull To: u-boot@lists.denx.de Cc: sjg@chromium.org, trini@konsulko.com, xypron.glpk@gmx.de, jonbottarini@google.com, seanga2@gmail.com, Andrew Scull Content-Type: text/plain; charset="UTF-8" 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 Rename the sections used for placing the EFI runtime so that they don't start with a '.'. ELF says that sections starting with a '.' are reserved for system use, but the sandbox runs as a normal user process so should be using user sections instead. Clang's ASAN adds redzones to non-user sections and the extra padding meant that the list of options was being corrupted. Naming the sections as user sections avoids this issue as clang handles them as we intended. Signed-off-by: Andrew Scull --- arch/sandbox/cpu/u-boot.lds | 22 ++++++++++------------ arch/sandbox/lib/sections.c | 8 ++++---- 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/arch/sandbox/cpu/u-boot.lds b/arch/sandbox/cpu/u-boot.lds index 92e834a8d2..d2cb12fc29 100644 --- a/arch/sandbox/cpu/u-boot.lds +++ b/arch/sandbox/cpu/u-boot.lds @@ -19,32 +19,30 @@ SECTIONS *(.u_boot_sandbox_getopt_end) } - .__efi_runtime_start : { - *(.__efi_runtime_start) + efi_runtime_start : { + *(___efi_runtime_start) } - .efi_runtime : { + efi_runtime : { *(efi_runtime_text) *(efi_runtime_data) } - .__efi_runtime_stop : { - *(.__efi_runtime_stop) + efi_runtime_stop : { + *(___efi_runtime_stop) } - .efi_runtime_rel_start : - { - *(.__efi_runtime_rel_start) + efi_runtime_rel_start : { + *(___efi_runtime_rel_start) } - .efi_runtime_rel : { + efi_runtime_rel : { *(.relefi_runtime_text) *(.relefi_runtime_data) } - .efi_runtime_rel_stop : - { - *(.__efi_runtime_rel_stop) + efi_runtime_rel_stop : { + *(___efi_runtime_rel_stop) } .dynsym : diff --git a/arch/sandbox/lib/sections.c b/arch/sandbox/lib/sections.c index 2559eeea38..2f2f3fbfdb 100644 --- a/arch/sandbox/lib/sections.c +++ b/arch/sandbox/lib/sections.c @@ -5,9 +5,9 @@ */ #include -char __efi_runtime_start[0] __section(".__efi_runtime_start"); -char __efi_runtime_stop[0] __section(".__efi_runtime_stop"); +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"); + __section("___efi_runtime_rel_start"); char __efi_runtime_rel_stop[0] - __section(".__efi_runtime_rel_stop"); + __section("___efi_runtime_rel_stop"); -- 2.36.1.124.g0e6072fb45-goog