public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Albert ARIBAUD <albert.u.boot@aribaud.net>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/4] arm: make __image_copy_{start, end} compiler-generated
Date: Sat, 11 May 2013 10:02:48 +0200	[thread overview]
Message-ID: <20130511100248.60a853ee@lilith> (raw)
In-Reply-To: <794454861.738554.1368231902880.JavaMail.root@advansee.com>

Hi Beno?t,

On Sat, 11 May 2013 02:25:02 +0200 (CEST), Beno?t Th?baudeau
<benoit.thebaudeau@advansee.com> wrote:

> Hi Albert,

> > diff --git a/arch/arm/cpu/arm1136/start.S b/arch/arm/cpu/arm1136/start.S
> > index ccea2d5..ab8fd56 100644
> > --- a/arch/arm/cpu/arm1136/start.S
> > +++ b/arch/arm/cpu/arm1136/start.S
> > @@ -104,10 +104,6 @@ _TEXT_BASE:
> >  _bss_start_ofs:
> >  	.word __bss_start - _start
> >  
> > -.globl _image_copy_end_ofs
> 
> Wasn't _image_copy_end_ofs used outside of start.S? Same question for all the
> start.S files.

No -- and the build would have failed if it was. The only user of
__image_copy_end_ofs is the start.S which defines it, and only for the
purpose of preventing the assembler from generating an R_ARM_ABS32
relocation to __image_copy_end.

