[U-Boot] [PATCH v7 11/19] arm: relocate_code(): Use __image_copy_end for end of relocation

Albert ARIBAUD
2013-02-17T14:30:51Z

Hi Beno?t,

On Sat, 16 Feb 2013 20:54:01 +0100 (CET), Beno?t Th?baudeau
<benoit.thebaudeau@advansee.com> wrote:

> Hi Albert,
>
> On Saturday, February 16, 2013 7:47:13 PM, Albert ARIBAUD wrote:
> > Hi Beno?t,
> >
> > On Fri, 15 Feb 2013 21:54:17 +0100, Beno?t Th?baudeau
> > <benoit.thebaudeau@advansee.com> wrote:
> >
> > > Use __image_copy_end instead of __bss_start for the end of the image to
> > > relocate. This is the same as commit 033ca72, but applied to all ARM
> > > start.S.
> >
> > What is the benefit of this? I find it more logical for BSS-related
> > code to use a BSS-related symbol than an image-copy related symbol.
>
> I don't see why you are talking about BSS-related code. This piece of code is
> just supposed to copy the text and rodata from the source image to its
> destination location, before optionally relocating its symbols. BSS has nothing
> to do with this, so I find this image-copy symbol more appropriate here.
>
> But besides the naming, the benefit is also that some linker scripts put some
> stuff (e.g. MMU tables used early before jumping to relocated code, or
> relocation info) between this __image_copy_end and __bss_start, that does not
> have to be copied or relocated, so this patch saves a useless data copy in that
> case.

Apologies -- this is indeed copy-related, not BSS-related, code, and
thus the image-copy related symbol is apt, and your additional note
makes it all the more valid.

> Best regards,
> Beno?t

Amicalement,
--
Albert.