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 3/5] arm: make relocation symbols compiler-generated
Date: Wed, 15 May 2013 08:39:54 +0200	[thread overview]
Message-ID: <20130515083954.4b529488@lilith> (raw)
In-Reply-To: <1432148385.822742.1368569348619.JavaMail.root@advansee.com>

Hi Beno?t,

On Wed, 15 May 2013 00:09:08 +0200 (CEST), Beno?t Th?baudeau
<benoit.thebaudeau@advansee.com> wrote:

> Hi Albert,
> 
> On Tuesday, May 14, 2013 10:02:58 PM, Albert ARIBAUD wrote:
> > This change is only done where needed: some linker
> > scripts may contain relocation symbols yet remain
> > unchanged.
> > 
> > __rel_dyn_start, __rel_dyn_end and __dynsym_start
> > each requires its own output section; putting them
> > in relocation sections changes the sections' nature
> > which breaks relocation.
> > 
> > Signed-off-by: Albert ARIBAUD <albert.u.boot@aribaud.net>
> 
> [...]
> 
> > diff --git a/arch/arm/lib/relocate.S b/arch/arm/lib/relocate.S
> > index 2f22c8c..818735c 100644
> > --- a/arch/arm/lib/relocate.S
> > +++ b/arch/arm/lib/relocate.S
> > @@ -54,12 +54,9 @@ copy_loop:
> >  	/*
> >  	 * fix .rel.dyn relocations
> >  	 */
> > -	ldr	r10, _dynsym_start_ofs	/* r10 <- sym table ofs */
> > -	add	r10, r10, r9		/* r10 <- sym table in FLASH */
> > -	ldr	r2, _rel_dyn_start_ofs	/* r2 <- rel dyn start ofs */
> > -	add	r2, r2, r9		/* r2 <- rel dyn start in FLASH */
> > -	ldr	r3, _rel_dyn_end_ofs	/* r3 <- rel dyn end ofs */
> > -	add	r3, r3, r9		/* r3 <- rel dyn end in FLASH */
> > +	ldr	r10, =__dynsym_start	/* r10 <- sym table ofs */
> > +	ldr	r2, =__rel_dyn_start	/* r2 <- rel dyn start ofs */
> > +	ldr	r3, =__rel_dyn_end	/* r3 <- rel dyn end ofs */
> 
> 'ofs' -> 'in FLASH' in the comments of the 3 lines above.

You are right that 'ofs' should have disappeared from the comments; but
'in FLASH' is right only for some U-Boots and wrong for others, as some
U-Boots indeed run their board_init_f phase in FLASH, but others run in
DDR and thus, copy themselves to DDR from DDR, not FLASH, notably those
with an SPL.

So the most correct commenting is using 'SRC' and 'DST'; will fix in V3
with 'sym table SRC addr' etc.

> Best regards,
> Beno?t

