From patchwork Wed Mar 13 16:23:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilias Apalodimas X-Patchwork-Id: 780034 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:ed0:b0:33e:7753:30bd with SMTP id ea16csp9618wrb; Wed, 13 Mar 2024 09:23:45 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVwCk9/kht+1VEPdfs1PyXfwlDMVN+FjKnZQ2kPnLEZUloeUZLQCD/v3YikG4ldEcMyvv+kHyJf3NX81jiSH9nd X-Google-Smtp-Source: AGHT+IHXaohO6RMJTHXBtl8cX23CtobwxCSjL4k2Au+sBmGXb1qFBrlGT6erwXzgj8qA8PLFi7EK X-Received: by 2002:adf:a4d7:0:b0:33e:c0ff:9f19 with SMTP id h23-20020adfa4d7000000b0033ec0ff9f19mr191592wrb.21.1710347025273; Wed, 13 Mar 2024 09:23:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1710347025; cv=none; d=google.com; s=arc-20160816; b=yj4yZ3U+IsDmgkx/szdFNUXCwk091faC54I7FuVz5lRgKp8NvElW+xre8PLStJXICx gah54pH1/hrI/hn4eTsLTHei06kByaLcsCDKXhwJ3gax/9G07thIUEnLC55Az8Az3BqG 8LCU+DZEtMvSQwwrUSiUUu+YUEgBFokQxA7VLM4uBn5CKgCtfGgYZUaeopqo46wW2NH8 92wtZHdGzo2awiPeZAa6I1Imwrjz3ysGzyl8L/ihdvgp3hFk/U6Hsptzfkw0vALg2tiI 149TcAZyPLbpJSQ/o4YjQQNIoyrxPwcrMiV7/ZAAf1gmb2wArEtM3rdCPOcjzNZGZqW/ Mj7A== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=axqi5l4Ztq3WiIi5s/5Po9WAHf/Ep2gUDdwyUWhnccw=; fh=YgAnvytc3PkIme27WTI0tmSPC4jrks+Z9IcIvi2eGZA=; b=OjtgWeogyeQNXuW36MvkbCB+Yq5/NqtVnzLa+8Yi9bkZB3Y/8HLE5+2Bzq7keJyUmO +9+vwRnYlBF9kX1+MSIBktYH/tFTz/ENTaUbKp3SFgZubaFdF9fG5GvSfJnkzZKDzqyK idiCkxXHjiITfzJSlYdDNTIJX5mD40QTArmMdJyV4UGGDN2hx5awPfDRvn71u2trsDC8 ZNhkXSOZ65u11ofgN0eUgTi2rGsCIZDP+xEyecMxoiNKGiCU5HQm6ebymPJh6MJ3fhci s0MNqFk06WWJ3RDShiVa13KjKBHlSkf8tjKFBiGmtauFO6UPLFQ868cVciQRhINSlRFa gCwQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UlVWtSGC; 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 w7-20020a05600018c700b0033e9f810f3dsi2730614wrq.1057.2024.03.13.09.23.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 09:23:45 -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=UlVWtSGC; 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 7D00E87EB7; Wed, 13 Mar 2024 17:23:38 +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="UlVWtSGC"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 42A908272A; Wed, 13 Mar 2024 17:23:37 +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-ej1-x636.google.com (mail-ej1-x636.google.com [IPv6:2a00:1450:4864:20::636]) (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 3009387EA8 for ; Wed, 13 Mar 2024 17:23:35 +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-ej1-x636.google.com with SMTP id a640c23a62f3a-a36126ee41eso978066b.2 for ; Wed, 13 Mar 2024 09:23:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710347014; x=1710951814; 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=axqi5l4Ztq3WiIi5s/5Po9WAHf/Ep2gUDdwyUWhnccw=; b=UlVWtSGCqSJA5FZ67DAdniQYfEJPKFm6TAwdbayksSfyo00H/BOEhqMzJhvhglA2ro u2RqQzULio3K/xpK2Oso1g2RfDN0AWnPa/dQ54EB4kaC0LCEYmj73XoWcD9Yff+DOf5I Cpuz8nTAOhqmJIECyUd5cJrOha++6q9EMbyLAZxe/mJPw9/CQkbmELaTOGevFGBS+ETu /owvefH434kUHyRWxoHjvyIRVSltFSo964yAkTfIlwC0kDOQil+hHZXSiRCz8LJNtxMX UnQlde6i2L09m2dPtjTN4hT6EfNMPBA6vo5YW68ZhWxvMZy7Ka3Ugm485WnrZ/flzfrV 7A4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710347014; x=1710951814; 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=axqi5l4Ztq3WiIi5s/5Po9WAHf/Ep2gUDdwyUWhnccw=; b=Mti1O8m6l/zR8Cnfg1IswXfHt6ArFEz421z/4vaxB5b3l/+kdLzz6Z5e/jv+eqq1R/ ZHqY6bMbKPuWj247ok1mqm3LUO/V6d6sq9LqK7XqGa9LSu+jWmBCHYF1+bdRaJ4fHlcb AhNLWWTy4QlXM8iBi9fSEmt/0C+raay8dSlwR4zrpHuK83hJTwHanvSDvRLAfY2JaKXc oAM9svKHbO/ok3cAcqyAZE4td6H+hNbKX6osvEa8pwPnJ7/TAbTZ+cA8oR+Wk/3DUIv+ MeLtdXjbBC8CykKfX3HvxWkJPh/nF85Y9YLG8DmpLAag3hK8dNpSlMdI2Bul7ih5gDwc jH2w== X-Gm-Message-State: AOJu0YwnoutmxXPJXf8R5WspxN6kukLDxIZrhHFaxL0bo08b7PC8GJ4m EUqFZqst5txtHKa9k4Qgs0wKXX/7TnrlzbKIFbiR62yjzvxjna0JKzIwF/sXSkWVb9SBC8vPvrk v X-Received: by 2002:a17:906:4ac1:b0:a40:bff7:6e73 with SMTP id u1-20020a1709064ac100b00a40bff76e73mr8244218ejt.36.1710347014520; Wed, 13 Mar 2024 09:23:34 -0700 (PDT) Received: from hades.. (ppp046103107123.access.hol.gr. [46.103.107.123]) by smtp.gmail.com with ESMTPSA id bh21-20020a170906a0d500b00a44efa48c24sm4998860ejb.117.2024.03.13.09.23.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 09:23:34 -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 , Ryan Chen , Chia-Wei Wang , Aspeed BMC SW team , Joel Stanley , Simon Glass , Philipp Tomsich , Kever Yang , Michal Simek , Yegor Yefremov , Heinrich Schuchardt , Sam Edwards , Shiji Yang , Bin Meng Subject: [PATCH v3 1/7] arm: baltos: remove custom linker script Date: Wed, 13 Mar 2024 18:23:15 +0200 Message-Id: <20240313162324.2117909-2-ilias.apalodimas@linaro.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20240313162324.2117909-1-ilias.apalodimas@linaro.org> References: <20240313162324.2117909-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 commit 3d74a0977f514 ("ti: am335x: Remove unused linker script") removed the linker script for the TI variant. This linker script doesn't seem to do anything special and on top of that, has no definitions for the EFI runtime sections. So let's get rid of it and use the generic linker script which defines those correctly Signed-off-by: Ilias Apalodimas Reviewed-by: Tom Rini --- board/vscom/baltos/u-boot.lds | 128 ---------------------------------- 1 file changed, 128 deletions(-) delete mode 100644 board/vscom/baltos/u-boot.lds diff --git a/board/vscom/baltos/u-boot.lds b/board/vscom/baltos/u-boot.lds deleted file mode 100644 index cb2ee6769753..000000000000 --- a/board/vscom/baltos/u-boot.lds +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Copyright (c) 2004-2008 Texas Instruments - * - * (C) Copyright 2002 - * Gary Jennejohn, DENX Software Engineering, - * - * See file CREDITS for list of people who contributed to this - * project. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA - */ - -OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm") -OUTPUT_ARCH(arm) -ENTRY(_start) -SECTIONS -{ - . = 0x00000000; - - . = ALIGN(4); - .text : - { - *(.__image_copy_start) - *(.vectors) - CPUDIR/start.o (.text*) - board/vscom/baltos/built-in.o (.text*) - *(.text*) - } - - . = ALIGN(4); - .rodata : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) } - - . = ALIGN(4); - .data : { - *(.data*) - } - - . = ALIGN(4); - - . = .; - - . = ALIGN(4); - __u_boot_list : { - KEEP(*(SORT(__u_boot_list*))); - } - - . = ALIGN(4); - - .image_copy_end : - { - *(.__image_copy_end) - } - - .rel_dyn_start : - { - *(.__rel_dyn_start) - } - - .rel.dyn : { - *(.rel*) - } - - .rel_dyn_end : - { - *(.__rel_dyn_end) - } - - .hash : { *(.hash*) } - - .end : - { - *(.__end) - } - - _image_binary_end = .; - - /* - * Deprecated: this MMU section is used by pxa at present but - * should not be used by new boards/CPUs. - */ - . = ALIGN(4096); - .mmutable : { - *(.mmutable) - } - -/* - * Compiler-generated __bss_start and __bss_end, see arch/arm/lib/bss.c - * __bss_base and __bss_limit are for linker only (overlay ordering) - */ - - .bss_start __rel_dyn_start (OVERLAY) : { - KEEP(*(.__bss_start)); - __bss_base = .; - } - - .bss __bss_base (OVERLAY) : { - *(.bss*) - . = ALIGN(4); - __bss_limit = .; - } - - .bss_end __bss_limit (OVERLAY) : { - KEEP(*(.__bss_end)); - } - - .dynsym _image_binary_end : { *(.dynsym) } - .dynbss : { *(.dynbss) } - .dynstr : { *(.dynstr*) } - .dynamic : { *(.dynamic*) } - .gnu.hash : { *(.gnu.hash) } - .plt : { *(.plt*) } - .interp : { *(.interp*) } - .gnu : { *(.gnu*) } - .ARM.exidx : { *(.ARM.exidx*) } -} From patchwork Wed Mar 13 16:23:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilias Apalodimas X-Patchwork-Id: 780035 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:ed0:b0:33e:7753:30bd with SMTP id ea16csp9688wrb; Wed, 13 Mar 2024 09:23:56 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUTh874fAMYO7L7X9G6UHsAzM1h7VfonANOazKKvqzfvTTR2td4+xCS6jCD/D/lH/1AURXjLDkXJkSfvRd4xPZ+ X-Google-Smtp-Source: AGHT+IFo2Dki/Rf2U5AG0myjK/XCL6s7sLM9YyLPa4NoPaYVBsqWHypJv6hxH93Kgz843dZEgGhg X-Received: by 2002:adf:e852:0:b0:33d:b2d7:306a with SMTP id d18-20020adfe852000000b0033db2d7306amr2110437wrn.5.1710347036307; Wed, 13 Mar 2024 09:23:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1710347036; cv=none; d=google.com; s=arc-20160816; b=gw4mmVPHgJV4kJInN05AafjFCCg9MiWEq2g267pDl5y8KFOXxbU8hCnIhCSY4Sq5H5 HskBnDKoX0tZEKoVCprY/DSCBQiirP+On2XCK2qNPhYzMUsZM8HRaCg3qQLdkMg7ACaM Ugf5ED2FD+X+OKME/lCTUrR1NzwzqcXDKbiWNjGTojyD3czXfZRMuqOgS8wjI3MdgGzW 4uBtKJROqozVdQEaJOzQoe4uRcOzeQiwvh6aolatp9sXL3JAq4A4a5t1YaDBuKJR227V 7Q3EXdwIuULNNIex5wiyIR/WWnBl0Fpmd3DLdL/1WsVepCvW03zORZtwmQcb7dnp2Z4T XwoQ== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=gyLkay206iddxamxOCfXexi6LBePtQTgH0CLz5GnYw8=; fh=YgAnvytc3PkIme27WTI0tmSPC4jrks+Z9IcIvi2eGZA=; b=DLDdAjr/F/B+RjDYfQxfgWlcICVxM+T09Zfvi3KQq1INNmtmozXBlQ3ENPygurubGN Wk8NK5TkFBwWZvJ9mQlJ3+Y0160TigfFJC9Mvu5wCxNZ1Uw4+0+e+/buWWdUoDlauz67 P4iDHKLcBuBYkJj9+nd1ytQ985JkIvoPGtD6m3zfZ7+iT7yhKbgv5h11AA5b6HxACHYy Btl+RbPF5mnyqoEYToT5wN45vgfKmwKXYIFZriG6iwAlbv4iB/UUnayI5h5079e4dntb rKB8pRvyimHgXjtyXNo8Ys3jTypU9z/yfVI0ukxEkgbRIC3qU7AIKOwdm/3JD3IOexdC n+EQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ri50Mf2d; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 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. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id o23-20020a05600c511700b00412db06c486si1036413wms.170.2024.03.13.09.23.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 09:23:56 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ri50Mf2d; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 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 DFF3A87EDA; Wed, 13 Mar 2024 17:23:44 +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="ri50Mf2d"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id BAED287EA9; Wed, 13 Mar 2024 17:23:42 +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-ej1-x633.google.com (mail-ej1-x633.google.com [IPv6:2a00:1450:4864:20::633]) (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 3DF6A8272A for ; Wed, 13 Mar 2024 17:23:40 +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-ej1-x633.google.com with SMTP id a640c23a62f3a-a450bedffdfso759966b.3 for ; Wed, 13 Mar 2024 09:23:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710347020; x=1710951820; 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=gyLkay206iddxamxOCfXexi6LBePtQTgH0CLz5GnYw8=; b=ri50Mf2d4N8SuFqVjJ/ZnJ5c7wyU0RJC5NgwXNeVzXA3anEd0jHrj7LJuVyWdXV6o9 8CBlIYmwD6k5XIh+RdkrOaZ14e/NvfuqUB8VB3O4JgvGadSqIoWFHCFfF9/jvNwO5Y5V VClTMdav707VNEPSOUQg+xBYOI6Jl239YdveEOyd5oHY4Si9P62qRp0Qwxub8BWwHgh8 aeJGjoNqJbstsk3gK8Vwm8djtY4Ct0F8s43gjX2A/xWIuBFOk9J9ap1YxtSRyPasB0rN p0Nzu/K4Q0MhyndjTsRNX1JAWkG8QcDBm9Uv7NFnlXtk/eIQvxnHM0oB/XWKJXILIoOZ oFoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710347020; x=1710951820; 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=gyLkay206iddxamxOCfXexi6LBePtQTgH0CLz5GnYw8=; b=baettrfhmAKsPlpGqQW0ASdbIUHsrQu3PGG3+LdGBky7L788jYe7VEdR8mVsMeuaH3 mDRoflEUnYuZvcYlvXCrGBaBpm+ShF13g0s7gC1MS75cM+CCIVae5iadXLVRq7mCFw+y yBSFm2lC2zIn8D1Gb8Cqf3UMccfK6kwokjN0k5Tj9EjarGK1/RUyn5GZK/8PTien8K9Q v3QJiaPCz/2O29NHD8hzRApvDTklidQ7gqyCNXDYlE+qFt79RhJ0BMmoMRcfhMrKYj4G k9KLttAIw0Knf4uvZWkalQQK5JPoGVel6FPa0qRiuB7shx2ZwOSfqS61o6mu2cY2VwnT n10g== X-Gm-Message-State: AOJu0YwwnpZlcIAlu/YgwVWi3uCFM1A4pbuoRSnk0Ld0RJbdGiOd7a6W /AWIMt/f0DYo6nk165iRjK2+NzirxMtL8MKgDGjCvXEIlCju0SQnJPv3scTfPfYxcsWj/FEFmtF L X-Received: by 2002:a17:907:7b06:b0:a46:5ac2:8506 with SMTP id mn6-20020a1709077b0600b00a465ac28506mr1601979ejc.25.1710347019752; Wed, 13 Mar 2024 09:23:39 -0700 (PDT) Received: from hades.. (ppp046103107123.access.hol.gr. [46.103.107.123]) by smtp.gmail.com with ESMTPSA id bh21-20020a170906a0d500b00a44efa48c24sm4998860ejb.117.2024.03.13.09.23.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 09:23:39 -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 , Ryan Chen , Chia-Wei Wang , Aspeed BMC SW team , Joel Stanley , Simon Glass , Philipp Tomsich , Kever Yang , Michal Simek , Yegor Yefremov , Heinrich Schuchardt , Sam Edwards , Shiji Yang , Bin Meng Subject: [PATCH v3 2/7] arm: clean up v7 and v8 linker scripts for bss_start/end Date: Wed, 13 Mar 2024 18:23:16 +0200 Message-Id: <20240313162324.2117909-3-ilias.apalodimas@linaro.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20240313162324.2117909-1-ilias.apalodimas@linaro.org> References: <20240313162324.2117909-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 commit 3ebd1cbc49f0 ("arm: make __bss_start and __bss_end__ compiler-generated") and commit f84a7b8f54db ("ARM: Fix __bss_start and __bss_end in linker scripts") were moving the bss_start/end on c generated variables that were injected in their own sections. The reason was that we needed relative relocations for position independent code and linker bugs back then prevented us from doing so [0]. However, the linker documentation pages states that symbols that are defined within a section definition will create a relocatable type with the value being a fixed offset from the base of a section [1]. So let's start cleaning this up starting with the bss_start and bss_end variables. Convert them into symbols within the .bss section definition. [0] binutils commit 6b3b0ab89663 ("Make linker assigned symbol dynamic only for shared object") [1] https://sourceware.org/binutils/docs/ld/Expression-Section.html Tested-by: Caleb Connolly # Qualcomm sdm845 Signed-off-by: Ilias Apalodimas Reviewed-by: Richard Henderson Tested-by: Sam Edwards # Binary output identical --- arch/arm/cpu/armv8/u-boot-spl.lds | 18 +++++++----------- arch/arm/cpu/armv8/u-boot.lds | 16 ++++------------ arch/arm/cpu/u-boot.lds | 22 +++++++--------------- arch/arm/lib/sections.c | 2 -- arch/arm/mach-rockchip/u-boot-tpl-v8.lds | 15 ++++----------- arch/arm/mach-zynq/u-boot.lds | 22 +++++++--------------- 6 files changed, 29 insertions(+), 66 deletions(-) diff --git a/arch/arm/cpu/armv8/u-boot-spl.lds b/arch/arm/cpu/armv8/u-boot-spl.lds index 7cb9d731246d..692414fe46fb 100644 --- a/arch/arm/cpu/armv8/u-boot-spl.lds +++ b/arch/arm/cpu/armv8/u-boot-spl.lds @@ -63,18 +63,11 @@ SECTIONS _image_binary_end = .; - .bss_start (NOLOAD) : { - . = ALIGN(8); - KEEP(*(.__bss_start)); - } >.sdram - - .bss (NOLOAD) : { + .bss : { + __bss_start = .; *(.bss*) - . = ALIGN(8); - } >.sdram - - .bss_end (NOLOAD) : { - KEEP(*(.__bss_end)); + . = ALIGN(8); + __bss_end = .; } >.sdram /DISCARD/ : { *(.rela*) } @@ -89,3 +82,6 @@ SECTIONS #include "linux-kernel-image-header-vars.h" #endif } +ASSERT(CONFIG_SPL_BSS_START_ADDR % 8 == 0, \ + "CONFIG_SPL_BSS_START_ADDR must be 8-byte aligned"); + diff --git a/arch/arm/cpu/armv8/u-boot.lds b/arch/arm/cpu/armv8/u-boot.lds index fb6a30c922f7..9640cc7a04b8 100644 --- a/arch/arm/cpu/armv8/u-boot.lds +++ b/arch/arm/cpu/armv8/u-boot.lds @@ -149,19 +149,11 @@ SECTIONS _end = .; - . = ALIGN(8); - - .bss_start : { - KEEP(*(.__bss_start)); - } - - .bss : { + .bss ALIGN(8): { + __bss_start = .; *(.bss*) - . = ALIGN(8); - } - - .bss_end : { - KEEP(*(.__bss_end)); + . = ALIGN(8); + __bss_end = .; } /DISCARD/ : { *(.dynsym) } diff --git a/arch/arm/cpu/u-boot.lds b/arch/arm/cpu/u-boot.lds index 7724c9332c3b..0dfe5f633b16 100644 --- a/arch/arm/cpu/u-boot.lds +++ b/arch/arm/cpu/u-boot.lds @@ -207,23 +207,15 @@ SECTIONS } /* - * Compiler-generated __bss_start and __bss_end, see arch/arm/lib/bss.c - * __bss_base and __bss_limit are for linker only (overlay ordering) + * These sections occupy the same memory, but their lifetimes do + * not overlap: U-Boot initializes .bss only after applying dynamic + * relocations and therefore after it doesn't need .rel.dyn any more. */ - - .bss_start __rel_dyn_start (OVERLAY) : { - KEEP(*(.__bss_start)); - __bss_base = .; - } - - .bss __bss_base (OVERLAY) : { + .bss ADDR(.rel.dyn) (OVERLAY): { + __bss_start = .; *(.bss*) - . = ALIGN(4); - __bss_limit = .; - } - - .bss_end __bss_limit (OVERLAY) : { - KEEP(*(.__bss_end)); + . = ALIGN(4); + __bss_end = .; } .dynsym _image_binary_end : { *(.dynsym) } diff --git a/arch/arm/lib/sections.c b/arch/arm/lib/sections.c index 857879711c6a..8e8bd5797e16 100644 --- a/arch/arm/lib/sections.c +++ b/arch/arm/lib/sections.c @@ -19,8 +19,6 @@ * aliasing warnings. */ -char __bss_start[0] __section(".__bss_start"); -char __bss_end[0] __section(".__bss_end"); char __image_copy_start[0] __section(".__image_copy_start"); char __image_copy_end[0] __section(".__image_copy_end"); char __rel_dyn_start[0] __section(".__rel_dyn_start"); diff --git a/arch/arm/mach-rockchip/u-boot-tpl-v8.lds b/arch/arm/mach-rockchip/u-boot-tpl-v8.lds index 74618eba591b..712c485d4d0b 100644 --- a/arch/arm/mach-rockchip/u-boot-tpl-v8.lds +++ b/arch/arm/mach-rockchip/u-boot-tpl-v8.lds @@ -56,18 +56,11 @@ SECTIONS _image_binary_end = .; - .bss_start (NOLOAD) : { - . = ALIGN(8); - KEEP(*(.__bss_start)); - } - - .bss (NOLOAD) : { + .bss ALIGN(8) : { + __bss_start = .; *(.bss*) - . = ALIGN(8); - } - - .bss_end (NOLOAD) : { - KEEP(*(.__bss_end)); + . = ALIGN(8); + __bss_end = .; } /DISCARD/ : { *(.dynsym) } diff --git a/arch/arm/mach-zynq/u-boot.lds b/arch/arm/mach-zynq/u-boot.lds index 3b7c9d515f8b..3c5008b57392 100644 --- a/arch/arm/mach-zynq/u-boot.lds +++ b/arch/arm/mach-zynq/u-boot.lds @@ -103,23 +103,15 @@ SECTIONS _image_binary_end = .; /* - * Compiler-generated __bss_start and __bss_end, see arch/arm/lib/bss.c - * __bss_base and __bss_limit are for linker only (overlay ordering) + * These sections occupy the same memory, but their lifetimes do + * not overlap: U-Boot initializes .bss only after applying dynamic + * relocations and therefore after it doesn't need .rel.dyn any more. */ - - .bss_start __rel_dyn_start (OVERLAY) : { - KEEP(*(.__bss_start)); - __bss_base = .; - } - - .bss __bss_base (OVERLAY) : { + .bss ADDR(.rel.dyn) (OVERLAY): { + __bss_start = .; *(.bss*) - . = ALIGN(8); - __bss_limit = .; - } - - .bss_end __bss_limit (OVERLAY) : { - KEEP(*(.__bss_end)); + . = ALIGN(8); + __bss_end = .; } /* From patchwork Wed Mar 13 16:23:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilias Apalodimas X-Patchwork-Id: 780036 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:ed0:b0:33e:7753:30bd with SMTP id ea16csp9763wrb; Wed, 13 Mar 2024 09:24:07 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUyDPYjvdC31uHyPSL6Qr6pOfFq/2inmRhAstoNwME4nqpuHOMMUNN3OW/iaWOS+6ZlalwqDKTFKpWQPCMlHelr X-Google-Smtp-Source: AGHT+IHyENun7qhPD9RpOW1wuxReVJ/W+g/i/loGSpXPv0Ewm0vavt4dnGW8W4Y/6Vj3R6V3zfH7 X-Received: by 2002:adf:ed07:0:b0:33e:afec:e7d8 with SMTP id a7-20020adfed07000000b0033eafece7d8mr1979957wro.42.1710347047155; Wed, 13 Mar 2024 09:24:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1710347047; cv=none; d=google.com; s=arc-20160816; b=gP3Lb6m1i5e0mnq0NOsHqPaQPID56B/T4ZoN54edxP8dy2Q2pW4kZD+vpukA1nhv5b hAAgQ4aPtmFlpLEGMrON/p1jZHqiPKshENm3AZtFeS7KnJHzRjD1MyFbxxSAfMZhh12K x/okT7gqaBuzdR4gjwo05/sbptUm/oOwueHnHA4ujuJ5R07at/cIZ5vKTzjkBKo9Ta7l Qmj/KcI2c8kM/TErx48CpVxOG02sOHtn9MrkyPO6cW+TCwJTTu6jsy/RjPcfBznEVpHk VQVCd/gSNV1parWaurA3TGplGdtxXQRF27h90FPZBOHDrv7RJUTAnQRdy+ZNh5UgwmGL uEtA== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=vofYHfUuo96XOLh3kZm4X4xcfUxGHEq5/wWQPpI0sjw=; fh=Dl9U/cWBAjt0RA0ekDL4vfSYX5rQ4ZX9RknwKNQFT0M=; b=zaoafGQnj8dMenOMxuQqQN8PtrljjfqkGRnLSEVD5j+HOjfCcZsORYPy8mG3fisMSB TZ20GqFj6HQX13JG14oEihLifjh0tRaQCHzMFClnAa9R5c6Ed89aUjD3knIh16OLMxoo Sw15fK1ucpx70xFS1cI/mC2zoztE9vV9rQaC7fdZL0xNmnGB8HnjPdjmGCaXwQYllT2n yskWn9+85RVUqndq7iEQ7crhAhrWnKWhu8vPdrQP5x99zZyDeRovFk5d2hNhfewyT9sS lsOfCI1S+4WKZYd9AwEuApXe29q7zoSEiDh3WH3WH8ohtsnFSczcBRIEonRxr6cAJOw3 um/Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PK94tZ4b; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 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. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id s18-20020a5d5112000000b0033e7830a7efsi5326096wrt.952.2024.03.13.09.24.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 09:24:07 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PK94tZ4b; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 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 646E987ED1; Wed, 13 Mar 2024 17:23:48 +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="PK94tZ4b"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E8E3087EA9; Wed, 13 Mar 2024 17:23:47 +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-ed1-x529.google.com (mail-ed1-x529.google.com [IPv6:2a00:1450:4864:20::529]) (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 64C4D87EE3 for ; Wed, 13 Mar 2024 17:23:45 +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-ed1-x529.google.com with SMTP id 4fb4d7f45d1cf-56647babfe6so8376151a12.3 for ; Wed, 13 Mar 2024 09:23:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710347025; x=1710951825; 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=vofYHfUuo96XOLh3kZm4X4xcfUxGHEq5/wWQPpI0sjw=; b=PK94tZ4b83o01c/aDWEjGDxmXCb2eKEQ3Uo3Xr4EiuK8WrxmqczMS05fnUM9QVMRe8 ee5uXC0wmVxaEdM3q39BtMySymAIs8wsFZHCuZ/sTMvx1dlKM1OJnEc1Wvv8LRqzM805 gQNF/y1WfIXo3EEtRiMJGABrDeGMjPNIjb2zwjpG/Et5tfogrNzewhQo7PAbMJx+sKty e01XXaf6I4c7JNKy4MzLFv0YhbvaYtUYA32E5Q0AGaMJPn896AoJxOB3s9m9ktlGtJfN 8Y9mKxXinwcygLT/YuX5jPuElUIcALd3bZgn3FO+c7JyrcisbYiSQDA8LAXJ4gS/F1iD 9XCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710347025; x=1710951825; 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=vofYHfUuo96XOLh3kZm4X4xcfUxGHEq5/wWQPpI0sjw=; b=iSDvcKFdbqSqtRVGCQLkRMcK5CGRvJZ4N+LA8e5vE+LhZcLgDZPf+gUZU7z4GEikD8 SlLN1+q+e4URKf0b1G4zIHdTHx12WRrIx79FGGFozDw0QzLdtL+8sq1tlV8uLSEO4ngR vnzmNjqplOzuPuIQIfRtDZRHttm0JAoNPOoFU6PbR/+TwpntrczQMBJm7EE/DIl5mznb eFHcFPu1XPwlHsAi3y1ib36QIUzETDfbockHjZj1t5OLoZtqSnrZKBV4X+OfYKqAL3BE 1nM6pb+vo1S/IQQ01lZ9Agj9ndBnXAxuqfJ4b6O0VHEIHWA/7sq0g/QkRH2fzPCYl50i AqKA== X-Gm-Message-State: AOJu0YyJjaSSYZ9leKWFTbKm6O03RZbkLi6MNZBpQeK3tlA9bP6W+gr6 MBFb86J7SJG4E9UOqwunVO3+Hq7GaSJOx6C02M7YKFf9Nx5s9AnNSGiZWgf4ER3WB6F2/VFzTKK T X-Received: by 2002:a17:906:d189:b0:a44:4c9e:8809 with SMTP id c9-20020a170906d18900b00a444c9e8809mr2315668ejz.32.1710347024716; Wed, 13 Mar 2024 09:23:44 -0700 (PDT) Received: from hades.. (ppp046103107123.access.hol.gr. [46.103.107.123]) by smtp.gmail.com with ESMTPSA id bh21-20020a170906a0d500b00a44efa48c24sm4998860ejb.117.2024.03.13.09.23.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 09:23:44 -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 v3 3/7] arm: fix __efi_runtime_rel_start/end definitions Date: Wed, 13 Mar 2024 18:23:17 +0200 Message-Id: <20240313162324.2117909-4-ilias.apalodimas@linaro.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20240313162324.2117909-1-ilias.apalodimas@linaro.org> References: <20240313162324.2117909-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_rel_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 Tested-by: Sam Edwards # Binary output identical Reviewed-by: Richard Henderson Signed-off-by: Ilias Apalodimas --- arch/arm/cpu/armv8/u-boot.lds | 4 +--- arch/arm/cpu/u-boot.lds | 16 +++------------- arch/arm/lib/sections.c | 2 -- arch/arm/mach-zynq/u-boot.lds | 16 +++------------- include/asm-generic/sections.h | 2 ++ lib/efi_loader/efi_runtime.c | 1 + 6 files changed, 10 insertions(+), 31 deletions(-) diff --git a/arch/arm/cpu/armv8/u-boot.lds b/arch/arm/cpu/armv8/u-boot.lds index 9640cc7a04b8..8561e1b3142e 100644 --- a/arch/arm/cpu/armv8/u-boot.lds +++ b/arch/arm/cpu/armv8/u-boot.lds @@ -115,9 +115,7 @@ SECTIONS KEEP(*(SORT(__u_boot_list*))); } - . = ALIGN(8); - - .efi_runtime_rel : { + .efi_runtime_rel ALIGN(8) : { __efi_runtime_rel_start = .; *(.rel*.efi_runtime) *(.rel*.efi_runtime.*) diff --git a/arch/arm/cpu/u-boot.lds b/arch/arm/cpu/u-boot.lds index 0dfe5f633b16..f19f2812ee91 100644 --- a/arch/arm/cpu/u-boot.lds +++ b/arch/arm/cpu/u-boot.lds @@ -152,21 +152,11 @@ SECTIONS KEEP(*(SORT(__u_boot_list*))); } - . = ALIGN(4); - - .efi_runtime_rel_start : - { - *(.__efi_runtime_rel_start) - } - - .efi_runtime_rel : { + .efi_runtime_rel ALIGN(4) : { + __efi_runtime_rel_start = .; *(.rel*.efi_runtime) *(.rel*.efi_runtime.*) - } - - .efi_runtime_rel_stop : - { - *(.__efi_runtime_rel_stop) + __efi_runtime_rel_stop = .; } . = ALIGN(4); diff --git a/arch/arm/lib/sections.c b/arch/arm/lib/sections.c index 8e8bd5797e16..ddfde52163fc 100644 --- a/arch/arm/lib/sections.c +++ b/arch/arm/lib/sections.c @@ -29,6 +29,4 @@ 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 __efi_runtime_rel_start[0] __section(".__efi_runtime_rel_start"); -char __efi_runtime_rel_stop[0] __section(".__efi_runtime_rel_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 3c5008b57392..bb0e0ceb32ec 100644 --- a/arch/arm/mach-zynq/u-boot.lds +++ b/arch/arm/mach-zynq/u-boot.lds @@ -58,21 +58,11 @@ SECTIONS KEEP(*(SORT(__u_boot_list*))); } - . = ALIGN(4); - - .efi_runtime_rel_start : - { - *(.__efi_runtime_rel_start) - } - - .efi_runtime_rel : { + .efi_runtime_rel ALIGN(4) : { + __efi_runtime_rel_start = .; *(.rel*.efi_runtime) *(.rel*.efi_runtime.*) - } - - .efi_runtime_rel_stop : - { - *(.__efi_runtime_rel_stop) + __efi_runtime_rel_stop = .; } . = ALIGN(8); diff --git a/include/asm-generic/sections.h b/include/asm-generic/sections.h index 1e1657a01673..60949200dd93 100644 --- a/include/asm-generic/sections.h +++ b/include/asm-generic/sections.h @@ -34,6 +34,8 @@ extern char __priv_data_start[], __priv_data_end[]; /* Start and end of .ctors section - used for constructor calls. */ extern char __ctors_start[], __ctors_end[]; +extern char __efi_runtime_rel_start[], __efi_runtime_rel_stop[]; + /* function descriptor handling (if any). Override * in asm/sections.h */ #ifndef dereference_function_descriptor diff --git a/lib/efi_loader/efi_runtime.c b/lib/efi_loader/efi_runtime.c index 18da6892e796..9185f1894c47 100644 --- a/lib/efi_loader/efi_runtime.c +++ b/lib/efi_loader/efi_runtime.c @@ -15,6 +15,7 @@ #include #include #include +#include /* For manual relocation support */ DECLARE_GLOBAL_DATA_PTR; From patchwork Wed Mar 13 16:23:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilias Apalodimas X-Patchwork-Id: 780037 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:ed0:b0:33e:7753:30bd with SMTP id ea16csp9843wrb; Wed, 13 Mar 2024 09:24:17 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWqjtQ4tu9d2T1M9cZGBkdDYHTsp4UOYD5hhrFRDI1Aula9J+OwQNxp+BE06WHus2UkT/Eaeu9jpkugPJuyAola X-Google-Smtp-Source: AGHT+IFjrCkWdMTiNpW6RnNa59+xO6eGaWQ7sPREBR06f/XxHV9RGD8A0cf4FNsZya+KHXZfmw8b X-Received: by 2002:a5d:64e8:0:b0:33e:a04d:9eda with SMTP id g8-20020a5d64e8000000b0033ea04d9edamr3024261wri.15.1710347057420; Wed, 13 Mar 2024 09:24:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1710347057; cv=none; d=google.com; s=arc-20160816; b=yonRE2CwCEnyaLFW/6hFXeiOsYx8/nZzQttaAFzJ8Zq2iEKOB97P5npapnDHASKafe MYfd+af8lJDPtGhl4bhETQzdQNE8GbGflXKuZWGjov1/GV49XLh3Int8JV/x+otFdHSB 8rnebyapUCltBuCd192XS4iTb9+7L6TvBU8pr8coEDDp+EiI37q8WdJg5C78hosswxCv z2XFlvcr8ZQYZ+GBDGcQyvgZuOkZZqEa+5sBKruLDzlZ/SZmB15l43Q1Z0hpZZ5sZBA3 Nt/K8qalOVVqhKiKzojiFnbiTERRdtoesNLhGkAcwJydGVsC4a74YEyIrUhSNy21iYRF eauw== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=H0FkfxvHNzcPjTU84NdyO0g39dk0XK67ZiNTuPD1TZo=; fh=Dl9U/cWBAjt0RA0ekDL4vfSYX5rQ4ZX9RknwKNQFT0M=; b=CzZrqmGcvCH4WpZHtLu7lTvPI3K0i/ecJm1jRKN37lLo0L4IdPfVcogzG/GeQX4q5U EYGmLXYXm6anEu3alY2Alk8ZhkOz/ul6mJRFUlvAbXZ0Fpi097EjlWBlzq+ONenO4TkU HORLCqdTZPfJR2NaSgRBRMOPGM1ACx5XoAMrqWecv9EdGFyw8mRxQ/b3Nn+ebazDKMvC aiwdYM+ej1yBAWJzTKacE4Yu2thyyARLgjcE2gve3n5JbvL81K4wSosUYem0ho1fdpTS jbHJrA16b7z/bAfel4wa6otkdaw45KzF/07byBpzHR7gcwufKphDHhKgG7GqlOmwHuL9 NXlQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cEoMUBk7; 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 m11-20020a5d4a0b000000b0033e96f6c593si3693096wrq.109.2024.03.13.09.24.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 09:24:17 -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=cEoMUBk7; 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 C92AF87EB4; Wed, 13 Mar 2024 17:23:53 +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="cEoMUBk7"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8B51787EB4; Wed, 13 Mar 2024 17:23:52 +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-ed1-x529.google.com (mail-ed1-x529.google.com [IPv6:2a00:1450:4864:20::529]) (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 47D038272A for ; Wed, 13 Mar 2024 17:23:50 +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-ed1-x529.google.com with SMTP id 4fb4d7f45d1cf-5685d46b199so1803953a12.3 for ; Wed, 13 Mar 2024 09:23:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710347030; x=1710951830; 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=H0FkfxvHNzcPjTU84NdyO0g39dk0XK67ZiNTuPD1TZo=; b=cEoMUBk7As5Ffv3YGHtlnNDiTbD0KiDUAyV0kCT6dFlBb25K4jQ1LJOuzr77F4oSGg WqrFt3tpTtBSpLB3vehlSrf6EcCDBX175GY3owIMhpbqSjwVe/5DEdFQGYqF44aEIXBb lADdIo0zmK9WegC+uo0TXUaLWBfXlZTFiR8CVEn1KDacWZ422HLUG23+UeGZAGTa4q21 ipKEz6Vv/SY9RQuH0JsGaKE4Cyegor4xSD5Xc9b+1eEjM+p1Uj0q80GP30YrBRqJ5AFV OlneGKphWvU8zRPRcVXi7ZLnrNGsEmIR5teMOG8AVWUACE3Hd1fFNFsoGRaCOX/EUxME pSRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710347030; x=1710951830; 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=H0FkfxvHNzcPjTU84NdyO0g39dk0XK67ZiNTuPD1TZo=; b=KTqIy6gcDxYsBaqF0bVl243XLjRFJmFAxKlkBkRCfHOrv5moS1vGkw4+XVtrd2HevL 2Ov2a9SzgV4kfyOw5D5IKUPs8OCSwOz01HP+8E4GZCYrhiHqJFJBOLdfZWfJ3wNmmaWP BwJixV8wnfzds02OOpiCaEVjEY5oaiaHtV9CArQwKaeapHu7s+YnY2sDGrw3vozdcKVB g4U68sdR8/ofrC6h54qqPR9/zG99PPmTuvYbOoF9HTtRTaBhGUwmym5z9O5R//GlvZ85 KviSgzAcvgbnDIgilmxHB/6mPa2wKBuBJzDbpw5rJ5H14kSv6Wxku0CQk2g4Vu7PHnJf 6xOQ== X-Gm-Message-State: AOJu0YxEKt3s38tNh9V507NGeyDBxiTYUtwIhp2wISaeb1lzd2aYYN30 lnSKOPmO+jxSqa59knCiosTZ8qE0R9M3KOqXjogTR2o9Vnl6psPDg6j6lBI/RUkUTD+uK2nvQnC c X-Received: by 2002:a17:907:daa:b0:a46:35c9:f239 with SMTP id go42-20020a1709070daa00b00a4635c9f239mr6432758ejc.72.1710347029732; Wed, 13 Mar 2024 09:23:49 -0700 (PDT) Received: from hades.. (ppp046103107123.access.hol.gr. [46.103.107.123]) by smtp.gmail.com with ESMTPSA id bh21-20020a170906a0d500b00a44efa48c24sm4998860ejb.117.2024.03.13.09.23.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 09:23:49 -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 v3 4/7] arm: clean up v7 and v8 linker scripts for __rel_dyn_start/end Date: Wed, 13 Mar 2024 18:23:18 +0200 Message-Id: <20240313162324.2117909-5-ilias.apalodimas@linaro.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20240313162324.2117909-1-ilias.apalodimas@linaro.org> References: <20240313162324.2117909-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 commit 47bd65ef057f ("arm: make __rel_dyn_{start, end} compiler-generated") were moving the __rel_dyn_start/end on c generated variables that were injected in their own sections. The reason was that we needed relative relocations for position independent code and linker bugs back then prevented us from doing so [0]. However, the linker documentation pages states that symbols that are defined within a section definition will create a relocatable type with the value being a fixed offset from the base of a section [1]. [0] binutils commit 6b3b0ab89663 ("Make linker assigned symbol dynamic only for shared object") [1] https://sourceware.org/binutils/docs/ld/Expression-Section.html 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/armv8/u-boot.lds | 16 +++------------- arch/arm/cpu/u-boot.lds | 14 +++----------- arch/arm/lib/sections.c | 2 -- arch/arm/mach-zynq/u-boot.lds | 14 +++----------- 4 files changed, 9 insertions(+), 37 deletions(-) diff --git a/arch/arm/cpu/armv8/u-boot.lds b/arch/arm/cpu/armv8/u-boot.lds index 8561e1b3142e..5ba54dcedf24 100644 --- a/arch/arm/cpu/armv8/u-boot.lds +++ b/arch/arm/cpu/armv8/u-boot.lds @@ -129,20 +129,10 @@ SECTIONS *(.__image_copy_end) } - . = ALIGN(8); - - .rel_dyn_start : - { - *(.__rel_dyn_start) - } - - .rela.dyn : { + .rela.dyn ALIGN(8) : { + __rel_dyn_start = .; *(.rela*) - } - - .rel_dyn_end : - { - *(.__rel_dyn_end) + __rel_dyn_end = .; } _end = .; diff --git a/arch/arm/cpu/u-boot.lds b/arch/arm/cpu/u-boot.lds index f19f2812ee91..0682d34207fa 100644 --- a/arch/arm/cpu/u-boot.lds +++ b/arch/arm/cpu/u-boot.lds @@ -166,18 +166,10 @@ SECTIONS *(.__image_copy_end) } - .rel_dyn_start : - { - *(.__rel_dyn_start) - } - - .rel.dyn : { + .rel.dyn ALIGN(4) : { + __rel_dyn_start = .; *(.rel*) - } - - .rel_dyn_end : - { - *(.__rel_dyn_end) + __rel_dyn_end = .; } .end : diff --git a/arch/arm/lib/sections.c b/arch/arm/lib/sections.c index ddfde52163fc..1ee3dd3667ba 100644 --- a/arch/arm/lib/sections.c +++ b/arch/arm/lib/sections.c @@ -21,8 +21,6 @@ char __image_copy_start[0] __section(".__image_copy_start"); char __image_copy_end[0] __section(".__image_copy_end"); -char __rel_dyn_start[0] __section(".__rel_dyn_start"); -char __rel_dyn_end[0] __section(".__rel_dyn_end"); char __secure_start[0] __section(".__secure_start"); char __secure_end[0] __section(".__secure_end"); char __secure_stack_start[0] __section(".__secure_stack_start"); diff --git a/arch/arm/mach-zynq/u-boot.lds b/arch/arm/mach-zynq/u-boot.lds index bb0e0ceb32ec..3b1f0d349356 100644 --- a/arch/arm/mach-zynq/u-boot.lds +++ b/arch/arm/mach-zynq/u-boot.lds @@ -71,18 +71,10 @@ SECTIONS *(.__image_copy_end) } - .rel_dyn_start : - { - *(.__rel_dyn_start) - } - - .rel.dyn : { + .rel.dyn ALIGN(8) : { + __rel_dyn_start = .; *(.rel*) - } - - .rel_dyn_end : - { - *(.__rel_dyn_end) + __rel_dyn_end = .; } .end : From patchwork Wed Mar 13 16:23:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilias Apalodimas X-Patchwork-Id: 780038 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:ed0:b0:33e:7753:30bd with SMTP id ea16csp9943wrb; Wed, 13 Mar 2024 09:24:27 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXGfQBdB1llER3ZKzFiMl63llUOKGnzMTLpyphMXeQePxlQlcinqUJgebu5HbLmuzoPmh8ZLOeljm0tp+SXYZ0h X-Google-Smtp-Source: AGHT+IHP5+PGT3SGU704Qnci962IJI0sDGQVabUKqg6AvEVlDpUix26kWExArLhVvyJ2l+XfyvtW X-Received: by 2002:a05:600c:4ec9:b0:413:1212:3eed with SMTP id g9-20020a05600c4ec900b0041312123eedmr342757wmq.3.1710347067654; Wed, 13 Mar 2024 09:24:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1710347067; cv=none; d=google.com; s=arc-20160816; b=x9GFODAVm0mbFgr3rZWQ7U1f6NkLbpvO5/6rjp2AVNkf3UtNm0PE5Evzkt4LtzsMp/ VzbCFAHp3TKeUMB38s+NsRa0H2L3FVgRtPjSOwwZB/aqaAvQKLLrO8Z7/IJbhXA0PKWc r+S6RzMboevXUnX7aRQJl2dlyifktRCWC+5Sie40tRWrCEFs1KwTIfLTmOEXw/MuNk6k BVwUhpC69KqC6G+bYGW+UejYhZyPcpq8QqMc2SLH5etzovHhEVKFaDNXgKGhCHwAnibr 2rsWkssrNptGz7WK45iFGKIgFsziSHpSWB9EDcMT3BfjOtLtqb3+5cWEKUxZkGC4oPKf vHbw== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=bjKrvGkOI7iiwRM0lPDhhs6RRG3TK0w+7djk6/pkbKo=; fh=Dl9U/cWBAjt0RA0ekDL4vfSYX5rQ4ZX9RknwKNQFT0M=; b=veNT5DyXvItiMnM/Aj7qwdXqgHVZDOqFQjo2VX+HPD1pDL8QCn7Q6ipoxrzX84lyrV pyDkkNa6u3r1YatlNvR2iH3NyURzFINPmfNwc2DkmblROhm8JwTboQQnC5Ge9E2iLGKy pc9fVQdjo6JWUGuyuMATvYzG3ASZmh4H4eeYizOwcCMHCW7NpLCLkh/+B/7+pDXd1Gv0 CFeS4xxy4r0zRGEODXaULeQmC905TAinRyOubdm1dbIYoWJRKyjQ/59wlJ3I6mtlFt54 8aAghjtnFOPB3j+txe0cmO7Dnqe0jlFX9cSizhp82bUVZGSqFjCgckm9RpDf0NVImhHM 0QxA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Qm3ygV5f; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 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. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id p9-20020a05600c468900b0041316e3fd37si1048704wmo.7.2024.03.13.09.24.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 09:24:27 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Qm3ygV5f; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 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 E977387F19; Wed, 13 Mar 2024 17:23:58 +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="Qm3ygV5f"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9B99F87EA8; Wed, 13 Mar 2024 17:23:57 +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-lf1-x12c.google.com (mail-lf1-x12c.google.com [IPv6:2a00:1450:4864:20::12c]) (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 97CEA87F07 for ; Wed, 13 Mar 2024 17:23:55 +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-lf1-x12c.google.com with SMTP id 2adb3069b0e04-513c8530daeso40616e87.2 for ; Wed, 13 Mar 2024 09:23:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710347035; x=1710951835; 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=Qm3ygV5fkeUunLp8TNtPHmzBjlJfJw/4D5NV4bE0wUpwFBLqtS0GtbSLEISrO+lnfW LUC/bXbhULhmsNxDEFpSgcknRXnhK8AJEI+itFNU4K2HkOZPfhQyvGzEmdYYKBv51N6E O95XKhh0FujRKLyYT2GxJDYX8xkObM+A1Z6IIPR1GQDANQd+eRmC6m+eRDzqVya42Hmg GEhRzlP6aIAWRtTxCkXIcaMuKnJNCDVok2kjFGNcwm7XMfiRwAbLPSwPwogiPORj2usp u1N6PD4ON0PbjuN3f1l3860Pky2tWDftzTKjUEQvg9wgGkfoFQlZ6ihYmcZ6r+y37iH+ jUSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710347035; x=1710951835; 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=kofjsN9OegjK+PcGXGxdtSGQjggTs6K0VvuYyg0oCd0o9ddCp9RQhkxa65En4u9M14 Uuo+9MI53HGzyt/MWuvosHcl/9xoJg4vWHoUTO8uOxlJM/C5FpW6JoQuczN6aO2tulP+ bytnXI1gJNuqI4IbzgS3Cp7tr+jpBU0FeCkFFwop0JYy4d4JaSfDoOeq8Uax8/IIQ0Fl a98F0NYbW1WhP5O3LLcFhVIumV2wlpMjng9h9Id1oAoIDHqSQNm8lHq2EkDK/CtJeOCV Eck9sU41rFPAznE/H3Ji414PtBKIohJUFwidN8KkXXLFgEwOYfQdS6T772ryiKgkTbVU M8xg== X-Gm-Message-State: AOJu0Yzb7D5shxOFyDvuE9X5W2QkzbTEWTecU9rtADUgFSV7BWQt1Lf3 Sw/0VmdkFYH+wwUzM4YjwsnQJoKzhLPUadcQSk38Z7rzv+RG182jsHZh1U4b2tvZR+iXGg/WlKS +9tM= X-Received: by 2002:ac2:4d81:0:b0:513:80cd:e80b with SMTP id g1-20020ac24d81000000b0051380cde80bmr8927830lfe.29.1710347034685; Wed, 13 Mar 2024 09:23:54 -0700 (PDT) Received: from hades.. (ppp046103107123.access.hol.gr. [46.103.107.123]) by smtp.gmail.com with ESMTPSA id bh21-20020a170906a0d500b00a44efa48c24sm4998860ejb.117.2024.03.13.09.23.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 09:23:54 -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 v3 5/7] arm: fix __efi_runtime_start/end definitions Date: Wed, 13 Mar 2024 18:23:19 +0200 Message-Id: <20240313162324.2117909-6-ilias.apalodimas@linaro.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20240313162324.2117909-1-ilias.apalodimas@linaro.org> References: <20240313162324.2117909-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 */ From patchwork Wed Mar 13 16:23:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilias Apalodimas X-Patchwork-Id: 780039 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:ed0:b0:33e:7753:30bd with SMTP id ea16csp10062wrb; Wed, 13 Mar 2024 09:24:38 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCW5oNikhqGlZPyyY5LsEg+p55Twr5MaAeEVxjtXJKqv9ofn2zL21xe//umTXeeyO8NfryGyqQepThkTATlfjqFh X-Google-Smtp-Source: AGHT+IESFDI3M+LwPLcWte435FXCQCZ+OxjJuwbIKSSNqQdo8rfpe9WEa8V8BpvQx3QNlvEEPKYZ X-Received: by 2002:a5d:4d88:0:b0:33e:7e75:9a56 with SMTP id b8-20020a5d4d88000000b0033e7e759a56mr1900932wru.42.1710347078504; Wed, 13 Mar 2024 09:24:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1710347078; cv=none; d=google.com; s=arc-20160816; b=NrimGX+4SyYJ5oxluEEsrLT3yeqyeSzw6/sjPw07PzFwOhkCaDfEdRlgGLRj7rJse8 u2V2BNh4S51dViLrbjIBT42nkK3gKP8vkgb6NH6CWQ3Sl4g4WU+gcb4xbC7Mm2N3W6zR QiAaOlbjZfmoF3YMy2wGbdjeNXc57FizB1yDYKKYYusKMnBdH5ietNownDnUyF0pQLHR fXKY6gS14cK4pXzvtP3l5vFDb4zFKcpyzd7EnyuIA/x3KeVLQRWXpCfwhvL+Zxyzsnmo 8OuuJZR2r42YkM9sKeIm+aWzVgrcZ+xDYeR8ldNYz6tu3lYgizKa9gCgoEfYXwjulQoj tvIQ== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=KaeMqlOXLZXi4MpKQLTK6S1UuPVKPoVkl5mmHX/g864=; fh=Dl9U/cWBAjt0RA0ekDL4vfSYX5rQ4ZX9RknwKNQFT0M=; b=ZMHVu0FuhN03WRVqS8AjHn8wKhJWoJ/0S3ntUeT05sF/6GW5+g/Z6ZxuhsBWFrH5YK m3UnoFev477jNAcZv5orfU6JSpwNPP9k04g6QZrQGRPaj372k3FOwHC3rGbeJ1gGSpUZ DPDPV+xjj2VDHA//2dV4TqXuw1lxp0OkKiT6RNJqpFRCslsPNPs3fCOgXNWeKhhHAliG 06eF6sCRw8e+UBjoDKPQLafUY8NPcGYe8JAIMyEcPJMh9leH4pSa6kGZ27kaOiuDkgdg 5PHPXiUOu0nHbKaJmGK9ZPwbtDmZXMKaKscwmhLnaMf8wtmBZ0DvopMj/mvD4kjyfmND +aoA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=elNXfCor; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 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. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id g16-20020adfe410000000b0033e88b46587si4734529wrm.633.2024.03.13.09.24.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 09:24:38 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=elNXfCor; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 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 5B50E87F10; Wed, 13 Mar 2024 17:24:04 +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="elNXfCor"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6C6008272A; Wed, 13 Mar 2024 17:24:02 +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-ed1-x535.google.com (mail-ed1-x535.google.com [IPv6:2a00:1450:4864:20::535]) (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 3984287EA8 for ; Wed, 13 Mar 2024 17:24:00 +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-ed1-x535.google.com with SMTP id 4fb4d7f45d1cf-5688d7e63adso631210a12.2 for ; Wed, 13 Mar 2024 09:24:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710347040; x=1710951840; 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=KaeMqlOXLZXi4MpKQLTK6S1UuPVKPoVkl5mmHX/g864=; b=elNXfCorVqBBnK7o0eupFWlTrurJfHn4JrF1uAOH2e6k0Tn8UwWRjUzrr6VaELxla8 uTrmSXs/r0SPLZzB5aPBs6UhPzE1NcC311s/xsTQrfHl98PnnXkP4q5GYFMUmgiZqGOA LilIXRiNsqLoEP+0AnPa1zc6Zx558P2UXNP6mnghgQXzKyHXPeIFvK8TwGv/+n9zTvtK BaSvmsBb0YLq3JkBEQAlO45+EU2q2uaAojgbj5w1XuLJhOPXhXPp4dn0DjONz/eMZVK5 YCzOCJOZ0X6kBDatPUoL3nfISdbXvEo70fOBMPolfa/9L48yAgXodN3ZIiomsb+GbL1q JDRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710347040; x=1710951840; 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=KaeMqlOXLZXi4MpKQLTK6S1UuPVKPoVkl5mmHX/g864=; b=osl8tXvnLNKvt4fuvH6vP2z+3/BvjlxcIJ4w048NUYvoe5TMyekivqf6INGDNcSpcV 0W95lnn4DDMp/d/38FJSvkrrRJdjb7NSp24u+uJ++pbNLr7GAd69gW7dWUKuYQlq3B/+ E+DP1XtUjUwf1MKG/6QgccnYkRyOPEYTVzL5mhmTSmEFlIXEx7p0PKFDpgT3iN1hSbx5 segBCmGoPeYn6LMIoOXKA/jr0XXY34tgchffyH2Www42w0DvHCHBhG0e/6rrOKwVBkLC 6z4JUDSq2Qt2kbQToyRAHruoujFhF/5RJ1ZnvuibBc/xV5mYbzAkT/RuP/Wis7V1AUdk UPbQ== X-Gm-Message-State: AOJu0Ywdek1F09YIaX4XblQHqB78nqd4vEzNIrZaKbS/ec6nEVuUZQYq f4sG8uSe46b9wcjkcpPbMANg6rSFJ0+HqksoP6cKMrDO6evrG1PdYtQnLtf1ZgrOzqqAHX5tdx0 M X-Received: by 2002:a17:906:4750:b0:a44:1a51:a1fd with SMTP id j16-20020a170906475000b00a441a51a1fdmr8487671ejs.64.1710347039742; Wed, 13 Mar 2024 09:23:59 -0700 (PDT) Received: from hades.. (ppp046103107123.access.hol.gr. [46.103.107.123]) by smtp.gmail.com with ESMTPSA id bh21-20020a170906a0d500b00a44efa48c24sm4998860ejb.117.2024.03.13.09.23.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 09:23:59 -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 v3 6/7] arm: move image_copy_start/end to linker symbols Date: Wed, 13 Mar 2024 18:23:20 +0200 Message-Id: <20240313162324.2117909-7-ilias.apalodimas@linaro.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20240313162324.2117909-1-ilias.apalodimas@linaro.org> References: <20240313162324.2117909-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 image_copy_start/end are defined as c variables in order to force the compiler emit relative references. However, defining those within a section definition 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 within a section. [0] binutils commit 6b3b0ab89663 ("Make linker assigned symbol dynamic only for shared object") Suggested-by: Sam Edwards Reviewed-by: Richard Henderson Tested-by: Sam Edwards # Binary output identical Signed-off-by: Ilias Apalodimas --- arch/arm/cpu/armv8/u-boot-spl.lds | 8 +++----- arch/arm/cpu/armv8/u-boot.lds | 8 ++------ arch/arm/cpu/u-boot-spl.lds | 2 +- arch/arm/cpu/u-boot.lds | 8 ++------ arch/arm/lib/sections.c | 2 -- arch/arm/mach-aspeed/ast2600/u-boot-spl.lds | 2 +- arch/arm/mach-rockchip/u-boot-tpl-v8.lds | 8 +++----- arch/arm/mach-zynq/u-boot-spl.lds | 2 +- arch/arm/mach-zynq/u-boot.lds | 7 ++----- 9 files changed, 15 insertions(+), 32 deletions(-) -- 2.37.2 diff --git a/arch/arm/cpu/armv8/u-boot-spl.lds b/arch/arm/cpu/armv8/u-boot-spl.lds index 692414fe46fb..2e61f759ee6b 100644 --- a/arch/arm/cpu/armv8/u-boot-spl.lds +++ b/arch/arm/cpu/armv8/u-boot-spl.lds @@ -21,9 +21,9 @@ OUTPUT_ARCH(aarch64) ENTRY(_start) SECTIONS { + __image_copy_start = ADDR(.text); .text : { . = ALIGN(8); - __image_copy_start = .; CPUDIR/start.o (.text*) *(.text*) } >.sram @@ -51,10 +51,8 @@ SECTIONS KEEP(*(SORT(__u_boot_list*))); } >.sram - .image_copy_end : { - . = ALIGN(8); - *(.__image_copy_end) - } >.sram + . = ALIGN(8); + __image_copy_end = .; .end : { . = ALIGN(8); diff --git a/arch/arm/cpu/armv8/u-boot.lds b/arch/arm/cpu/armv8/u-boot.lds index 5ba54dcedf24..147a6e8028d5 100644 --- a/arch/arm/cpu/armv8/u-boot.lds +++ b/arch/arm/cpu/armv8/u-boot.lds @@ -21,9 +21,9 @@ SECTIONS . = 0x00000000; . = ALIGN(8); + __image_copy_start = ADDR(.text); .text : { - *(.__image_copy_start) CPUDIR/start.o (.text*) } @@ -123,11 +123,7 @@ SECTIONS } . = ALIGN(8); - - .image_copy_end : - { - *(.__image_copy_end) - } + __image_copy_end = .; .rela.dyn ALIGN(8) : { __rel_dyn_start = .; diff --git a/arch/arm/cpu/u-boot-spl.lds b/arch/arm/cpu/u-boot-spl.lds index fb2189d50dea..9ed62395a9c5 100644 --- a/arch/arm/cpu/u-boot-spl.lds +++ b/arch/arm/cpu/u-boot-spl.lds @@ -14,9 +14,9 @@ SECTIONS . = 0x00000000; . = ALIGN(4); + __image_copy_start = ADDR(.text); .text : { - __image_copy_start = .; *(.vectors) CPUDIR/start.o (.text*) *(.text*) diff --git a/arch/arm/cpu/u-boot.lds b/arch/arm/cpu/u-boot.lds index 6813d8aeb838..798858e3ed6e 100644 --- a/arch/arm/cpu/u-boot.lds +++ b/arch/arm/cpu/u-boot.lds @@ -35,9 +35,9 @@ SECTIONS . = 0x00000000; . = ALIGN(4); + __image_copy_start = ADDR(.text); .text : { - *(.__image_copy_start) *(.vectors) CPUDIR/start.o (.text*) } @@ -154,11 +154,7 @@ SECTIONS } . = ALIGN(4); - - .image_copy_end : - { - *(.__image_copy_end) - } + __image_copy_end = .; .rel.dyn ALIGN(4) : { __rel_dyn_start = .; diff --git a/arch/arm/lib/sections.c b/arch/arm/lib/sections.c index a4d4202e99f5..db5463b2bbbc 100644 --- a/arch/arm/lib/sections.c +++ b/arch/arm/lib/sections.c @@ -19,8 +19,6 @@ * aliasing warnings. */ -char __image_copy_start[0] __section(".__image_copy_start"); -char __image_copy_end[0] __section(".__image_copy_end"); char __secure_start[0] __section(".__secure_start"); char __secure_end[0] __section(".__secure_end"); char __secure_stack_start[0] __section(".__secure_stack_start"); diff --git a/arch/arm/mach-aspeed/ast2600/u-boot-spl.lds b/arch/arm/mach-aspeed/ast2600/u-boot-spl.lds index 37f0ccd92201..ada6570d9712 100644 --- a/arch/arm/mach-aspeed/ast2600/u-boot-spl.lds +++ b/arch/arm/mach-aspeed/ast2600/u-boot-spl.lds @@ -22,9 +22,9 @@ SECTIONS . = 0x00000000; . = ALIGN(4); + __image_copy_start = ADDR(.text); .text : { - __image_copy_start = .; *(.vectors) CPUDIR/start.o (.text*) *(.text*) diff --git a/arch/arm/mach-rockchip/u-boot-tpl-v8.lds b/arch/arm/mach-rockchip/u-boot-tpl-v8.lds index 712c485d4d0b..ad32654085b3 100644 --- a/arch/arm/mach-rockchip/u-boot-tpl-v8.lds +++ b/arch/arm/mach-rockchip/u-boot-tpl-v8.lds @@ -22,9 +22,9 @@ SECTIONS { . = 0x00000000; + __image_copy_start = ADDR(.text); .text : { . = ALIGN(8); - *(.__image_copy_start) CPUDIR/start.o (.text*) *(.text*) } @@ -44,10 +44,8 @@ SECTIONS KEEP(*(SORT(__u_boot_list*))); } - .image_copy_end : { - . = ALIGN(8); - *(.__image_copy_end) - } + . = ALIGN(8); + __image_copy_end = .; .end : { . = ALIGN(8); diff --git a/arch/arm/mach-zynq/u-boot-spl.lds b/arch/arm/mach-zynq/u-boot-spl.lds index 8c18d3f91f4b..d96a57702886 100644 --- a/arch/arm/mach-zynq/u-boot-spl.lds +++ b/arch/arm/mach-zynq/u-boot-spl.lds @@ -18,9 +18,9 @@ ENTRY(_start) SECTIONS { . = ALIGN(4); + __image_copy_start = ADDR(.text); .text : { - __image_copy_start = .; *(.vectors) CPUDIR/start.o (.text*) *(.text*) diff --git a/arch/arm/mach-zynq/u-boot.lds b/arch/arm/mach-zynq/u-boot.lds index 9eac7de0dcbd..f6c99a8ce218 100644 --- a/arch/arm/mach-zynq/u-boot.lds +++ b/arch/arm/mach-zynq/u-boot.lds @@ -14,9 +14,9 @@ SECTIONS . = 0x00000000; . = ALIGN(4); + __image_copy_start = ADDR(.text); .text : { - *(.__image_copy_start) *(.vectors) CPUDIR/start.o (.text*) } @@ -60,10 +60,7 @@ SECTIONS } . = ALIGN(8); - .image_copy_end : - { - *(.__image_copy_end) - } + __image_copy_end = .; .rel.dyn ALIGN(8) : { __rel_dyn_start = .; From patchwork Wed Mar 13 16:23:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilias Apalodimas X-Patchwork-Id: 780040 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:ed0:b0:33e:7753:30bd with SMTP id ea16csp10171wrb; Wed, 13 Mar 2024 09:24:49 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVyqXW29cKQdCg9DvBk+0SLY7ziwn8SHr8YfAa6pOL6k5eq8mvTzfzNoMRsq0qlabrLy648BgXy7H1WrgkS4PYf X-Google-Smtp-Source: AGHT+IHezNCwV/rIMXhKNwxdlllkapVejPlrBE9RO8NVSV9+Y35Fo+0ScfsiA1wLTc31KAZQAB1D X-Received: by 2002:ac2:44b1:0:b0:513:c195:1c56 with SMTP id c17-20020ac244b1000000b00513c1951c56mr3646920lfm.16.1710347089270; Wed, 13 Mar 2024 09:24:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1710347089; cv=none; d=google.com; s=arc-20160816; b=ydTUAC/XbkfLZTqcEFZu1XgjaP/6oCzsASrv+wXUyyooGaDzEAclhbX2iP1jycaW8U OsfajZ0FxR3LXcytVXHmBPjNFvf5jb/Sg5LetKSDQ/JJUKzADkUn89R//s0Qm/NZGJ5r g3pDyyO5TBt5Lk/GU5g8RbOjSVM6nVLPaH+hlSKB9FSYmp7bUR12reTvhDc0PsybkYOk 3tn11TnuLAcfCF5FI8dRy9XpVaFa2giQdXg09YCDugQyid7w+PHjFIfWZNfI8V9j3UeY iZWmxoG1wuLFRrnMIWHxz4q7lHapvwJHWAgT97uslKmboahPmpsNMTI1BDFdJnhR+qrU 350Q== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=PeH0jtFq/Xmys6wW7yvXInFyA0E/rY6c14SEeWX+QjE=; fh=YgAnvytc3PkIme27WTI0tmSPC4jrks+Z9IcIvi2eGZA=; b=DxUvD/HlZzwAGhx0Rec28+W11i7Hifm0YF3rPmmZdQbzVP4FztTLc0cxa794U+qcdj vepaYqsPsuHVAT9M5VMxUs87W5qJVGhp04QR5YuD38JeOm5ou9tw+gxo8CIU5DcCuj9W 3HhC2dQ25D+TVUSpScshwyp1eaLfXGSMw/Ot0iXKxVA3lbvaxO4Lur/G06pQWKSDNOmy aA7BASLkRoSPN6DhLubKanOmrQS0Mn/GFtqyWy/ccHX5ObNzLk+VpnmzMRMv7v0epgDf gTm5qG83jx6iFb2lE0kMt7Oz4NG5mQyJ1yzbJq1p7zHu5V3l+MQRnE4zn6gJARhTIwHZ TBiA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PLm9rkYV; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 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. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id e22-20020a05600c13d600b00412fa37d354si1010142wmg.107.2024.03.13.09.24.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 09:24:49 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PLm9rkYV; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 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 C8F8187EA9; Wed, 13 Mar 2024 17:24:09 +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="PLm9rkYV"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id DC7618272A; Wed, 13 Mar 2024 17:24:08 +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-lf1-x130.google.com (mail-lf1-x130.google.com [IPv6:2a00:1450:4864:20::130]) (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 C996287EE3 for ; Wed, 13 Mar 2024 17:24:06 +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-lf1-x130.google.com with SMTP id 2adb3069b0e04-5131316693cso61783e87.0 for ; Wed, 13 Mar 2024 09:24:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710347044; x=1710951844; 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=PeH0jtFq/Xmys6wW7yvXInFyA0E/rY6c14SEeWX+QjE=; b=PLm9rkYVG+St9FmZenFOhYJGeaB0a1VvQWXB2pikZOT2X5RvEEkvzWZyzCJPjCIYcP 4mqhjZEc3xYnkI95ndDsSaX1xtXo+EzZaMFupWOcfoIzu+N1lir0ne+B/WrRnK+i0NE1 ka3O58M2ZqsBJDRqaLyeucHQ4HqsGnlBU702Woi5XmDuW6++5GCEH9KvVr8cuJcTLmCm jtFaCkxHZIT+7qHnZagmSW+Jtac77VvpbTrG0jfh67/VZx9/aIG+gHO+vqr6Fk/X/1Bd unHc820+/oR3L0ZdbEQes0QK4X8Gwt0R7fj0sYwuwIXY1gr/EtsQx3uhasrRLjXXGXJg G4bQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710347044; x=1710951844; 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=PeH0jtFq/Xmys6wW7yvXInFyA0E/rY6c14SEeWX+QjE=; b=PtD2/TNY6pCHvyO49fgGOoZF4qdkgll6nv+VlXl9cIYTLBI7JTgSa1M23eBrpYVq7L FyfkPfdrXn6pwkWHV10uGuG42ywddbpcHnoPt6YIIZRFU4RX2tFdgriKRo+Km25dIhKH IiJTOyePRSSreAbV3iPWubouMyLuNGtNrcJH32oBNsG1HW72hVqX/3V7GPIZxWvxp8SD c0o52CvC0H7MSsaKSZ3yHe1MQRTm/REyTOYrbRv/MPIBP7HFrwveLfhypLRslNmvWx5T AXwuE/q+W6fl4/DynadIgzBIeDtRnbYh5LzsgrBjiYfDfC+FN2k+aH6+CknCyQEe9ZFk gipA== X-Gm-Message-State: AOJu0YzhvxermvluiNQ0OxQHg9c1LgxRVpxwAlQea4j5R5GHZX84UQYP gxkLohWASLzjuNVdXUGbAVUvTYwX+Y1U8Xyv8+8HK7l02kDAdCejqNgtEc7Bxzm9nDRJzJnBarq hm54= X-Received: by 2002:a19:740f:0:b0:513:cba0:1caa with SMTP id v15-20020a19740f000000b00513cba01caamr1016436lfe.36.1710347044722; Wed, 13 Mar 2024 09:24:04 -0700 (PDT) Received: from hades.. (ppp046103107123.access.hol.gr. [46.103.107.123]) by smtp.gmail.com with ESMTPSA id bh21-20020a170906a0d500b00a44efa48c24sm4998860ejb.117.2024.03.13.09.24.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 09:24:04 -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 , Ryan Chen , Chia-Wei Wang , Aspeed BMC SW team , Joel Stanley , Simon Glass , Philipp Tomsich , Kever Yang , Michal Simek , Yegor Yefremov , Heinrich Schuchardt , Sam Edwards , Shiji Yang , Bin Meng Subject: [PATCH v3 7/7] arm: remove redundant section alignments Date: Wed, 13 Mar 2024 18:23:21 +0200 Message-Id: <20240313162324.2117909-8-ilias.apalodimas@linaro.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20240313162324.2117909-1-ilias.apalodimas@linaro.org> References: <20240313162324.2117909-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 Previous patches cleaning up linker symbols, also merged any explicit . = ALIGN(x); into section definitions -- e.g .bss ALIGN(x) : instead of . = ALIGN(x); . bss : {...} However, if the output address is not specified then one will be chosen for the section. This address will be adjusted to fit the alignment requirement of the output section following the strictest alignment of any input section contained within the output section. So let's get rid of the redundant ALIGN directives when they are not needed. While at add comments for the alignment of __bss_start/end since our C runtime setup assembly assumes that __bss_start - __bss_end will be a multiple of 4/8 for armv7 and armv8 respectively. It's worth noting that the alignment is preserved on .rel.dyn for mach-zynq which was explicitly aligning that section on an 8b boundary instead of 4b one. Signed-off-by: Ilias Apalodimas Reviewed-by: Richard Henderson --- arch/arm/cpu/armv8/u-boot.lds | 9 ++++++--- arch/arm/cpu/u-boot.lds | 8 ++++++-- arch/arm/mach-zynq/u-boot.lds | 4 ++-- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/arch/arm/cpu/armv8/u-boot.lds b/arch/arm/cpu/armv8/u-boot.lds index 147a6e8028d5..857f44412e07 100644 --- a/arch/arm/cpu/armv8/u-boot.lds +++ b/arch/arm/cpu/armv8/u-boot.lds @@ -115,7 +115,7 @@ SECTIONS KEEP(*(SORT(__u_boot_list*))); } - .efi_runtime_rel ALIGN(8) : { + .efi_runtime_rel : { __efi_runtime_rel_start = .; *(.rel*.efi_runtime) *(.rel*.efi_runtime.*) @@ -125,7 +125,7 @@ SECTIONS . = ALIGN(8); __image_copy_end = .; - .rela.dyn ALIGN(8) : { + .rela.dyn : { __rel_dyn_start = .; *(.rela*) __rel_dyn_end = .; @@ -133,7 +133,10 @@ SECTIONS _end = .; - .bss ALIGN(8): { + /* + * arch/arm/lib/crt0_64.S assumes __bss_start - __bss_end % 8 == 0 + */ + .bss ALIGN(8) : { __bss_start = .; *(.bss*) . = ALIGN(8); diff --git a/arch/arm/cpu/u-boot.lds b/arch/arm/cpu/u-boot.lds index 798858e3ed6e..707b19795f08 100644 --- a/arch/arm/cpu/u-boot.lds +++ b/arch/arm/cpu/u-boot.lds @@ -43,7 +43,7 @@ SECTIONS } /* This needs to come before *(.text*) */ - .efi_runtime ALIGN(4) : { + .efi_runtime : { __efi_runtime_start = .; *(.text.efi_runtime*) *(.rodata.efi_runtime*) @@ -146,7 +146,7 @@ SECTIONS KEEP(*(SORT(__u_boot_list*))); } - .efi_runtime_rel ALIGN(4) : { + .efi_runtime_rel : { __efi_runtime_rel_start = .; *(.rel*.efi_runtime) *(.rel*.efi_runtime.*) @@ -156,6 +156,10 @@ SECTIONS . = ALIGN(4); __image_copy_end = .; + /* + * if CONFIG_USE_ARCH_MEMSET is not selected __bss_end - __bss_start + * needs to be a multiple of 4 and we overlay .bss with .rel.dyn + */ .rel.dyn ALIGN(4) : { __rel_dyn_start = .; *(.rel*) diff --git a/arch/arm/mach-zynq/u-boot.lds b/arch/arm/mach-zynq/u-boot.lds index f6c99a8ce218..3e0c96c50556 100644 --- a/arch/arm/mach-zynq/u-boot.lds +++ b/arch/arm/mach-zynq/u-boot.lds @@ -22,7 +22,7 @@ SECTIONS } /* This needs to come before *(.text*) */ - .efi_runtime ALIGN(4) : { + .efi_runtime : { __efi_runtime_start = .; *(.text.efi_runtime*) *(.rodata.efi_runtime*) @@ -52,7 +52,7 @@ SECTIONS KEEP(*(SORT(__u_boot_list*))); } - .efi_runtime_rel ALIGN(4) : { + .efi_runtime_rel : { __efi_runtime_rel_start = .; *(.rel*.efi_runtime) *(.rel*.efi_runtime.*)