From patchwork Fri Jun 14 06:53:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilias Apalodimas X-Patchwork-Id: 804149 Delivered-To: patch@linaro.org Received: by 2002:a5d:6545:0:b0:35b:5a80:51b4 with SMTP id z5csp170149wrv; Thu, 13 Jun 2024 23:54:12 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXxLmP8FZOdl+pDTNLRVc6bH9HVHKzsYk038S64Ir8/KtUH9QPOjqPYh9PB8bJi1x6x4NSfe11dY7RYigDbk6HW X-Google-Smtp-Source: AGHT+IFG6AYAYmkxzEn905eYhMzdIXjhDyBLFpDVksiPwutFybH9lLnLYwTjFzkbbIdq4wRJN4dA X-Received: by 2002:a17:907:c713:b0:a6f:69ee:dcd2 with SMTP id a640c23a62f3a-a6f69eee6famr29013966b.57.1718348052345; Thu, 13 Jun 2024 23:54:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1718348052; cv=none; d=google.com; s=arc-20160816; b=Q2TYhj7KxKLgsXlnXigOq4U1xjm84DNEqAJ3fIhBgokjd1b92UZgHw7WQyCoc8PGnR PC9KFwdacAPU+F5G9m1jaHNMJvGcgA3A7zzdm3gbjM/Kw8OhMmSV9KSlyNSIRiE4uAAl BxjKNmMEnR9pSrxwe+BHpeqxzAvlvU9GLDlrkB3cvn3Jtf98bcuieJT1mqjmWNhZH/LD SdN9ZAlDrv/JJv63fFOMcjWezTXPD90uTQi/qonB7hQv/iP4yRA7EKGSBS3sCoYNkA8W aosiwCpFFrp38ymkmx9qOL63nmcWGhWr25u4vW8dlCIKx33hXXyU/X31pNjfbAXseqBL XUWA== 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:message-id:date:subject:cc:to:from:dkim-signature; bh=tXyC2hSxrSy8HIszYxHGrY3fviY0Db+JHvksS1U04QU=; fh=65x0aHg+YSjTEPSbZhrVa+F9GlfK2Noa5D6wy10Wsxc=; b=WGKHeFmn65z9kZR9I+jcW7htaHBMAExkCg+gwqJqqzyyXZi1VhF+/KsvbQ/OEDUijk Jvitt9vJ42lwcNQeZFGMunrz102Qd/WvzHTYyR36h3tdYtDFXz3bCQhCX+2RYMFMapnw MUUAQ4/O/7fETCSK6Ir8gE1IcIFmoZRqpEs/cRe3HNlrBObbvEX19oV9E7B/bePA66YP pZw5mAvHiKXmS9QNiID7DRnjYLBENeqrNPoZ7v7PtFcjNvvfu6IEDhjiQlV4qU1PpnZC QIpEh8ShPhdmnyfT5+AFMJUigkr4Ol+UJrxZj6czxZ51AOXPsgHe1xPMAHksNtDoV9hm i/7g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jEjhcxKZ; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 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. [85.214.62.61]) by mx.google.com with ESMTPS id a640c23a62f3a-a6f57ee2f45si142128666b.114.2024.06.13.23.54.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jun 2024 23:54:12 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jEjhcxKZ; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 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 EB97988081; Fri, 14 Jun 2024 08:54:10 +0200 (CEST) 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="jEjhcxKZ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8104E87E96; Fri, 14 Jun 2024 08:54:10 +0200 (CEST) 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-lf1-x129.google.com (mail-lf1-x129.google.com [IPv6:2a00:1450:4864:20::129]) (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 4C6588897B for ; Fri, 14 Jun 2024 08:54:08 +0200 (CEST) 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-lf1-x129.google.com with SMTP id 2adb3069b0e04-52c32d934c2so2000694e87.2 for ; Thu, 13 Jun 2024 23:54:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1718348047; x=1718952847; darn=lists.denx.de; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=tXyC2hSxrSy8HIszYxHGrY3fviY0Db+JHvksS1U04QU=; b=jEjhcxKZxr+IWMBezOVorDtx/Z6UvQNMG/F2Iso4SybkRRGwyftQeiWhWd47h4UHeW GFNg0TAgp6T9cC7jPStUnylYApVbx91zoXLili4oAetQU0jSHOYxEnJpjLMQu+Ne6svm f4OHyXG4Se31p5W5hlTPtEKORYHUvO1bTvplZyq7Qx7E//j3wZrczwfjsYjTa81aX2ID Hkz7BtDcHZ9Jb5f3g2zq6tMdZvRJHQU1zl/JPqHfk4/fTXH1dSxNneStgpEjdKZusHG/ 1+XlLPhMHqCX4u7XPmGbi3yfYCp83zyFgYlj9WyoWTw9wqIzcCNJYmCym5yLkCChYEVz ZQKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718348047; x=1718952847; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=tXyC2hSxrSy8HIszYxHGrY3fviY0Db+JHvksS1U04QU=; b=C9NSY1m3H8rhi6fSSfJFTvy7QmmTooCGsdLeiTGTQr1Une+i6axmEf1jBOARo0VMYC nMdCIEl4rUd8H9ov42KISGTMOF7TRi9UzONInT9CbhMxYPciqdSC5sc/krcIKvGAxm9w 6uTBpgLg8UuEdmqDuDSCdv73UW92LRyn6iScELCC+UXhdT7wH5y3m6bbrJu5TGCxdn// hhNlBtyZvz5y3+csSVS48/ezcwP2pBs3sE3cLiGaUOxbzNcMWjtLjVljOrTPXI6MfbQl tr28JVGEV15fhpx0M8cm7NHZE3sQUm+I6Q3bTaLh2CqULaSqTIe6K+vK/nkfrYHrAxIZ 83Xg== X-Forwarded-Encrypted: i=1; AJvYcCW7jQdO7YRxQoaSxPLh9PqUqbCwD/DtE6neC6WQj0PjRQQTQhQ+nWPVPRizXMl1zIAjL9yLgTkldTdHe9ikyBTBIoXp8w== X-Gm-Message-State: AOJu0YxfUfrtZJuJLwSrFTL6dTW4eErVmlm/IqFJzyT0KRVEoZnNbP8G UE1Qbu1816aeqL7qsYZygEMgUq7mUt4JXrlSEEXMkX1pWUrYnjVIqxk18jdUq5s= X-Received: by 2002:ac2:4db9:0:b0:52c:5252:55c2 with SMTP id 2adb3069b0e04-52ca6e9a0d4mr982108e87.64.1718348047517; Thu, 13 Jun 2024 23:54:07 -0700 (PDT) Received: from localhost.localdomain (ppp046103020130.access.hol.gr. [46.103.20.130]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36074e0e5adsm3531579f8f.0.2024.06.13.23.54.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jun 2024 23:54:06 -0700 (PDT) From: Ilias Apalodimas To: sjg@chromium.org Cc: Ilias Apalodimas , Tom Rini , Heinrich Schuchardt , Angelo Dureghello , u-boot@lists.denx.de Subject: [PATCH] sandbox: cleanup linker scripts and sections Date: Fri, 14 Jun 2024 09:53:56 +0300 Message-ID: <20240614065357.182446-1-ilias.apalodimas@linaro.org> X-Mailer: git-send-email 2.45.1 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 commit 6e2228fb052b ("Merge patch series "Clean up arm linker scripts"") was cleaning up linker scripts for armv7 and v8 in a similar fashion. Several commits in the past -- e.g commit d0b5d9da5de2 ("arm: make _end compiler-generated") was moving symbols to be compiler generated. They were defined as c variables in its own section to force the compiler emit relative a reference. However, defining those in the linker script will do the same thing since [0]. So let's remove the special sections from the linker scripts, the variable definitions from sections.c, and define them as a symbols. It's worth noting that the linker was discarding the symbols in the older binary completely. - new binary $~ aarch64-linux-gnu-readelf -sW u-boot | grep efi_runtim 246: 000000000004acbe 13 FUNC LOCAL DEFAULT 14 vbe_req_efi_runtime_rand 3198: 0000000000318690 16 OBJECT LOCAL DEFAULT 29 efi_runtime_mmio 6359: 00000000000dedff 217 FUNC LOCAL DEFAULT 14 efi_runtime_relocate 7942: 00000000003074c0 136 OBJECT GLOBAL HIDDEN 29 efi_runtime_services 8869: 0000000000305e20 0 NOTYPE GLOBAL DEFAULT 27 __efi_runtime_rel_stop 9159: 0000000000305e20 0 NOTYPE GLOBAL DEFAULT 27 __efi_runtime_stop 9410: 0000000000305e20 0 NOTYPE GLOBAL DEFAULT 27 __efi_runtime_start 10137: 00000000005981bd 0 NOTYPE WEAK HIDDEN 33 efi_runtime.c.de5bed54 10470: 0000000000305e20 0 NOTYPE GLOBAL DEFAULT 27 __efi_runtime_rel_start - old binary $~ aarch64-linux-gnu-readelf -sW u-boot.old | grep efi_runtim 246: 000000000004acbe 13 FUNC LOCAL DEFAULT 14 vbe_req_efi_runtime_rand 3198: 0000000000318690 16 OBJECT LOCAL DEFAULT 29 efi_runtime_mmio 6359: 00000000000dedff 221 FUNC LOCAL DEFAULT 14 efi_runtime_relocate 7942: 00000000003074c0 136 OBJECT GLOBAL HIDDEN 29 efi_runtime_services 10135: 0000000000598320 0 NOTYPE WEAK HIDDEN 33 efi_runtime.c.de5bed54 $~ bloat-o-meter u-bool.old u-boot add/remove: 0/0 grow/shrink: 1/1 up/down: 7/-4 (3) Function old new delta efi_memory_init 343 350 +7 efi_runtime_relocate 221 217 -4 Total: Before=2009902, After=2009905, chg +0.00% [0] binutils commit 6b3b0ab89663 ("Make linker assigned symbol dynamic only for shared object") Signed-off-by: Ilias Apalodimas Tested-by: Heinrich Schuchardt Reviewed-by: Simon Glass --- arch/sandbox/cpu/u-boot.lds | 20 ++++---------------- arch/sandbox/lib/Makefile | 2 +- arch/sandbox/lib/sections.c | 13 ------------- 3 files changed, 5 insertions(+), 30 deletions(-) delete mode 100644 arch/sandbox/lib/sections.c -- 2.45.1 diff --git a/arch/sandbox/cpu/u-boot.lds b/arch/sandbox/cpu/u-boot.lds index 52f13af3742f..6ee8095b6cbb 100644 --- a/arch/sandbox/cpu/u-boot.lds +++ b/arch/sandbox/cpu/u-boot.lds @@ -19,30 +19,18 @@ SECTIONS *(_u_boot_sandbox_getopt_end) } - efi_runtime_start : { - *(___efi_runtime_start) - } - efi_runtime : { + __efi_runtime_start = .; *(efi_runtime_text) *(efi_runtime_data) - } - - efi_runtime_stop : { - *(___efi_runtime_stop) - } - - efi_runtime_rel_start : { - *(___efi_runtime_rel_start) + __efi_runtime_stop = .; } efi_runtime_rel : { + __efi_runtime_rel_start = .; *(.relefi_runtime_text) *(.relefi_runtime_data) - } - - efi_runtime_rel_stop : { - *(___efi_runtime_rel_stop) + __efi_runtime_rel_stop = .; } .dynsym : diff --git a/arch/sandbox/lib/Makefile b/arch/sandbox/lib/Makefile index a2bc5a7ee60f..d7d15a50bb6c 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 += fdt_fixup.o interrupts.o sections.o +obj-y += fdt_fixup.o interrupts.o obj-$(CONFIG_PCI) += pci_io.o obj-$(CONFIG_CMD_BOOTM) += bootm.o obj-$(CONFIG_CMD_BOOTZ) += bootm.o diff --git a/arch/sandbox/lib/sections.c b/arch/sandbox/lib/sections.c deleted file mode 100644 index 2f2f3fbfdb86..000000000000 --- 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");