From f0a5d2dfaae6b895e7eb02c67271cc3eba5ee6c8 Mon Sep 17 00:00:00 2001 From: Ilias Apalodimas Date: Mon, 17 Jun 2024 18:14:18 +0300 Subject: sandbox: cleanup linker scripts and sections 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 since the symbol definition had an extra _. - 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") Tested-by: Heinrich Schuchardt # sandbox_defconfig on amd64, arm64, riscv64 Reviewed-by: Simon Glass Fixes: commit aac53d3d96a2 ("sandbox: Rename EFI runtime sections") Signed-off-by: Ilias Apalodimas --- arch/sandbox/lib/sections.c | 13 ------------- 1 file changed, 13 deletions(-) delete mode 100644 arch/sandbox/lib/sections.c (limited to 'arch/sandbox/lib/sections.c') diff --git a/arch/sandbox/lib/sections.c b/arch/sandbox/lib/sections.c deleted file mode 100644 index 2f2f3fbfdb8..00000000000 --- 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"); -- cgit v1.2.3