public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Sam Edwards <cfsworks@gmail.com>
To: Ilias Apalodimas <ilias.apalodimas@linaro.org>,
	u-boot@lists.denx.de, trini@konsulko.com
Cc: caleb.connolly@linaro.org, sumit.garg@linaro.org,
	Simon Glass <sjg@chromium.org>,
	Philipp Tomsich <philipp.tomsich@vrull.eu>,
	Kever Yang <kever.yang@rock-chips.com>,
	Michal Simek <michal.simek@amd.com>,
	Yegor Yefremov <yegorslists@googlemail.com>,
	Heinrich Schuchardt <xypron.glpk@gmx.de>,
	Shiji Yang <yangshiji66@outlook.com>,
	Bin Meng <bmeng@tinylab.org>
Subject: Re: [PATCH 6/6] arm: move image_copy_start/end to linker symbols
Date: Wed, 6 Mar 2024 01:22:08 -0700	[thread overview]
Message-ID: <6c4f6b76-0828-497f-a45c-e9bc307620bb@gmail.com> (raw)
In-Reply-To: <20240304090113.1410575-7-ilias.apalodimas@linaro.org>

On 3/4/24 02:01, Ilias Apalodimas wrote:
> 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.
> 
> 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.
> 
> Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Tested-by: Sam Edwards <CFSworks@gmail.com> # Binary output identical

Since the __image_copy_* symbols are marking boundaries in the whole 
image as opposed to a single section, I'd find it clearer if they were 
loose in the SECTIONS { ... } block, so as not to imply that they are 
coupled to any particular section. Thoughts?

Thanks for the cleanup,
Sam

