From patchwork Fri Mar 15 06:43:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilias Apalodimas X-Patchwork-Id: 780475 Delivered-To: patch@linaro.org Received: by 2002:a5d:46c1:0:b0:33e:7753:30bd with SMTP id g1csp43986wrs; Thu, 14 Mar 2024 23:44:15 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUbdmROt/qn2xhxHMEhULr0L+wc1hjG9MNnAkdRzaQv+kNR9YVBYMbb2ot4Y4pO6yg0qqHlPMyf6QJhm/xFRic0 X-Google-Smtp-Source: AGHT+IE4h9GS8k8nErWLDSlMpsjaEOahX7VNRsv8GwLl3bPjj3FjWO1NPEDhaRKtX/2ikiNJbckG X-Received: by 2002:a5d:5a0e:0:b0:33e:76db:9bf8 with SMTP id bq14-20020a5d5a0e000000b0033e76db9bf8mr3565108wrb.68.1710485055802; Thu, 14 Mar 2024 23:44:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1710485055; cv=none; d=google.com; s=arc-20160816; b=qtMcxqFS9Uxq2o4nCwheIOt2bVyx3F4KxKdVwLA2KYjdVT/RgPfT6OXYw/UZjyBvA/ dskmFqWBnWd2eJSOOAjJKr8tsyucy3RvEK1j5mmVMWVjIRgheP6pntvTt9lMGOdD3CSa 2Nnxk/eDGpymvCC7jFIhQ2RzwG+mNYqMW7cme5BMaXJGRY1ERuP/RPC4Iv/36H9Ibv0w pkbxHT2OaY/j5jHARCKB1UYajd9Bw4BnfO/iMNCFRie5aLNuZS4xMvDxVfprs+u4WwH2 5+z/gfceuw28pAL1VMjalhXyDG516plVqCa/DVHJf71+vQnoppTUyHfmNS7QyJ5Kjdqe /m+g== 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=Ei9f3Yq0fRdK6f73GSPD5pwhiQvKxLOTchKvd+HKQ9ZFfnGMTeU+d/mRggx3lAmDla DEY6hlO7yMp2tC47YkhqN2DgEuD1OtQWWNoDIu91I7IBsxcFLub5+kQW8o5BvkDjPXgs TzLr6g1GxWApgc1zDiCoqXWNC/k4dOoQbgToivd1Zk3CQfuGZB94oSySlt6Re+PLkS7P WfCOh91I0qlNFC5jpMposxRr5xynTgs/8fC4XIdGfc1atqzZpLXEny95+dQkFO7X+06S RpCWnE/oG5FC42gQUZ1/dGXVDUh2VZ64pbZZT0/JRsw3f1VXjVzuKa7ZFt+cVr8XDPj9 BTUQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QUyr2Js8; 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 r19-20020adfb1d3000000b0033e79408f52si1239814wra.117.2024.03.14.23.44.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Mar 2024 23:44:15 -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=QUyr2Js8; 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 6208087F9C; Fri, 15 Mar 2024 07:44:08 +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="QUyr2Js8"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id F0D6187FAA; Fri, 15 Mar 2024 07:44:06 +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-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) (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 0566587F8F for ; Fri, 15 Mar 2024 07:44:05 +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-wr1-x42a.google.com with SMTP id ffacd0b85a97d-33e94c12f33so1550149f8f.3 for ; Thu, 14 Mar 2024 23:44:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710485044; x=1711089844; 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=QUyr2Js8+o21Arq5cMPZDPsd5t/+S0ZLDHNkh6MvVmfpULv4jVBzv5/93qfx7Yc2dY TVQl5mMOd+fMtO2cA0JvAqyiV7HMX8lEFYLgEj5h8SFNnLlH44qx3vry5qXRfV25xDHi Jal96oruZ99EabNR6r0NJrUcOFlmjKC6DwE7rG1zssh+CQwt0sFIj3JaQ0PXF1GMmaKH DXH1S75iEvWa5ld9ndLmpH33FR4LCIRuoBXkWs97EXJxbZD+o5eoRgzfYc5pq75rff3i IWfk0jdlgMv2bSsE4RMO/uwp8fpscZYBijXm3mhShZnOPGz+G+Na+w8+3E4ra5MP99E6 6jzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710485044; x=1711089844; 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=iBoUFCLwIWZct5PjDrSz202GhFaMbpjYoF6JzxZ/iwu4JkAuwxt76TVhrDVbGd9JJb Pb84JREWbRn7GUys+lL86/+epUw8+Xxi6QvEKCGUROyVs/yrtWDR/+md4Il0WBrKHbGf Tud0jbrQHx3k0iP6EFHC4wEH8kBET88tZC+RNgTU8QqcEufLvg/ImrmHZlZDwcyDQeJ1 0t5/516Y+FNQu3qfmssFKZSUjmvOt0loWKgnnrCoGUFr5lAW4hnEl9lhb5BHkdlWYaJI Hf0nVnoEGQTYNpZvO016eCHMmlNVldN6uZ/rcaBMG7fk1t0pFpvnCurZqRyTrsHZjc7/ 3Liw== X-Gm-Message-State: AOJu0YwplowzqfHNgd+NMiLuYHGxSDOiujwOSO+jjd9xuepcs8yYpLaF X3d+gy74KgJ9xSdiYaftwAHDF8iU3eBS80KbHc+okcl0xwAgU1/wnEIdB7wuso7XCztkpehdGC9 C X-Received: by 2002:adf:ce85:0:b0:33e:d470:da8f with SMTP id r5-20020adfce85000000b0033ed470da8fmr304520wrn.17.1710485044521; Thu, 14 Mar 2024 23:44:04 -0700 (PDT) Received: from hades.. (ppp046103107123.access.hol.gr. [46.103.107.123]) by smtp.gmail.com with ESMTPSA id v18-20020adfe4d2000000b0033ec9936909sm2398658wrm.39.2024.03.14.23.44.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Mar 2024 23:44: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 v4 1/7] arm: baltos: remove custom linker script Date: Fri, 15 Mar 2024 08:43:45 +0200 Message-Id: <20240315064354.2215266-2-ilias.apalodimas@linaro.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20240315064354.2215266-1-ilias.apalodimas@linaro.org> References: <20240315064354.2215266-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 Fri Mar 15 06:43:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilias Apalodimas X-Patchwork-Id: 780476 Delivered-To: patch@linaro.org Received: by 2002:a5d:46c1:0:b0:33e:7753:30bd with SMTP id g1csp44042wrs; Thu, 14 Mar 2024 23:44:28 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXEmG7HZVQodw/9VVUiIR2EascknBjAMFCUw0xg4OW6lt4uhed+/r9fyg/axata5dUDizA2bsIopwv36BELelYd X-Google-Smtp-Source: AGHT+IH8uaO0cM6S8Xnl5fY3JoSBaAeNFKoX1XnYMq/CAwUXKvg9ffHD5UDUbHzfjJZI5IZwYorS X-Received: by 2002:a05:600c:34d4:b0:413:2958:d145 with SMTP id d20-20020a05600c34d400b004132958d145mr1550069wmq.4.1710485068171; Thu, 14 Mar 2024 23:44:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1710485068; cv=none; d=google.com; s=arc-20160816; b=y6NBWKc+SUf9CzTlFG8GHt7bL58JDkQ0G9kcBij20JW0vVtBfX/1DUfl2ZtTRQ44f2 Pto6wDgKeG1pk7rGDMn+oR9jHv3KnyoOIdJ4mJxPhkHsSiwxeUV8X8k6ciwHohcnTa51 q+0tcJQrI57oBppVfwOs6lakcNe6K6OMOCFpnE1iwhGZ2kZ8WGKuWSX/zG3BdzmoHfaU WrwoehRw5vYJSyUDIrkRSodewptIQp+gaII9lrdKitHgOw9AqLJ3oeB7UVnbbQidSuhG xB8g2Du94QXtb5EWmHSk0sW0X4mf27e5e8C01jx5p1T85rVNjNuEL3ZBrQfpUBJhSv8g c2fg== 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=a8hGzCIBbvwzy4XqlUTV3kP+YuKho4u2EeBDL6jmh30=; fh=Dl9U/cWBAjt0RA0ekDL4vfSYX5rQ4ZX9RknwKNQFT0M=; b=HymbNCd7qtyEnC4SRPxLyAQ5aS3UEkD4xoBZ2k03I8qmT+ulAfm3V/iySscdAQ1trs LDbhLAxVWKjYv7Lx3k9177PFPMBYnmlzVyOLKSjLJ1ldxsYbUqWkcIbM7HJlI7yMcyJr pCx5sAe+so2jqbtmWHM2mROxHt74UG6vVhQrfHc+qZT4Ni0796Oep6jFzJ9mfmZgkEyB cLrGqp2UJomY0Y1+P073kwRnfEMkBBhb1hFVoP5YcL9PhlAyhug6ezCn4euzP7t4n5wC UWhp2INeusZaMl4VdGbEG+tO7VBvF7wEjyW/jN93lp6wpxwRPGUiecPnU69ddxELFB3w WVBQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FRPCqkll; 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 e7-20020a05600c438700b00412f18549d0si1803550wmn.152.2024.03.14.23.44.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Mar 2024 23:44:28 -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=FRPCqkll; 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 B53A587F8F; Fri, 15 Mar 2024 07:44:13 +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="FRPCqkll"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 81CE187B89; Fri, 15 Mar 2024 07:44:12 +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-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) (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 1FF8187FA7 for ; Fri, 15 Mar 2024 07:44:10 +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-wr1-x432.google.com with SMTP id ffacd0b85a97d-33ec8f13c62so977797f8f.0 for ; Thu, 14 Mar 2024 23:44:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710485049; x=1711089849; 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=a8hGzCIBbvwzy4XqlUTV3kP+YuKho4u2EeBDL6jmh30=; b=FRPCqkllSyNY9+fwH4KXgLcYaJrbU0tAgMykHn+Ni03VtfOH9PBFcj/PUh5qMaUXfj 1zW6a7X8djuAdqe78H3mhPnuRLiJn+cTpwWQM1zTiFA9T/psLsNwZVICtl18tH7kVXbv BT5GN/+kK8KfrurJMVlapUYDVaRryMgBda1+NmxiutzNZoJnIlfXaPmfowLGpWkLar5e AOcg1ygvucsxzrZjFaRiL2KJXcXsE7iQVs05tgIJcCebPeagx0ttz/53GQaBh82f2O5G kS+QR8uu35MB1lTbdeugY3tamL4psWuZ9E/CrZv7io+YOwcXmQc8gnco+97u/UR1XvIS t9qQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710485049; x=1711089849; 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=a8hGzCIBbvwzy4XqlUTV3kP+YuKho4u2EeBDL6jmh30=; b=bwBm/k+s/cZEmNERpyRf2mfsy5YDLvfxvWfK7CRNDDdTZjJViMT05NPmOUSscNwssi mYU9CE2fpivS3zAS+VSe9KYHMuPB+upd2Dt1ULtHxJoWHR1gkjTOROC2lutTGOEKW0Ra vY0okkarqcasBx14FB7YSMPEklqxeasQEO1fmCNqqzcqBFc3WppkzymKXwN6slNPisdF NNn3uJshmCvOKpBpFNQ0fXq4Vmg/G+OUe+yeSFSqfEPl0ww204/9pk/3ZyMiptQld8qo cZkB9/uGEO1WHyvukx7qgd6ZVOwI9VanyXf5tM4EuQ7AWNHRvcU98Tl3p3QZeCYtAB3W aonQ== X-Gm-Message-State: AOJu0YytQb9FhjCfyJ70nNit6Krk5sGpgUXFCZUF50QY7TFFcpCKuJ7L tfaHeGWpq8Nn9MjgDIv17sUfxHNcw0SLnVocR09jJ4T+gULVy4LBfuZ0o1Sh+Bhq5slBXXfoLSu z X-Received: by 2002:a5d:468e:0:b0:33d:c5c5:9bc6 with SMTP id u14-20020a5d468e000000b0033dc5c59bc6mr1641446wrq.54.1710485049492; Thu, 14 Mar 2024 23:44:09 -0700 (PDT) Received: from hades.. (ppp046103107123.access.hol.gr. [46.103.107.123]) by smtp.gmail.com with ESMTPSA id v18-20020adfe4d2000000b0033ec9936909sm2398658wrm.39.2024.03.14.23.44.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Mar 2024 23:44:09 -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 v4 2/7] arm: clean up v7 and v8 linker scripts for bss_start/end Date: Fri, 15 Mar 2024 08:43:46 +0200 Message-Id: <20240315064354.2215266-3-ilias.apalodimas@linaro.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20240315064354.2215266-1-ilias.apalodimas@linaro.org> References: <20240315064354.2215266-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 Tested-by: Sam Edwards # Binary output identical Signed-off-by: Ilias Apalodimas Reviewed-by: Richard Henderson --- 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..8998c4985eac 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(ADDR(.bss) % 8 == 0, \ + ".bss 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 Fri Mar 15 06:43:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilias Apalodimas X-Patchwork-Id: 780477 Delivered-To: patch@linaro.org Received: by 2002:a5d:46c1:0:b0:33e:7753:30bd with SMTP id g1csp44068wrs; Thu, 14 Mar 2024 23:44:39 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXLxuP4CO+/JH5nwX6lHU1xRce5od2+Z4WRGHDirP+5hiPjb3P1kx/rMQqhPCBHzw9UHyNBhd5F9P4OsRT/+dTr X-Google-Smtp-Source: AGHT+IGC22oyhPMdr1OcjyB0fCxLvHvKZ6y8pmZWywlDlb7GvPzr/nKDN+Q7YmtBYGy4GyzoqfNo X-Received: by 2002:ac2:5229:0:b0:513:ad46:dc7d with SMTP id i9-20020ac25229000000b00513ad46dc7dmr1418339lfl.61.1710485079565; Thu, 14 Mar 2024 23:44:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1710485079; cv=none; d=google.com; s=arc-20160816; b=ajJQP/7qo0t0SWnuX3pdnFvD383ypgkZdwLCYeGpz/ld69Qr1Xa0wSAl0xfrmVjBKo T/0apfzhxPkC6A9wXC8EmnhzvUa8wA9Reh7Zr9MoE/A8+UNG4sDbCZHYgAOCF4gq3gtS ZexMwV/h/xk9NS0qKVXyqPTA5iQ4gezcjVZ13e94ZLuiDB85jXpo+Z5ykO56F+7BVJIy INgofeYurdl/Hvxop/4OXaEY7Dzog7JPyJ/t1Tm/ZR27oSXHFCJSiW3lX+UOHz4uOlHE w+M34QZlaqfn+tUjTMSHnt7cH85t8OgYo5uNwbEjAwnRY9caGcSJNmVGDXsxSu/iulrD LZ+Q== 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=KgXK+eauwZL7SP2XKQaAcya8sLBZqdbtkATbCIctPhXa1jlnY07EIIbTe5t/zTf4YB xphf067SMIHUOJiGjByPISa/6446xGkA1olTiXN+ar6M51A3p0hC3Vn0OTs4VBUVN0Oj Rb51GPVxubrVUfur9zCprz59DZteUGrMC/qXlPyYKBZ7IjcOLvW0IBy9CbUHmNQ3wF4N GK5Se8zqNw1ndRkKugWM4nE9XWFqbW1mZmOc4oMFMhIMcxgS018ZD5AO59xMrHtVSgqo 1UxXwP1okhGsW5jXuz/+31sOa46AkEl7rj2lAs2HMSnIi4K8vbcXt4jPn9ivdtlW/vrZ F/Kw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oGUhgSbe; 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 dx1-20020a0560000e0100b0033ecb052546si1094311wrb.850.2024.03.14.23.44.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Mar 2024 23:44:39 -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=oGUhgSbe; 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 14B0987FC8; Fri, 15 Mar 2024 07:44:19 +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="oGUhgSbe"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id F1AF087B89; Fri, 15 Mar 2024 07:44:16 +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-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) (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 EBA5D87FAA for ; Fri, 15 Mar 2024 07:44:14 +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-wm1-x329.google.com with SMTP id 5b1f17b1804b1-413fffc0a4dso2475755e9.3 for ; Thu, 14 Mar 2024 23:44:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710485054; x=1711089854; 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=oGUhgSbeZjAfjcHKVe0e23KMllZmJh8y6OrNzw0eBWfRLhgrDDPjLIufwwXk0r5KWH Ao2d9UYk/I+8nvheONmNd0mO4O2Omsil30/SU7oPUojpsrEC5DgttNcRzabvZ27rb437 qt8woZxY9jGP7TDVxdThMTxxrTKDwhBjPx4G1Ze88ripVU2ZV4j326BK8PgTTqfjqoOQ cVR0u+zFs/MyMNB/vc6rjIuI2G9w3+SrcmVBClGtEGDKzvmpVA8xYK08s73ulu5z4eV0 GDArYhr4NrY2Mypy4E1NqDNm3SZZVlL98Efz2vX//a7wdqr5aYluKAzF5HazWbK9sYVK xPDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710485054; x=1711089854; 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=YDpNuaQTiwPVnYIAksPcZLjiC22wsMJcXdhirJmmqKpSmWvofD92EBXG1ZNKXGLIlR xymdeMIUZvn+MOjVfg1JIzdSj1a/0xgCYERHKxgYaKBsTL9Z14WALNciHvidNmtMwa/1 CwNnI/DDnuNRKkZDO/JS/Jd4MAcokiEAl1dckwG3FBpb4GqTdXqw/tYRu4SBPtCLSdyb pWTXybLb0UXxN6K8gaDf+3OjxYkVSS+0PmPAL9T/Z7KQuFXb0gZpzMV+aLuaMLbEXOiv UfHHWwUjSRK6JyjS3l4Vzia/mn7TuADVofRGtUHgPGauhzLm289Fyz8DDBoI3Q5PHb1u FqHw== X-Gm-Message-State: AOJu0Yz5kgvtnaNWPvV9oIBGaHNkWyJW+ZOQ3t8lWBid8ZeuLimUqT38 bSzjuPdGFijhKtK+aA642WOtB4PG0/QCoqcTHYOwnOJCVgR4txTbXIix+GBI/waFnhoQMXnQMam q X-Received: by 2002:adf:fa87:0:b0:33e:7946:4cd2 with SMTP id h7-20020adffa87000000b0033e79464cd2mr1513694wrr.10.1710485054447; Thu, 14 Mar 2024 23:44:14 -0700 (PDT) Received: from hades.. (ppp046103107123.access.hol.gr. [46.103.107.123]) by smtp.gmail.com with ESMTPSA id v18-20020adfe4d2000000b0033ec9936909sm2398658wrm.39.2024.03.14.23.44.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Mar 2024 23:44:14 -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 v4 3/7] arm: fix __efi_runtime_rel_start/end definitions Date: Fri, 15 Mar 2024 08:43:47 +0200 Message-Id: <20240315064354.2215266-4-ilias.apalodimas@linaro.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20240315064354.2215266-1-ilias.apalodimas@linaro.org> References: <20240315064354.2215266-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 Fri Mar 15 06:43:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilias Apalodimas X-Patchwork-Id: 780478 Delivered-To: patch@linaro.org Received: by 2002:a5d:46c1:0:b0:33e:7753:30bd with SMTP id g1csp44118wrs; Thu, 14 Mar 2024 23:44:53 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWVS02uh1eP1+rBMW2mxVnE6BfuuiLxajHqUEm0VmjjpaPgYuGchkG3HoqI28CscHKMqjynC9sGXHc28vPnM43m X-Google-Smtp-Source: AGHT+IHlWoMxRLdK4rwQeNqALk8xMz4lDYoA1p1PXeULAqx+XX9B2MnvgDkQ/CVMqeInWJ9MWoJ6 X-Received: by 2002:adf:ab49:0:b0:33a:ee4d:98c8 with SMTP id r9-20020adfab49000000b0033aee4d98c8mr1901066wrc.61.1710485093210; Thu, 14 Mar 2024 23:44:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1710485093; cv=none; d=google.com; s=arc-20160816; b=Drk5KTow6Q9OumRdh//cS7vYm+V0RELibdYcFUMM64SLpL97D039MjDrxKm3k0QSAz KTeG72/Maif6tdb3cgGQpRO1nRBQznu/iSbo6LrHIk2jLha20m+ufPDPonizXY2EP1RF uVXFsmUR3jiR8JPex9jBXBpHcussfMyUFYDUbmkyMvnzmEizrh6AwFQj9+tXcUc7owXI Gzj0a+LSyIhNUJ43L+3HaR4eJaTm0YbSSJQNmkWJnvOBU3FeiP8zX1LpPJjXux7++jsL Fzl8RS9oW/uFDC1Jj66JW3qZKtIGvLL8TSPhlI+bZeacQyIFfnkERarCHSKKVv+by374 nvsQ== 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=R8Nxv7ik4dEGmun5umM0vk2unjH6NGr/Swk+Ja9ywtAiCI5007tx30cfkcBZiMkZFt mg+e0b5RJj5v5GqZxkPmT9D282tHUVViFcC93FmOSOf5WpNRsUo8KgNJsUNSaKHBFPJW xxuHvNQ8pTRW2/Z9bZfO/Pk29+lOV0RxnlFDtSyLA6MOnAwCTitQWmxuHTAm5x0F9Iil L8DaF01jYO4HCjeLMFqxzNK1cOXW+DqEi41jJxe8ToYNrLOEdEjvnta0VOL8//hj5/8a P61aGoS8zJx3xSix5rYv1gPT8JWnRVukqna+Q68/nEbOSAK8CI7P1VPMM5rlm7ADKYyM b+rg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=E0m0uUg5; 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 k4-20020a056000004400b0033ecb06267csi1097028wrx.520.2024.03.14.23.44.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Mar 2024 23:44:53 -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=E0m0uUg5; 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 867CB87FC6; Fri, 15 Mar 2024 07:44:24 +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="E0m0uUg5"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5636A87FC6; Fri, 15 Mar 2024 07:44:23 +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-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) (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 0C3FD87FBC for ; Fri, 15 Mar 2024 07:44:20 +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-wr1-x42a.google.com with SMTP id ffacd0b85a97d-33e9ba0eadcso1342661f8f.2 for ; Thu, 14 Mar 2024 23:44:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710485059; x=1711089859; 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=E0m0uUg5n5eEqMAopgfUcTXIAo0YVwtXH6lj7nRiuMNTeY8+cFUvLgUYwkdQnE1/5h XHTc49OasG4gYCtevp8P71tWMPVeXtEWUJhZdN8O/d+UBXGZMDRZOg4KkOWru0MbCcA9 KTKmL1sNdx6LM5vhJctO71QMr3odRAi/xLRA94KIfDRz1r1NrFN9d9BFhSjFhPdQGJwD nY1oY3Hp4tt+PvA/qBBvWGwO/2fTq5Zpcs90ePrhV2GiOHb8eqfrIw9wKk5TJjHOAzMt 9upi94J9qLbi8OQElPMEZf7b4H0gjZI7Y6Ih/R7hAwEHC72kjaZIqzkyDZnEHLUV2Ri7 NUpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710485059; x=1711089859; 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=mwjzO+rut7k0jOJLvIKk50M/NLctXCQvOjZz8kLMaz/N6Yji3801GoGqg6hqkQBons VSDYEQ5spwYPM3XutLl8OhR/o/8SR+8fzUL6lF5nbAfJwVT2Ogyzb1Yd2ncDq0e11uDn jHbVIQqaq2dARyFXO623A/TbHtqQgzbyLLKxwyQpYEgFrQECy2BO/IIn2s0z44kzBglw JTzreX0LFc8eVO/xrjK6THUj02J3xlXlTwffksdYZelQk+O9L5M/1NxY6du0pBZA6Trj mrk78IFiztAhTTazsvpWrjiPBUrJymZrCbogIphaR4XnwW5+sTchXxBYtANTHXDOO+im Ytwg== X-Gm-Message-State: AOJu0Yz1aIY1HekC7ddSSqDZsNRiM2SL+fGUrc19AJLr8vMy0B5eKQHA GPffALwlf8KXDaSBrUonBqLMUquPZEhYCDRYQn1JYFhWU0yVSsQsIY96hIJ0UV8LXXPvlzvKhp1 B X-Received: by 2002:adf:fc0b:0:b0:33e:6ce2:88ab with SMTP id i11-20020adffc0b000000b0033e6ce288abmr2668142wrr.46.1710485059307; Thu, 14 Mar 2024 23:44:19 -0700 (PDT) Received: from hades.. (ppp046103107123.access.hol.gr. [46.103.107.123]) by smtp.gmail.com with ESMTPSA id v18-20020adfe4d2000000b0033ec9936909sm2398658wrm.39.2024.03.14.23.44.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Mar 2024 23:44:19 -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 v4 4/7] arm: clean up v7 and v8 linker scripts for __rel_dyn_start/end Date: Fri, 15 Mar 2024 08:43:48 +0200 Message-Id: <20240315064354.2215266-5-ilias.apalodimas@linaro.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20240315064354.2215266-1-ilias.apalodimas@linaro.org> References: <20240315064354.2215266-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 Fri Mar 15 06:43:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilias Apalodimas X-Patchwork-Id: 780479 Delivered-To: patch@linaro.org Received: by 2002:a5d:46c1:0:b0:33e:7753:30bd with SMTP id g1csp44179wrs; Thu, 14 Mar 2024 23:45:07 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWT5Hn2LWzkCabq7+orjEVSEMG0CxtMS39QZdNlua4pj3QMJVKW+fDdZ0GNluhv41fzb0SoKBX9daeqzS/cFDdq X-Google-Smtp-Source: AGHT+IEEcRbxa/uOMsGQHyqx/xdBRV2Yb7Z/WD8YZrPLk8i+Z64ZwRbCJWeNC3pc1B6iiD5FHYZ1 X-Received: by 2002:a05:600c:b88:b0:413:f237:5d1d with SMTP id fl8-20020a05600c0b8800b00413f2375d1dmr1628619wmb.32.1710485107556; Thu, 14 Mar 2024 23:45:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1710485107; cv=none; d=google.com; s=arc-20160816; b=g4nQ98kBz3DIrwrd8hNrqppJK9IpYAOSGN9YgPsi9qVxb5sLANTFK9yUXdVtviHx3r ObZJdp9zadhIZrCZ+k+W+1/o1WPp8ScpKMoIMYTnpVN41CAPhk7IcB4AX9oLPrD99BRb vec8lNYITZ6TOWteQ1A3BMqAQ0tbbxQwtmdWGjCyjeI/KxqW33Bya80Gb3lGV+mpo8RU fPFCSKHQacPhY/jv/QXszZe21rluSjznzTvvFaQE4ivQ7GsZ1ND8b47f/6cTaPvcnZUa pCalHc+tW+NIhYb2l962PqGAQFpJzb14Vr9aUWAM8niIBHy887e6Vzx1u4pAqPofQ5M4 jyAA== 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=GaZnKnJSyPbX/jbgPtYY4SpA0HOT9v9vh0DXM/nwpmlMaiGXinFgjPjKLeVWuhKG4Z LC0H4Hp57NAhntQxSdMJxO8FE7lHlj2qDh58HCzjamn13ICVT7xqu8pUxXgV0BmIwlLQ IYeF3qwZPhvEklGzGG1PlslcgyRW7LAtlCmz5PzZhrb0hG294Vsi1FK7zVu3m3UQAuHs PMhmRne0KQ6/48x3auqp3Ed0BJebTZj2xDZkhKxFeGgLlNUXrJCPp2dLHVHJXnuTrLdS meN9KVrrYc9Zrv9DhcX/fOO77qoauCCIwBobokezsBYuJozI9yoq5rlnk5/HZyTw4MHm 8KmA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rUGbldvJ; 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 n8-20020a05600c4f8800b00413f2978631si1626532wmq.113.2024.03.14.23.45.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Mar 2024 23:45:07 -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=rUGbldvJ; 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 0055987FBC; Fri, 15 Mar 2024 07:44:29 +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="rUGbldvJ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 41CAA87FC0; Fri, 15 Mar 2024 07:44:27 +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-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) (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 F2BED87FAA for ; Fri, 15 Mar 2024 07:44:24 +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-wr1-x435.google.com with SMTP id ffacd0b85a97d-33e966f56c7so1808634f8f.0 for ; Thu, 14 Mar 2024 23:44:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710485064; x=1711089864; 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=rUGbldvJ0cdBhzugyBCaf9WARmE5dcoqfXECUkgO261Tyxy/DpeJ4pV9mwc0oFtAK7 u5JgMZqEeDHYKy/6/jPh9D4eF+59Gys+e/eJuC6/y7sjo1krEPl/Jip6IWHoDpD5sDMT JpPCF+UjweSPpdsMUz7h6MFuBzF9SD2FUTeQ6l9R2e2dITfOvuMbbuZFya6Zcge7BzrJ aFrHIsO3yATOmAIEy18VccAyNBYHFXA6T1WQ/r1PSV9tVg2iVaEOURfqWIhxSW1yo0fz fqHuLnVTeBWkF3f0D+TiDmVtbylXimNimQ2sBmYHRKAeggAjT20HrScgYU1Tzy8ACz77 mVog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710485064; x=1711089864; 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=K81BaR+zlfWO+lzdwTeaIAd5395reEDVK5W8lCF7nbLk6QrwCR5Y7BiWGl98Qdl051 b/E6zwUxvmX42UlxzdxayNN7hPGlPjekpdj8EonZws4921MnhHttW1FAigYX1GpjSaLr KYiiKN0IgPf40KqDdbYSeqUGhCPa7UaaLtEgcjCv6O78J9JNQeREGtgl3Hz+s+i953go wyJUAnnlewEfR5QJ1qP/rwIPkW97mMhRyqAr2tVnclfpYBlvl3/vnGChggtVG2U1p9hI LgXIyqK7zLoKIiweP0UaCPq/GuUu+SMSy56nWM36VRpWxcoX3zkDraXcjdxtMC54JeY+ Gamw== X-Gm-Message-State: AOJu0Yy829DxDn1tRpeOMLijG/eYuAD6qR/IqF/9JmDOe5vG6Xe+x1h+ seZ5qhP9QShpCaJrKIKMdfEXGeii5l67+j5m7EDeqQgX1Zz7gmCnuxMvz/3LdsbwLpB+gAnnulF u X-Received: by 2002:a5d:694c:0:b0:33e:7637:51fd with SMTP id r12-20020a5d694c000000b0033e763751fdmr1697868wrw.48.1710485064344; Thu, 14 Mar 2024 23:44:24 -0700 (PDT) Received: from hades.. (ppp046103107123.access.hol.gr. [46.103.107.123]) by smtp.gmail.com with ESMTPSA id v18-20020adfe4d2000000b0033ec9936909sm2398658wrm.39.2024.03.14.23.44.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Mar 2024 23:44:24 -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 v4 5/7] arm: fix __efi_runtime_start/end definitions Date: Fri, 15 Mar 2024 08:43:49 +0200 Message-Id: <20240315064354.2215266-6-ilias.apalodimas@linaro.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20240315064354.2215266-1-ilias.apalodimas@linaro.org> References: <20240315064354.2215266-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 Fri Mar 15 06:43:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilias Apalodimas X-Patchwork-Id: 780480 Delivered-To: patch@linaro.org Received: by 2002:a5d:46c1:0:b0:33e:7753:30bd with SMTP id g1csp44230wrs; Thu, 14 Mar 2024 23:45:19 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXEvdLNeHmy3XLzVAU1eGyRPtwRMvvmoMj76tjlFOZpqjTgkGCfe8wM9yB4fSCIR5etutevH/4Hd5TCRz+NBQmC X-Google-Smtp-Source: AGHT+IEbzaGYYOm9zGM1WwuD/JFuGZu7or+RXhxHPdorbtHZ1DsYyBFLrxZBMNg3Sv1KUeaFn8+K X-Received: by 2002:a05:600c:4f0f:b0:413:ee48:9686 with SMTP id l15-20020a05600c4f0f00b00413ee489686mr3152590wmq.25.1710485119029; Thu, 14 Mar 2024 23:45:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1710485119; cv=none; d=google.com; s=arc-20160816; b=sKYMyea4JNCp80bRWEkZ9hZrIOMnwKmhyJUdk84Q5asiqFCTvmLbqSbG0vMhal8BMk S2BOmy0XehMrabXBPef2JPxjxPyAi17TSp1vJdvpgZFNaZfREo15lQbeWVvRKvJ2Hk4d asUWjHBMvLhqtjNtnJG9ESStE0bQxswoUmIJYN2z4nAa3fu1eSr8fh4VuZuv2wqR866w dlNUz9KpOtX3BO163dS4ac9GZ8t+IslyizVlIQsdyg4U0GnmCLzRT18bR54udmZVwaEy V0YyvqW392PZE9rYcsaHVehmC+q3UhR/qMn5Nf+XkHt1mM7V36qnq7fsgvHAF8Ar2Kp+ rtzw== 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=IZBcF3CeGjU1fWD9wHn4aKai3FlWH+Vdh/pV7X7yzFQ=; fh=Dl9U/cWBAjt0RA0ekDL4vfSYX5rQ4ZX9RknwKNQFT0M=; b=HsR6JXkXZ/Kb92dVZWYSZCigAO1sZKspJ5yQuYDdAIAJ6YQeNot+XRcKfnthod1Ney 5dWdtIKdFEQ8yIwlT+der2OFqUIifdb9/n/ow+It3yPQibUNgZz2bauZFDWGSb701esT v5g8YXWYIAzQx4Vg53K/sLHiBGfDSZHTZuDxAuMS7U8I7W5DMfLRfeIBZud06wbID5O1 Vyyo8ZSU+Bge92rcgNlFWZ/aDMXhRVZ9LMBewnppjrOTCWU5TJBVgW7w4oFNhcojsLae NxsDVuRX2CYvWI/An5SauYUEtPQMcqWCWmdkfFNblbp/shen+mkrdnS0o1OsoTEsgtiE 2klA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aSbFCWqJ; 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 e6-20020adffc46000000b0033eb0e09720si1233646wrs.752.2024.03.14.23.45.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Mar 2024 23:45:19 -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=aSbFCWqJ; 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 63DBB87FEC; Fri, 15 Mar 2024 07:44:33 +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="aSbFCWqJ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5417B87FE5; Fri, 15 Mar 2024 07:44:32 +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-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) (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 C1FFD87FDD for ; Fri, 15 Mar 2024 07:44:29 +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-wr1-x435.google.com with SMTP id ffacd0b85a97d-33e94c12cfaso1291806f8f.3 for ; Thu, 14 Mar 2024 23:44:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710485069; x=1711089869; 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=IZBcF3CeGjU1fWD9wHn4aKai3FlWH+Vdh/pV7X7yzFQ=; b=aSbFCWqJQTvxj9/oEbJH10tnoWVSTgopcnT5hslHG705Nn0Rln3EKxQuPrM/QUCBcn RTDS8XqzR6SCYoYkGrRzwm4ZE66mfobmSv+KFoCNYNWVv2yIEJS6S0GZzD42QmEx0jw5 fFI/Z8ONYbXJgQ4nLAmdsSpSv7PZKFYjth0auqDlW95DfZGaS6S0XKY5UybJjmmF0bmn 0w5wkfw7UmXAUlxho45YPv2MongqO2NVmI/2F/+uLY9oy8HOcQW/BgxCwDweWwAR80rP 2Pu4RXSeGPPuWsRPuAZ1TmdHMJJZbTRkM4kgvxXHhE5yhiAFwQe3yPU+vs4/K7BvKS28 M3aw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710485069; x=1711089869; 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=IZBcF3CeGjU1fWD9wHn4aKai3FlWH+Vdh/pV7X7yzFQ=; b=S8VTA7gUVjILfi+gFJdnLckb5l88yijqgWDLk3HulnBk1JQ8aEX6mYw0fZQ7KElbIF x2k1shyF34wipYXvbvLGTYeqcsZQN20oY6LMwkYCiU65VyRF9C9SCtYBQgX2gsSjlYqQ y5/bBfZ5sq6a9L9hq3+n2w6LwbCF102mZXVTFSonhW8ohY6ql2V6LOO3knot4od4ruZe l/gAZlBOqPEUQgXVUwxgbwRL2n4xZZ4t1HsI4Rat34XS57JjWrgPYjwlbYuyv1N6F+q/ omTxseM05U0kgeAAgSBI2xk4wcYYhYfBZv8arnJ38iRTCN+hQneuTfWeqxUUi63b71+V Ti1Q== X-Gm-Message-State: AOJu0YxbKxz3D9gf5YBbmkCk6w88L6/e9t0lj2dCG/H1NrGl76lLLmdJ jHGLDDYKXHkBGKxHz28hbrs5X3uE81bUdMhpXN86zel9bzYaXQFitkDjHBL2FTRMIrJxrHityA9 7 X-Received: by 2002:adf:ef52:0:b0:33e:790f:c3ed with SMTP id c18-20020adfef52000000b0033e790fc3edmr2708916wrp.10.1710485069317; Thu, 14 Mar 2024 23:44:29 -0700 (PDT) Received: from hades.. (ppp046103107123.access.hol.gr. [46.103.107.123]) by smtp.gmail.com with ESMTPSA id v18-20020adfe4d2000000b0033ec9936909sm2398658wrm.39.2024.03.14.23.44.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Mar 2024 23:44:29 -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 v4 6/7] arm: move image_copy_start/end to linker symbols Date: Fri, 15 Mar 2024 08:43:50 +0200 Message-Id: <20240315064354.2215266-7-ilias.apalodimas@linaro.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20240315064354.2215266-1-ilias.apalodimas@linaro.org> References: <20240315064354.2215266-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(-) diff --git a/arch/arm/cpu/armv8/u-boot-spl.lds b/arch/arm/cpu/armv8/u-boot-spl.lds index 8998c4985eac..ef8af67e11c3 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 Fri Mar 15 06:43:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilias Apalodimas X-Patchwork-Id: 780481 Delivered-To: patch@linaro.org Received: by 2002:a5d:46c1:0:b0:33e:7753:30bd with SMTP id g1csp44290wrs; Thu, 14 Mar 2024 23:45:31 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCW1W1cok9zlJ+Yl/QeS3XEkcTl8QXc27eQvu79A0g6zXcHKIkxdooLKVp7LDMjnbfF1bCLeVPvp1slEfphrvSvn X-Google-Smtp-Source: AGHT+IHgCmLlBMr4xREVeUJhiQkqxFkXSBMcfpk+jJFTKLfyIK6ppHudZMmP4zB5caCT7BEwU5m8 X-Received: by 2002:a05:600c:3149:b0:413:e924:f9f9 with SMTP id h9-20020a05600c314900b00413e924f9f9mr3076360wmo.23.1710485131743; Thu, 14 Mar 2024 23:45:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1710485131; cv=none; d=google.com; s=arc-20160816; b=NcwRfyGDh7g2kC3GT8FbN2nohWqvPCjVs7HoJ3sRrLztKURXjLyoBZC+H/34NtP3Yk z0AfqgokbJho3dcxytdq4XG+FI5ONL4LD8Eqfc4/5AyGeSg0I9JHfiiluPvsaNwzYnDo YuVFxDHmdbUisDU0TIBfoQ+v2f9f1nlKWtpqw7mtTBjLQjTaABqxuCmwIYWHG9l+yfJe R04D/Fu6oDQW8Tu6J6L/dXxjG1jXZbQGGn7d0GDSVFfurdReefTcFAPPTvhE7+J6RJfu +MW9pvWxDNMWvt/h2GVIimObLUm8scThium/TcZQ8+Cspmqt3X6Gkc4btLLJ/ZUMgQ1z nY9g== 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=MRm70MaX0hCLjwZUUTejH8I4YuwL8Hxl9oz63TDtGAk=; fh=YgAnvytc3PkIme27WTI0tmSPC4jrks+Z9IcIvi2eGZA=; b=F220GFda2Ht5vAoiHy0PdI6tm6ZvH5rHgdLFdhU5leZCIE3xy2HYFCR8GhnoVGbw2E wnO0OrLsUy1QSIY1qJ+d26tA67xtDGeU4wW5fhcxYjt9+gnullYX7OnNd2WMpMRr9BcH rWCnzg967wMlMtqN9GHUpqjt01ThmmRePOVkBlHrbYppFmXkLEKg0K17LUHkeqZ6R3Dp La4xceqNyb74VOqjla317TdvJ3UjWQNnEkqpZLtaWbKG6P5Y+MfvrQXzU17LMlJalQsr E//mE0hItjtVZY/2V8rk9vmiyKDTgiF1dBcCg0BRtju+f6wP/UCfVwv7EP+WCNNaHggb eIAg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EoDjQhXg; 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 fl17-20020a05600c0b9100b0041400d9af26si331778wmb.220.2024.03.14.23.45.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Mar 2024 23:45:31 -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=EoDjQhXg; 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 C475587FDE; Fri, 15 Mar 2024 07:44:39 +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="EoDjQhXg"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 310A887FE5; Fri, 15 Mar 2024 07:44:38 +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-x134.google.com (mail-lf1-x134.google.com [IPv6:2a00:1450:4864:20::134]) (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 2A62987FDD for ; Fri, 15 Mar 2024 07:44:36 +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-x134.google.com with SMTP id 2adb3069b0e04-512bde3d197so1734404e87.0 for ; Thu, 14 Mar 2024 23:44:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710485074; x=1711089874; 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=MRm70MaX0hCLjwZUUTejH8I4YuwL8Hxl9oz63TDtGAk=; b=EoDjQhXgCYJ4rj2Apgz/24rIqBaQo67uAANMseJMj9hY6HgX93BIUtloz1yEZeY+MJ 7pgUG5XF1lPGb8Dtr/tTmbqxygsI25UIJjCdAZrf7URPyOj2NP6S2A4rbhkvzknhrI1z +BAt5iawVxsjs3gqaWDpuQSGkjfjwJCrTWd5qcB/4TAsNOX69DT6Nll2MjgmyGyanUhn 0YGgAAUQps/Vfn0o3cLyJBJ0wzTvdmb+dIQziaFu5RDg2v40Okw7XI1YY9Q9XLA8JDUd e3P3MSzJLGdVC2eIRrHf66/FQBQNNkDOZbC37J0FypMSMACJxmHivK70R0P+1oKAEXk2 vEQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710485074; x=1711089874; 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=MRm70MaX0hCLjwZUUTejH8I4YuwL8Hxl9oz63TDtGAk=; b=fSDg6/AQ7EpY4lIhCLO1Xl+qOGanLq1HAKxL1I6hg9pA71bU6Ropn01XUvz8elpuIk lqR0Gu0au8JQ4TajTrJgvzEcjDXOXb/fRZZm14ZbzxSge2RsVhMIFsjTepNCWLoSGtYa u6mOzZHXvyDrSp3TecmYLEBmsxPSABYUpAfmnAghIPLQ3C4CIj5o3HakTKQ65+j/3y5F ZFn7Pixkpaz/l07TmBZ4+z0kx0Nb1XaUwxSiEEslrVt3YP8uUQEXeICCZTckKTfELZau Qbw0eUZfT/wGmOuTNDATnfVaoX+2/IgBtTiMpm0UpFsk6+jFTbhT79asz2zLzHoCrrl8 Md8Q== X-Gm-Message-State: AOJu0YzCaXwtVBgIrqx693lsPe4qaMhQ6xUxS/kWG4yX11hSQ2WKCxrW Ikwlqz4XaPJWMtiuBRjp8BV1M15MPMfULveSwSun3sigMq9RXWBIrXzVaH0hS528Xc26r/bbDnD H X-Received: by 2002:ac2:44b3:0:b0:513:7:fc3c with SMTP id c19-20020ac244b3000000b005130007fc3cmr2845360lfm.55.1710485074332; Thu, 14 Mar 2024 23:44:34 -0700 (PDT) Received: from hades.. (ppp046103107123.access.hol.gr. [46.103.107.123]) by smtp.gmail.com with ESMTPSA id v18-20020adfe4d2000000b0033ec9936909sm2398658wrm.39.2024.03.14.23.44.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Mar 2024 23:44: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 v4 7/7] arm: remove redundant section alignments Date: Fri, 15 Mar 2024 08:43:51 +0200 Message-Id: <20240315064354.2215266-8-ilias.apalodimas@linaro.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20240315064354.2215266-1-ilias.apalodimas@linaro.org> References: <20240315064354.2215266-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. Reviewed-by: Richard Henderson Signed-off-by: Ilias Apalodimas --- 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.*)