From patchwork Tue Mar 12 14:08:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilias Apalodimas X-Patchwork-Id: 779733 Delivered-To: patch@linaro.org Received: by 2002:a5d:604e:0:b0:33e:7753:30bd with SMTP id j14csp2040225wrt; Tue, 12 Mar 2024 07:09:46 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUJttX//9cmWlhPOUiY2gl5Vc+ILKjezL9+znHmIHCUMiJFEwzkfXsYCV3FeRLFkBZZzgC2g0K+IxIOZoQF9OSp X-Google-Smtp-Source: AGHT+IEM5cCOEQhrQpF9cql2eb34JTWY3Yd2y4W2BBabxveJ1I/lpIRI/ipiTR/DjKclTi2YHtdF X-Received: by 2002:a5d:4808:0:b0:33d:409b:5738 with SMTP id l8-20020a5d4808000000b0033d409b5738mr7208592wrq.26.1710252586534; Tue, 12 Mar 2024 07:09:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1710252586; cv=none; d=google.com; s=arc-20160816; b=WGduKK5YL9DOrVpL2ZcXFvNXjJfQ85UE1TgJTszIR67ySHanie1RpwHrxDI8IWOeid FRY//o7S6+6pYCu3rMHPQ8APUQJbQHTTtASYLqsqB6DFRG7VfL4lthQYvFwiL1cgMGyb LC6PFsSmQfv5qYV6z5ju9xwQp/8ritmhpImTjaNArlrgPTHVqVYNRgEPMgkgZHjzRxPI CCbA17EdEnmShAlJob6/qpnv9O/DYnTaNVKKy86iAJrwm0U8KEM9Tm2Fr6FILjcMp+ox RUFiDL3wWW46X5k+Yf0jTJlXkP+MnUdMAhahZ7xkt/F/0s0xSUfSl/WZJMT16lY3MkZZ wCCA== 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=ZaScewqBQfQe1ZYJSJupnjWvoj3IezG3YAWy8EhJX64=; fh=Dl9U/cWBAjt0RA0ekDL4vfSYX5rQ4ZX9RknwKNQFT0M=; b=Dc4EzOagzdMg6R4c070859oxBTuuw0p2LEFNaFZxw5nlhed0AK9pZzOuK5vod3ki5G h9erM4lI6D2IktRC/PPdbHYHlocLhHGnMeRTR+vBWH8bQGmwAgejNr5kJTd0FcGsQkcP NrLlk9+M4m9xweBDsjlbOp/1VFKo9ZAtrQASg73ntF6N0uOq8CTDbjNkHO8cavgjof2o tqiBlA7ZenbixpETU+ZTf3wC2wjVozOaV9V8HoPbVzxdXlKL21Mav0rM/ms4cF7vJOUB eIi4UHezvQNmufilsx0qEcJJpmf1KcoI9jYwNrQSpiR8UHWYb+gZ17/jxbTUoVUyAbSs bY5g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YQYoSpHg; 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 s11-20020adfdb0b000000b0033e925a81b5si2725758wri.731.2024.03.12.07.09.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Mar 2024 07:09:46 -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=YQYoSpHg; 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 549A887FA0; Tue, 12 Mar 2024 15:09:11 +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="YQYoSpHg"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C3EED87F8C; Tue, 12 Mar 2024 15:09:09 +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-x533.google.com (mail-ed1-x533.google.com [IPv6:2a00:1450:4864:20::533]) (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 B4F9B87FA0 for ; Tue, 12 Mar 2024 15:09:07 +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-x533.google.com with SMTP id 4fb4d7f45d1cf-5684c3313cdso3224407a12.3 for ; Tue, 12 Mar 2024 07:09:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710252547; x=1710857347; 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=ZaScewqBQfQe1ZYJSJupnjWvoj3IezG3YAWy8EhJX64=; b=YQYoSpHgIXuFHcDWlNkpgafJZnAp/ofW3toU05xiAHfhwiRO78J3iYnW9/huRAJ/63 H9xhHNZ9fN9+SFLTrQGmo4Kp4e2fXoojRsWOeKLtiEO+bQMW32bKJ6CcDipzCXNZHx/i SOQnfpWPShN5px8kTufo4hCB95HXUfEmIV2hDRghqopBZe98f2rQgmF+TQkqJ48uJL5f srxJUf6RnTykjTE/B34T3oJQkTIXj6B2xm3MZzAeEUlDRTEjFbdsNVuYqSVxoXrflfBZ xmMuZCMIOmOWncyqXhe1FdyX2HTGeOSOJe29fHTCYGwmncGT1bfd7n9otyphgX6ZAS7X 1tdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710252547; x=1710857347; 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=ZaScewqBQfQe1ZYJSJupnjWvoj3IezG3YAWy8EhJX64=; b=DLQ+agHjy4WCyVUnjfiGrVOYlSkHlqHOT74TxAVdePJiFpQmERK4yB5K7ZDL5STR8E 8yqPGEmSs/2z8Z0Lnmt1ULCAus8D+61N8pkDaeQmmRqgc8UMZgKjiehEONenzeTnRFBB C9Xo89OHj1kmE4qpIe/CU6V5iENYwjuPWcjCsfNMFxT/KIcxOz4b1u20HFWzjOCOwBcn WHs2wtL2ww8iG/libTlEyo47kq1/NJlLhnwxk+BlMYsH5XQizQZ8oEqgJ3JDjfs2FqCh zEbudxbUIWZqjJ5vAmO7092ZausSHE7+kfCb9RLsvSaXt8mvP1XSpI8eJ+8blxayvvTB fHDw== X-Gm-Message-State: AOJu0Yxs6eFHIrgiWP1asexKxK4q2qSyksx5NCIChiPokJOc0gsfgNiG 9MeL+GIc+wS8n3ibcftAkF8JMa9hRDywTbRuArXu3fjo1KRU0N8IPPUtxVi+Vr2SELQRY42qYUk seD8= X-Received: by 2002:a50:8717:0:b0:567:9ddd:65c3 with SMTP id i23-20020a508717000000b005679ddd65c3mr6884379edb.29.1710252546958; Tue, 12 Mar 2024 07:09:06 -0700 (PDT) Received: from hades.. (ppp046103107123.access.hol.gr. [46.103.107.123]) by smtp.gmail.com with ESMTPSA id d23-20020a056402001700b0056857701bf5sm2246086edu.81.2024.03.12.07.09.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Mar 2024 07:09:06 -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 6/7 v2] arm: move image_copy_start/end to linker symbols Date: Tue, 12 Mar 2024 16:08:28 +0200 Message-Id: <20240312140832.1968215-7-ilias.apalodimas@linaro.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20240312140832.1968215-1-ilias.apalodimas@linaro.org> References: <20240312140832.1968215-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 Signed-off-by: Ilias Apalodimas Tested-by: Sam Edwards # Binary output identical Reviewed-by: Richard Henderson --- arch/arm/cpu/armv8/u-boot-spl.lds | 7 ++----- arch/arm/cpu/armv8/u-boot.lds | 9 ++------- arch/arm/cpu/u-boot-spl.lds | 2 +- arch/arm/cpu/u-boot.lds | 9 ++------- 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 | 7 ++----- arch/arm/mach-zynq/u-boot-spl.lds | 2 +- arch/arm/mach-zynq/u-boot.lds | 8 ++------ 9 files changed, 13 insertions(+), 35 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 16fddb46e9cb..6417cbd08e2c 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,7 @@ SECTIONS KEEP(*(SORT(__u_boot_list*))); } >.sram - .image_copy_end : { - . = ALIGN(8); - *(.__image_copy_end) - } >.sram + __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 e737de761a9d..33f4624b561d 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*) } @@ -122,12 +122,7 @@ SECTIONS __efi_runtime_rel_stop = .; } - . = 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 df979986a5ef..b6b19a4174fe 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*) } @@ -153,12 +153,7 @@ SECTIONS __efi_runtime_rel_stop = .; } - . = 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 b7887194026e..8ff35b5c17cf 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,7 @@ SECTIONS KEEP(*(SORT(__u_boot_list*))); } - .image_copy_end : { - . = ALIGN(8); - *(.__image_copy_end) - } + __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 fc0ba0ed9a84..f739d1cfce85 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*) } @@ -59,11 +59,7 @@ SECTIONS __efi_runtime_rel_stop = .; } - . = ALIGN(8); - .image_copy_end : - { - *(.__image_copy_end) - } + __image_copy_end = .; .rel.dyn ALIGN(8) : { __rel_dyn_start = .;