> ---
>   arch/arm/cpu/armv8/u-boot.lds            | 10 ++--------
>   arch/arm/cpu/u-boot.lds                  | 10 ++--------
>   arch/arm/lib/sections.c                  |  2 --
>   arch/arm/mach-rockchip/u-boot-tpl-v8.lds |  8 ++------
>   arch/arm/mach-zynq/u-boot.lds            |  9 ++-------
>   5 files changed, 8 insertions(+), 31 deletions(-)
> 
> diff --git a/arch/arm/cpu/armv8/u-boot.lds b/arch/arm/cpu/armv8/u-boot.lds
> index e737de761a9d..340acf5c043b 100644
> --- a/arch/arm/cpu/armv8/u-boot.lds
> +++ b/arch/arm/cpu/armv8/u-boot.lds
> @@ -23,7 +23,7 @@ SECTIONS
>   	. = ALIGN(8);
>   	.text :
>   	{
> -		*(.__image_copy_start)
> +		__image_copy_start = .;
>   		CPUDIR/start.o (.text*)
>   	}
>   
> @@ -120,13 +120,7 @@ SECTIONS
>   		*(.rel*.efi_runtime)
>   		*(.rel*.efi_runtime.*)
>                   __efi_runtime_rel_stop = .;
> -	}
> -
> -	. = ALIGN(8);
> -
> -	.image_copy_end :
> -	{
> -		*(.__image_copy_end)
> +		__image_copy_end = .;
>   	}
>   
>   	.rela.dyn ALIGN(8) : {
> diff --git a/arch/arm/cpu/u-boot.lds b/arch/arm/cpu/u-boot.lds
> index df55bb716e35..7c4f9c2d4dd3 100644
> --- a/arch/arm/cpu/u-boot.lds
> +++ b/arch/arm/cpu/u-boot.lds
> @@ -37,7 +37,7 @@ SECTIONS
>   	. = ALIGN(4);
>   	.text :
>   	{
> -		*(.__image_copy_start)
> +		__image_copy_start = .;
>   		*(.vectors)
>   		CPUDIR/start.o (.text*)
>   	}
> @@ -151,13 +151,7 @@ SECTIONS
>   		*(.rel*.efi_runtime)
>   		*(.rel*.efi_runtime.*)
>   		__efi_runtime_rel_stop = .;
> -	}
> -
> -	. = ALIGN(4);
> -
> -	.image_copy_end :
> -	{
> -		*(.__image_copy_end)
> +		__image_copy_end = .;
>   	}
>   
>   	.rel.dyn ALIGN(4) : {
> 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-rockchip/u-boot-tpl-v8.lds b/arch/arm/mach-rockchip/u-boot-tpl-v8.lds
> index b7887194026e..4b480ebb0c4d 100644
> --- a/arch/arm/mach-rockchip/u-boot-tpl-v8.lds
> +++ b/arch/arm/mach-rockchip/u-boot-tpl-v8.lds
> @@ -24,7 +24,7 @@ SECTIONS
>   
>   	.text : {
>   		. = ALIGN(8);
> -		*(.__image_copy_start)
> +		__image_copy_start = .;
>   		CPUDIR/start.o (.text*)
>   		*(.text*)
>   	}
> @@ -42,11 +42,7 @@ SECTIONS
>   	__u_boot_list : {
>   		. = ALIGN(8);
>   		KEEP(*(SORT(__u_boot_list*)));
> -	}
> -
> -	.image_copy_end : {
> -		. = ALIGN(8);
> -		*(.__image_copy_end)
> +		__image_copy_end = .;
>   	}
>   
>   	.end : {
> diff --git a/arch/arm/mach-zynq/u-boot.lds b/arch/arm/mach-zynq/u-boot.lds
> index fcd0f42a7106..553bcf182272 100644
> --- a/arch/arm/mach-zynq/u-boot.lds
> +++ b/arch/arm/mach-zynq/u-boot.lds
> @@ -16,7 +16,7 @@ SECTIONS
>   	. = ALIGN(4);
>   	.text :
>   	{
> -		*(.__image_copy_start)
> +		__image_copy_start = .;
>   		*(.vectors)
>   		CPUDIR/start.o (.text*)
>   	}
> @@ -57,12 +57,7 @@ SECTIONS
>   		*(.rel*.efi_runtime)
>   		*(.rel*.efi_runtime.*)
>   		__efi_runtime_rel_stop = .;
> -	}
> -
> -	. = ALIGN(8);
> -	.image_copy_end :
> -	{
> -		*(.__image_copy_end)
> +		__image_copy_end = .;
>   	}
>   
>   	.rel.dyn ALIGN(8) : {

  reply	other threads:[~2024-03-06  8:22 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-04  9:01 [PATCH 0/6] Clean up arm linker scripts Ilias Apalodimas
2024-03-04  9:01 ` [PATCH 1/6] arm: baltos: remove custom linker script Ilias Apalodimas
2024-03-04  9:01 ` [PATCH 2/6] arm: clean up v7 and v8 linker scripts for bss_start/end Ilias Apalodimas
2024-03-06  7:32   ` Sam Edwards
2024-03-06  9:08     ` Ilias Apalodimas
2024-03-06 10:11       ` Ilias Apalodimas
2024-03-04  9:01 ` [PATCH 3/6] arm: fix __efi_runtime_rel_start/end definitions Ilias Apalodimas
2024-03-06  7:35   ` Sam Edwards
2024-03-04  9:01 ` [PATCH 4/6] arm: clean up v7 and v8 linker scripts for __rel_dyn_start/end Ilias Apalodimas
2024-03-06  7:35   ` Sam Edwards
2024-03-04  9:01 ` [PATCH 5/6] arm: fix __efi_runtime_start/end definitions Ilias Apalodimas
2024-03-06  8:14   ` Sam Edwards
2024-03-06  9:13     ` Ilias Apalodimas
2024-03-06 22:19       ` Sam Edwards
2024-03-07  6:50         ` Ilias Apalodimas
2024-03-08 13:22           ` Ilias Apalodimas
2024-03-08 14:14             ` Ilias Apalodimas
2024-03-08 15:10               ` Ilias Apalodimas
2024-03-04  9:01 ` [PATCH 6/6] arm: move image_copy_start/end to linker symbols Ilias Apalodimas
2024-03-06  8:22   ` Sam Edwards [this message]
2024-03-06  9:35     ` Ilias Apalodimas
2024-03-06 10:37       ` Ilias Apalodimas
2024-03-06 13:23         ` Ilias Apalodimas
2024-03-06 23:08           ` Sam Edwards
2024-03-07  6:55             ` Ilias Apalodimas
2024-03-07 16:45               ` Ilias Apalodimas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6c4f6b76-0828-497f-a45c-e9bc307620bb@gmail.com \
    --to=cfsworks@gmail.com \
    --cc=bmeng@tinylab.org \
    --cc=caleb.connolly@linaro.org \
    --cc=ilias.apalodimas@linaro.org \
    --cc=kever.yang@rock-chips.com \
    --cc=michal.simek@amd.com \
    --cc=philipp.tomsich@vrull.eu \
    --cc=sjg@chromium.org \
    --cc=sumit.garg@linaro.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    --cc=xypron.glpk@gmx.de \
    --cc=yangshiji66@outlook.com \
    --cc=yegorslists@googlemail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox