[U-Boot] [PATCH v2 6/7] arm: add a common .lds link script

Simon Glass sjg at chromium.org
Tue Feb 21 03:32:29 CET 2012


Hi Albert,

On Fri, Feb 17, 2012 at 3:08 AM, Albert ARIBAUD
<albert.u.boot at aribaud.net> wrote:
> Hi Simon,
>
> Le 21/11/2011 21:49, Simon Glass a écrit :
>
>
>> +       .text :
>> +       {
>> +               __text_start = .;
>
>
> This assignment to __text_start does not exist in any of the existing
> u-boot.lds files. What is the point of it?

I would like to have a single symbol for the start of the text region
across all architectures. ARM has _start but this is not present
elsewhere. Also I think it should be defined by the link script.

>
>
>> +       .u_boot_cmd : { *(.u_boot_cmd) }
>> +       __u_boot_cmd_end = .;
>> +
>> +       . = ALIGN(4);
>> +
>> +       __image_copy_end = .;
>
>
> Ditto for __image_copy_end.

This is the end of the region that needs to be copied when U-Boot is
relocated. The symbol exists in ARMv7 so I have reproduced it here. If
I read the SPL code correctly then it seems to need this.

>
> These two changes are unexplained in the commit message. Mind you, the one
> about CPUDIR and start.S isn't either... and it should, because once the
> commit is in, there is no indication left that it is part of a set, so
> readers will have a difficulty spotting the changes introduced.

OK I will take a look at these problems.

>
> But what bothers me most is that the patch set produces u-boot.bin files
> which are not binary identical to those produced without the patch set; if I
> remove the two assignments, then binary identity is preserved.
>
> Note: I check for binary identity by diff'ing hex dumps of u-boot.bin files
> produced with and without the patch set. If the only difference is the build
> version and date, I deem the files binary identical. The dump is done with
> 'od -t x1z -A x u-boot.bin'.
>
> So unless there is a compelling and strictly unavoidable reason for these
> assignements, please drop them in the V3 patch set.

The binary will need to include values for these symbols in the dynsym
area, so adding a link symbol cannot produce an identical binary. But
the change should be harmless - it is just an extra symbol.

I do not want to drop these - in fact I want to standardize on these
(or something similar that we agree) across all architectures since it
makes the generic relocation code easier (at present it uses #ifdef to
work out what to do in the two different cases (SPL and non-SPL).
Ultimately we can look towards more uniformity across architectures in
the .lds files.

I will take another look at this series.

>
> Amicalement,
> --
> Albert.

Regards,
Simon


More information about the U-Boot mailing list