> > diff --git a/arch/arm/cpu/arm1136/u-boot-spl.lds
> > b/arch/arm/cpu/arm1136/u-boot-spl.lds
> > index 8296e5d..04fc881 100644
> > --- a/arch/arm/cpu/arm1136/u-boot-spl.lds
> > +++ b/arch/arm/cpu/arm1136/u-boot-spl.lds
> > @@ -37,7 +37,6 @@ SECTIONS
> >  {
> >  	.text      :
> >  	{
> > -	__start = .;
> >  	  arch/arm/cpu/arm1136/start.o	(.text*)
> >  	  *(.text*)
> >  	} >.sram
> > @@ -48,7 +47,9 @@ SECTIONS
> >  	. = ALIGN(4);
> >  	.data : { *(SORT_BY_ALIGNMENT(.data*)) } >.sram
> >  	. = ALIGN(4);
> > +
> >  	__image_copy_end = .;
> 
> Why aren't all linker scripts treated equally?
> 
> Here, start.S is still used, so '*(.__image_copy_end)' and the related stuff
> should be like what you did for arch/arm/cpu/u-boot.lds below. Or am I missing
> something?
> 
> Same question for several other linker scripts below.

Not all SPLs use relocation -- actually, most SPLs do not use
relocation, and thus do not need image and relocaton section symbols.

> > diff --git a/arch/arm/cpu/u-boot.lds b/arch/arm/cpu/u-boot.lds
> > index d9bbee3..5b43621 100644
> > --- a/arch/arm/cpu/u-boot.lds
> > +++ b/arch/arm/cpu/u-boot.lds
> > @@ -33,7 +33,7 @@ SECTIONS
> >  	. = ALIGN(4);
> >  	.text :
> >  	{
> > -		__image_copy_start = .;
> > +		*(.__image_copy_start)
> 
> Are there any users of __image_copy_start?

(see below)

> > diff --git a/arch/arm/lib/sections.c b/arch/arm/lib/sections.c
> > index 99eda59..80a0c38 100644
> > --- a/arch/arm/lib/sections.c
> +++ b/arch/arm/lib/sections.c

> > @@ -37,3 +37,5 @@
> >  
> >  char __bss_start[0] __attribute__((used, section(".__bss_start")));
> >  char __bss_end[0] __attribute__((used, section(".__bss_end")));
> > +char __image_copy_start[0] __attribute__((used,
> > section(".__image_copy_start")));
> 
> Ditto.

The only user of __image_copy_start is the relocation routine which
uses _start but should actually use __image_copy_start (will fix in V2),
to match with the semantics introduced when fixing CONFIG_SPL_MAX_SIZE
semantics in 6ebc3461.
 
> Best regards,
> Beno?t

Thanks for your review!

Amicalement,
-- 
Albert.

  reply	other threads:[~2013-05-11  8:02 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-10 21:56 [U-Boot] [PATCH 0/4] Factorize ARM relocation code Albert ARIBAUD
2013-05-10 21:56 ` [U-Boot] [PATCH 1/4] Rename arch/arm/lib/bss.c to sections.c Albert ARIBAUD
2013-05-10 21:56   ` [U-Boot] [PATCH 2/4] arm: make __image_copy_{start, end} compiler-generated Albert ARIBAUD
2013-05-10 21:56     ` [U-Boot] [PATCH 3/4] arm: make relocation section symbols compiler-generated Albert ARIBAUD
2013-05-10 21:56       ` [U-Boot] [PATCH 4/4] arm: factorize relocate_code routine Albert ARIBAUD
2013-05-11  2:04         ` Benoît Thébaudeau
2013-05-11  7:40           ` Albert ARIBAUD
2013-05-11 13:40             ` Benoît Thébaudeau
2013-05-11 22:13         ` Simon Glass
2013-05-11  0:25     ` [U-Boot] [PATCH 2/4] arm: make __image_copy_{start, end} compiler-generated Benoît Thébaudeau
2013-05-11  8:02       ` Albert ARIBAUD [this message]
2013-05-11 17:52         ` Benoît Thébaudeau
2013-05-11 20:13           ` Albert ARIBAUD
2013-05-12  8:57             ` Albert ARIBAUD
2013-05-14  9:50 ` [U-Boot] [PATCH v2 0/4] Factorize ARM relocate_code instances Albert ARIBAUD
2013-05-14  9:50   ` [U-Boot] [PATCH v2 1/4] mx31pdk: copy SPL directly, not using relocate_code Albert ARIBAUD
2013-05-14  9:50     ` [U-Boot] [PATCH v2 2/4] tx25: " Albert ARIBAUD
2013-05-14  9:50       ` [U-Boot] [PATCH v2 3/4] arm: do not compile relocate_code() for SPL builds Albert ARIBAUD
2013-05-14  9:50         ` [U-Boot] [PATCH v2 4/4] arm: factorize relocate_code routine Albert ARIBAUD
2013-05-14 16:01           ` Benoît Thébaudeau
2013-05-14 16:32             ` Albert ARIBAUD
2013-05-14 17:17               ` Benoît Thébaudeau
2013-05-14 18:51                 ` Albert ARIBAUD
2013-05-14 18:49                   ` Benoît Thébaudeau
2013-05-15  7:31             ` Albert ARIBAUD
2013-05-15  8:30               ` Albert ARIBAUD
2013-05-15 16:36                 ` Benoît Thébaudeau
2013-05-15 17:55                   ` Albert ARIBAUD
2013-05-16 14:29                     ` Albert ARIBAUD
2013-05-16 14:28                       ` Benoît Thébaudeau
2013-05-16 14:52                         ` Albert ARIBAUD
2013-05-16 14:56                           ` Albert ARIBAUD
2013-05-14 15:21         ` [U-Boot] [PATCH v2 3/4] arm: do not compile relocate_code() for SPL builds Benoît Thébaudeau
2013-05-14 16:21           ` Albert ARIBAUD
2013-05-14 17:12             ` Benoît Thébaudeau
2013-05-14 15:15       ` [U-Boot] [PATCH v2 2/4] tx25: copy SPL directly, not using relocate_code Benoît Thébaudeau
2013-05-14 15:14     ` [U-Boot] [PATCH v2 1/4] mx31pdk: " Benoît Thébaudeau
2013-05-14 16:13       ` Albert ARIBAUD
2013-05-14 17:10         ` Benoît Thébaudeau
2013-05-14 18:24           ` Albert ARIBAUD
2013-05-14  9:55   ` [U-Boot] [PATCH v2 0/4] Factorize ARM relocate_code instances Albert ARIBAUD
2013-05-16 12:02   ` [U-Boot] [PATCH v3 " Albert ARIBAUD
2013-05-16 12:02     ` [U-Boot] [PATCH v3 1/4] mx31pdk: copy SPL directly, not using relocate_code Albert ARIBAUD
2013-05-16 12:02       ` [U-Boot] [PATCH v3 2/4] tx25: " Albert ARIBAUD
2013-05-16 12:02         ` [U-Boot] [PATCH v3 3/4] arm: do not compile relocate_code() for SPL builds Albert ARIBAUD
2013-05-16 12:02           ` [U-Boot] [PATCH v3 4/4] arm: factorize relocate_code routine Albert ARIBAUD
2013-05-16 15:56             ` Benoît Thébaudeau
2013-05-16 16:57               ` Albert ARIBAUD
2013-05-16 14:53     ` [U-Boot] [PATCH v3 0/4] Factorize ARM relocate_code instances Albert ARIBAUD
2013-05-16 14:55       ` Albert ARIBAUD
2013-05-19 11:48     ` [U-Boot] [PATCH v4 " Albert ARIBAUD
2013-05-19 11:48       ` [U-Boot] [PATCH v4 1/4] mx31pdk: copy SPL directly, not using relocate_code Albert ARIBAUD
2013-05-19 11:48         ` [U-Boot] [PATCH v4 2/4] tx25: " Albert ARIBAUD
2013-05-19 11:48           ` [U-Boot] [PATCH v4 3/4] arm: do not compile relocate_code() for SPL builds Albert ARIBAUD
2013-05-19 11:48             ` [U-Boot] [PATCH v4 4/4] arm: factorize relocate_code routine Albert ARIBAUD
2013-05-19 15:57       ` [U-Boot] [PATCH v4 0/4] Factorize ARM relocate_code instances Benoît Thébaudeau
2013-05-20  9:26         ` Albert ARIBAUD
2013-05-20 15:39           ` Benoît Thébaudeau
2013-05-21 13:24             ` Fabio Estevam
2013-05-28 13:28               ` Albert ARIBAUD
2013-05-29 12:57                 ` Fabio Estevam
2013-05-27 14:56           ` Simon Glass
2013-05-27 16:16             ` Albert ARIBAUD
2013-05-27 16:37               ` Simon Glass

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=20130511100248.60a853ee@lilith \
    --to=albert.u.boot@aribaud.net \
    --cc=u-boot@lists.denx.de \
    /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