[U-Boot] [PATCH] arm: fix a double-definition error of _start symbol

Albert ARIBAUD albert.u.boot at aribaud.net
Mon Jun 9 11:58:37 CEST 2014


Hi Masahiro,

On Mon, 09 Jun 2014 18:44:08 +0900, Masahiro Yamada
<yamada.m at jp.panasonic.com> wrote:

> Hi Albert,
> 
> 
> > 
> > Apart from the shame of having written this double definition myself and
> > missed it entirely, I am surprised because this error (obviously) does
> > not occur on my setup. Which toolchain are you using?
> 
> It is not because of the toolchain difference.
> 
> You should understand the problem I mentioned in the other mail.
> 
> In your tree,  CONFIG_SYS_DV_NOR_BOOT_CFG is never defined
> in arch/arm/lib/vectors.S
> 
> So,  arch/arm/lib/vectors.S  in your source tree in  always like this:
> 
> _start:
> _start:
>         ldr     pc, _reset
>         ldr     pc, _undefined_instruction
>         ldr     pc, _software_interrupt
>         ldr     pc, _prefetch_abort
>         ldr     pc, _data_abort
>         ldr     pc, _not_used
>         ldr     pc, _irq
>         ldr     pc, _fiq
> 
> 
> It is true that  "_start" symbol appears twice,
> but both are pointing to the same address.
> 
> That's why you never see the error message.
> (I mean, this problem is hidden behind another problem.)
> 
> You should  fix the first problem.
> http://patchwork.ozlabs.org/patch/352484/
> 
> 
> And then, the code should be like follows where CONFIG_SYS_DV_NOR_BOOT_CFG is defined.
> 
> _start:
>        .word   CONFIG_SYS_DV_NOR_BOOT_CFG
> _start:
>         ldr     pc, _reset
>         ldr     pc, _undefined_instruction
>         ldr     pc, _software_interrupt
>         ldr     pc, _prefetch_abort
>         ldr     pc, _data_abort
>         ldr     pc, _not_used
>         ldr     pc, _irq
>         ldr     pc, _fiq
> 
> In this case,  two "_start" symbols point the different address.
> You will see the error message like this:
> 
> > >   arch/arm/lib/vectors.S: Assembler messages:
> > >   arch/arm/lib/vectors.S:54: Error: symbol `_start' is already defined
> > >   make[1]: *** [arch/arm/lib/vectors.o] Error 1
> > >   make: *** [arch/arm/lib] Error 2

Thanks for the clarification. However:

> > Applied to u-boot-arm/master, thanks!
> 
> No. 
> 
> Please apply
> http://patchwork.ozlabs.org/patch/352484/
> http://patchwork.ozlabs.org/patch/352672/
> 
> in this order to keep the commit-description sane.

See my comment on the first patch commit message.

Besides, the second patch is a fix of its own accord, regardless to the
fact that it was hidden by another bug, so I'll keep it in as-is.

(incidentally, patches which do have ordering constraints should be
posted as a series.)

> Best Regards
> Masahiro Yamada

Amicalement,
-- 
Albert.


More information about the U-Boot mailing list