Amicalement,
-- 
Albert.

  reply	other threads:[~2013-05-15  6:39 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-14 20:02 [U-Boot] [PATCH 0/5] Optimize ARM relocation Albert ARIBAUD
2013-05-14 20:02 ` [U-Boot] [PATCH 1/5] arm: generalize lib/bss.c into lib/sections.c Albert ARIBAUD
2013-05-14 20:02   ` [U-Boot] [PATCH 2/5] arm: make __image_copy_{start, end} compiler-generated Albert ARIBAUD
2013-05-14 20:02     ` [U-Boot] [PATCH 3/5] arm: make relocation symbols compiler-generated Albert ARIBAUD
2013-05-14 20:02       ` [U-Boot] [PATCH 4/5] arm: ensure u-boot only uses relative relocations Albert ARIBAUD
2013-05-14 20:03         ` [U-Boot] [PATCH 5/5] arm: optimize relocate_code routine Albert ARIBAUD
2013-05-14 23:54           ` Benoît Thébaudeau
2013-05-15  7:32             ` Albert ARIBAUD
2013-05-14 22:12         ` [U-Boot] [PATCH 4/5] arm: ensure u-boot only uses relative relocations Benoît Thébaudeau
2013-05-15  7:46           ` Albert ARIBAUD
2013-05-15  9:38             ` Albert ARIBAUD
2013-05-15 13:49               ` Benoît Thébaudeau
2013-05-15 15:01                 ` Albert ARIBAUD
2013-05-14 22:09       ` [U-Boot] [PATCH 3/5] arm: make relocation symbols compiler-generated Benoît Thébaudeau
2013-05-15  6:39         ` Albert ARIBAUD [this message]
2013-05-15  6:41           ` Albert ARIBAUD
2013-05-14 20:16 ` [U-Boot] [PATCH 0/5] Optimize ARM relocation Albert ARIBAUD
2013-05-14 23:58   ` Benoît Thébaudeau
2013-05-15  7:49     ` Albert ARIBAUD
2013-05-28  7:01 ` [U-Boot] [PATCH v2 0/6] " Albert ARIBAUD
2013-05-28  7:01   ` [U-Boot] [PATCH v2 1/6] arm: ensure u-boot only uses relative relocations Albert ARIBAUD
2013-05-28  7:01     ` [U-Boot] [PATCH v2 2/6] remove all references to .dynsym Albert ARIBAUD
2013-05-28  7:01       ` [U-Boot] [PATCH v2 3/6] arm: generalize lib/bss.c into lib/sections.c Albert ARIBAUD
2013-05-28  7:01         ` [U-Boot] [PATCH v2 4/6] arm: make __image_copy_{start, end} compiler-generated Albert ARIBAUD
2013-05-28  7:01           ` [U-Boot] [PATCH v2 5/6] arm: make __rel_dyn_{start, " Albert ARIBAUD
2013-05-28  7:01             ` [U-Boot] [PATCH v2 6/6] arm: optimize relocate_code routine Albert ARIBAUD
2013-05-28 17:11           ` [U-Boot] [PATCH v2 4/6] arm: make __image_copy_{start, end} compiler-generated Benoît Thébaudeau
2013-05-28 17:04     ` [U-Boot] [PATCH v2 1/6] arm: ensure u-boot only uses relative relocations Benoît Thébaudeau
2013-05-28 17:31       ` Albert ARIBAUD
2013-06-11 12:17   ` [U-Boot] [PATCH v3 0/6] Optimize ARM relocation Albert ARIBAUD
2013-06-11 12:17     ` [U-Boot] [PATCH v3 1/6] arm: ensure u-boot only uses relative relocations Albert ARIBAUD
2013-06-11 12:17       ` [U-Boot] [PATCH v3 2/6] remove all references to .dynsym Albert ARIBAUD
2013-06-11 12:17         ` [U-Boot] [PATCH v3 3/6] arm: generalize lib/bss.c into lib/sections.c Albert ARIBAUD
2013-06-11 12:17           ` [U-Boot] [PATCH v3 4/6] arm: make __image_copy_{start, end} compiler-generated Albert ARIBAUD
2013-06-11 12:17             ` [U-Boot] [PATCH v3 5/6] arm: make __rel_dyn_{start, " Albert ARIBAUD
2013-06-11 12:17               ` [U-Boot] [PATCH v3 6/6] arm: optimize relocate_code routine Albert ARIBAUD
2013-06-11 12:47     ` [U-Boot] [PATCH v3 0/6] Optimize ARM relocation Albert ARIBAUD
2013-06-11 14:22       ` Lubomir Popov
2013-06-11 15:29         ` Albert ARIBAUD
2013-06-13  9:05       ` Albert ARIBAUD
2013-06-13 18:54         ` Jeroen Hofstee
2013-06-16 13:33           ` Jeroen Hofstee
2013-06-18 14:54             ` Albert ARIBAUD
2013-06-19  7:31               ` [U-Boot] [LONG] " Albert ARIBAUD
2013-06-12 22:38     ` [U-Boot] " Benoît Thébaudeau
2013-06-21 21:07     ` Albert ARIBAUD

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=20130515083954.4b529488@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