[U-Boot] current head don;t compile for mpc52xx based boards

Hello,
actual head doesn;t longer compile for the mpc52xx based digsy_mtc_rev5 board (and a fast check, it seems it is for mp52xx, 8xx, ppc4xx based boards):
[hs@pollux u-boot]$ ./MAKEALL digsy_mtc_rev5 Configuring for digsy_mtc_rev5 - Board: digsy_mtc, Options: DIGSY_REV5 libstubs.o: In function `app_startup': /home/hs/charon/u-boot/examples/standalone/stubs.c:197: undefined reference to `__bss_end__' /home/hs/charon/u-boot/examples/standalone/stubs.c:197: undefined reference to `__bss_end__' make[1]: *** [hello_world] Fehler 1 make: *** [examples/standalone] Fehler 2 make: *** Warte auf noch nicht beendete Prozesse... ppc_6xx-size: './u-boot': No such file
--------------------- SUMMARY ---------------------------- Boards compiled: 1 Boards with warnings or errors: 1 ( digsy_mtc_rev5 ) ---------------------------------------------------------- [hs@pollux u-boot]$
bisection it a bit shows:
[hs@pollux u-boot]$ git bisect good 44c6e6591cb451ae606f8bde71dd5fb7b4002544 is the first bad commit commit 44c6e6591cb451ae606f8bde71dd5fb7b4002544 Author: Po-Yu Chuang ratbert@faraday-tech.com Date: Tue Mar 1 22:59:59 2011 +0000
rename _end to __bss_end__
Currently, _end is used for end of BSS section. We want _end to mean end of u-boot image, so we rename _end to __bss_end__ first.
Signed-off-by: Po-Yu Chuang ratbert@faraday-tech.com
:040000 040000 9c41e6ba008d29cdb82ecfadea40f224a9c4771e 05f2d7e2e04bef1988ef537f47e7026e4a88a2a8 M arch :040000 040000 e8a97103de34f63145918cc1f119616c5deb8f22 c81f1ef95f863d263f8da1e80a97fdb8361cfe90 M board :040000 040000 29dc021a9988488c841b89c6bf6fab915584ce22 f6db95bc3432104adc5c993aafd7e410dd8f5d9b M examples :040000 040000 96fa70b40a37090b75e4b66df7d1fb61d120f198 faa9863deb077cfca92d31ec93c4b84a2e3f2e1d M nand_spl :040000 040000 927f744a35280f707a9b03059839e0dca45fecb5 6d7771394e8eb1f184dcb24a96453eadc9306c12 M onenand_ipl [hs@pollux u-boot]$
If I find time, I look in it, but if somebody has an idea, it would be great!
bye, Heiko

Dear Heiko Schocher,
In message 4D90289F.2000401@denx.de you wrote:
actual head doesn;t longer compile for the mpc52xx based digsy_mtc_rev5 board (and a fast check, it seems it is for mp52xx, 8xx, ppc4xx based boards):
I think ALL PowerPC boards are affecte.
Po-Yu Chuang, can you please look into this, it's urgent?
Best regards,
Wolfgang Denk

Hi Heiko and Wolfgang,
On Mon, Mar 28, 2011 at 2:33 PM, Wolfgang Denk wd@denx.de wrote:
In message 4D90289F.2000401@denx.de you wrote:
actual head doesn;t longer compile for the mpc52xx based digsy_mtc_rev5 board (and a fast check, it seems it is for mp52xx, 8xx, ppc4xx based boards):
Could you use objdump to check what is the symbol name for end of BSS defined by ppc toolchain? I don't have the environment now.
I think ALL PowerPC boards are affecte.
Po-Yu Chuang, can you please look into this, it's urgent?
It seems that we need to find a symbol name globally accepted by all toolchains of all platform. If we rename it to another name careless, we might get the same problem on another platform. Or maybe we can just rename the one used in standalone examples back to _end?
Any suggestion?
Best regards, Po-Yu Chuang

Commit 44c6e65 "rename _end to __bss_end__ broke building of a large number of systems (at least all PowerPC?):
libstubs.o: In function `app_startup': examples/standalone/stubs.c:197: undefined reference to `__bss_end__'
As a workaround (instead of introducing linker scripts) we can add a --defsym=__bss_end__=_end
Signed-off-by: Wolfgang Denk wd@denx.de Cc: Po-Yu Chuang ratbert@faraday-tech.com Cc: Albert Aribaud albert.aribaud@free.fr ---
What I really do not understand is why we don't see the same type of undefined reference errors on ARM? ALso, on ARM we see __bss_end__ and _bss_end__, and __bss_start und __bss_start__ - where are the other names coming from? [On PPC we see only __bss_start and __bss_end__].
examples/standalone/Makefile | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/examples/standalone/Makefile b/examples/standalone/Makefile index c1dfdce..06cf14f 100644 --- a/examples/standalone/Makefile +++ b/examples/standalone/Makefile @@ -96,6 +96,7 @@ $(LIB): $(obj).depend $(LIBOBJS) $(ELF): $(obj)%: $(obj)%.o $(LIB) $(LD) -g -Ttext $(STANDALONE_LOAD_ADDR) \ + --defsym=__bss_end__=_end \ -o $@ -e $(SYM_PREFIX)$(notdir $(<:.o=)) $< $(LIB) \ -L$(gcclibdir) -lgcc

Hi Wolfgang,
On Mon, Mar 28, 2011 at 4:40 PM, Wolfgang Denk wd@denx.de wrote:
Commit 44c6e65 "rename _end to __bss_end__ broke building of a large number of systems (at least all PowerPC?):
libstubs.o: In function `app_startup': examples/standalone/stubs.c:197: undefined reference to `__bss_end__'
As a workaround (instead of introducing linker scripts) we can add a --defsym=__bss_end__=_end
Signed-off-by: Wolfgang Denk wd@denx.de Cc: Po-Yu Chuang ratbert@faraday-tech.com Cc: Albert Aribaud albert.aribaud@free.fr
What I really do not understand is why we don't see the same type of undefined reference errors on ARM? ALso, on ARM we see __bss_end__ and _bss_end__, and __bss_start und __bss_start__ - where are the other names coming from? [On PPC we see only __bss_start and __bss_end__].
Do you mean _end here? If there is __bss_end__ on PPC, then there is no problem, right?
examples/standalone/Makefile | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/examples/standalone/Makefile b/examples/standalone/Makefile index c1dfdce..06cf14f 100644 --- a/examples/standalone/Makefile +++ b/examples/standalone/Makefile @@ -96,6 +96,7 @@ $(LIB): $(obj).depend $(LIBOBJS) $(ELF): $(obj)%: $(obj)%.o $(LIB) $(LD) -g -Ttext $(STANDALONE_LOAD_ADDR) \
- --defsym=__bss_end__=_end \
-o $@ -e $(SYM_PREFIX)$(notdir $(<:.o=)) $< $(LIB) \ -L$(gcclibdir) -lgcc
-- 1.7.4
U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot

Dear Po-Yu Chuang,
In message AANLkTin6cEHSQSquvocW_kXr4-dbtnUGu9XZzEJiTdJ_@mail.gmail.com you wrote:
What I really do not understand is why we don't see the same type of undefined reference errors on ARM? =C2=A0ALso, on ARM we see __bss_end__ and _bss_end__, and __bss_start und __bss_start__ - where are the other names coming from? [On PPC we see only __bss_start and __bss_end__].
Do you mean _end here? If there is __bss_end__ on PPC, then there is no problem, right?
No, I mean exactly what I wrote. On PPC I do not see any _end (with your previous patch), only the symbols defined in the linker script.
Best regards,
Wolfgang Denk

Hi Wolfgang,
On Mon, Mar 28, 2011 at 4:54 PM, Wolfgang Denk wd@denx.de wrote:
Dear Po-Yu Chuang,
In message AANLkTin6cEHSQSquvocW_kXr4-dbtnUGu9XZzEJiTdJ_@mail.gmail.com you wrote:
What I really do not understand is why we don't see the same type of undefined reference errors on ARM? =C2=A0ALso, on ARM we see __bss_end__ and _bss_end__, and __bss_start und __bss_start__ - where are the other names coming from? [On PPC we see only __bss_start and __bss_end__].
Do you mean _end here? If there is __bss_end__ on PPC, then there is no problem, right?
No, I mean exactly what I wrote. On PPC I do not see any _end (with your previous patch), only the symbols defined in the linker script.
All those symbols come from default linker script in one of ${toolchain}/arm-none-linux-gnueabi/lib/ldscripts/armelfb_linux_eabi.*.
It defines __bss_start, __bss_start__, _bss_end__ and __bss_end__. Is ARM the only platform doing this?
Best regards, Po-Yu Chuang

Dear Po-Yu Chuang,
In message AANLkTik-a8oL2CEnb3wf43uwd0r0MGCy8Nnu5DmTWwzw@mail.gmail.com you wrote:
No, I mean exactly what I wrote. On PPC I do not see any _end (with your previous patch), only the symbols defined in the linker script.
All those symbols come from default linker script in one of ${toolchain}/arm-none-linux-gnueabi/lib/ldscripts/armelfb_linux_eabi.*.
It defines __bss_start, __bss_start__, _bss_end__ and __bss_end__. Is ARM the only platform doing this?
No. Not even ARM is doing this in general. It's your specific tool chain that does it this way.
It appears that ARM has both *bss_start* and *bss_end*, while PPC has only __bss_start (and __sbss_start and ___sbss_start), but no *bss_end (there are __sbss_end and ___sbss_end, though).
I have no idea if there is any rationale for this inconsistency or if it's a bug.
Verified with both ELDK 4.2 and recent Yocto/Poky tool chains.
Best regards,
Wolfgang Denk

Le 28/03/2011 10:40, Wolfgang Denk a écrit :
Commit 44c6e65 "rename _end to __bss_end__ broke building of a large number of systems (at least all PowerPC?):
libstubs.o: In function `app_startup': examples/standalone/stubs.c:197: undefined reference to `__bss_end__'
As a workaround (instead of introducing linker scripts) we can add a --defsym=__bss_end__=_end
Signed-off-by: Wolfgang Denkwd@denx.de Cc: Po-Yu Chuangratbert@faraday-tech.com Cc: Albert Aribaudalbert.aribaud@free.fr
Hmm... The change from _end to __bss_end__ should not have been applied to the standalone apps, I believe. They are not compiled with start.S but with the standard lib, which will use _end.
What I really do not understand is why we don't see the same type of undefined reference errors on ARM? ALso, on ARM we see __bss_end__ and _bss_end__, and __bss_start und __bss_start__ - where are the other names coming from? [On PPC we see only __bss_start and __bss_end__].
I believe these come from the toolchain's standard lib.
Amicalement,

Dear Albert ARIBAUD,
In message 4D90BA8B.3080200@free.fr you wrote:
Commit 44c6e65 "rename _end to __bss_end__ broke building of a large number of systems (at least all PowerPC?):
libstubs.o: In function `app_startup': examples/standalone/stubs.c:197: undefined reference to `__bss_end__'
...
Hmm... The change from _end to __bss_end__ should not have been applied to the standalone apps, I believe. They are not compiled with start.S but with the standard lib, which will use _end.
Good point. Will send an updated patch.
Best regards,
Wolfgang Denk

Commit 44c6e65 "rename _end to __bss_end__ broke building of a large number of systems (at least all PowerPC?):
libstubs.o: In function `app_startup': examples/standalone/stubs.c:197: undefined reference to `__bss_end__'
The rename should not be done for the files in the examples/standalone/ directory, as these are not using the code from start.S, but do their own BSS clearing, and either use their own linker scripts or the ones provided by the compilers.
Signed-off-by: Wolfgang Denk wd@denx.de --- V2: Instead of messing with linker defines, revert the patch in question for the files in examples/standalone/ as suggested by Albert Aribaud. (Thanks!)
examples/standalone/mips.lds | 2 +- examples/standalone/sparc.lds | 2 +- examples/standalone/stubs.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/examples/standalone/mips.lds b/examples/standalone/mips.lds index 68ae217..63a1c92 100644 --- a/examples/standalone/mips.lds +++ b/examples/standalone/mips.lds @@ -55,5 +55,5 @@ SECTIONS .sbss (NOLOAD) : { *(.sbss) } .bss (NOLOAD) : { *(.bss) . = ALIGN(4); }
- __bss_end__ = .; + _end = .; } diff --git a/examples/standalone/sparc.lds b/examples/standalone/sparc.lds index 7f060b6..9733daa 100644 --- a/examples/standalone/sparc.lds +++ b/examples/standalone/sparc.lds @@ -57,5 +57,5 @@ SECTIONS } . = ALIGN(4); __bss_end = .; - __bss_end__ = .; + _end = .; } diff --git a/examples/standalone/stubs.c b/examples/standalone/stubs.c index 1379df7..2d2e709 100644 --- a/examples/standalone/stubs.c +++ b/examples/standalone/stubs.c @@ -187,14 +187,14 @@ void __attribute__((unused)) dummy(void) #include <_exports.h> }
-extern unsigned long __bss_start, __bss_end__; +extern unsigned long __bss_start, _end;
void app_startup(char * const *argv) { unsigned char * cp = (unsigned char *) &__bss_start;
/* Zero out BSS */ - while (cp < (unsigned char *)&__bss_end__) { + while (cp < (unsigned char *)&_end) { *cp++ = 0; }

Dear Po-Yu Chuang,
In message 1301402371-8697-1-git-send-email-wd@denx.de I wrote:
Commit 44c6e65 "rename _end to __bss_end__ broke building of a large number of systems (at least all PowerPC?):
libstubs.o: In function `app_startup': examples/standalone/stubs.c:197: undefined reference to `__bss_end__'
The rename should not be done for the files in the examples/standalone/ directory, as these are not using the code from start.S, but do their own BSS clearing, and either use their own linker scripts or the ones provided by the compilers.
Signed-off-by: Wolfgang Denk wd@denx.de
V2: Instead of messing with linker defines, revert the patch in question for the files in examples/standalone/ as suggested by Albert Aribaud. (Thanks!)
Only now I realize that you submitted the very same patch before. Stupid me.
Does that mean that we have an agreement that this hould be the fix then? If yes, I would like to pull this in (Po-Yu Chuang's patch, that is).
Do you agree?
Best regards,
Wolfgang Denk

Hi Wolfgang,
On Wed, Mar 30, 2011 at 3:51 AM, Wolfgang Denk wd@denx.de wrote:
Dear Po-Yu Chuang,
In message 1301402371-8697-1-git-send-email-wd@denx.de I wrote:
Commit 44c6e65 "rename _end to __bss_end__ broke building of a large number of systems (at least all PowerPC?):
libstubs.o: In function `app_startup': examples/standalone/stubs.c:197: undefined reference to `__bss_end__'
The rename should not be done for the files in the examples/standalone/ directory, as these are not using the code from start.S, but do their own BSS clearing, and either use their own linker scripts or the ones provided by the compilers.
Signed-off-by: Wolfgang Denk wd@denx.de
V2: Instead of messing with linker defines, revert the patch in question for the files in examples/standalone/ as suggested by Albert Aribaud. (Thanks!)
Only now I realize that you submitted the very same patch before. Stupid me.
Does that mean that we have an agreement that this hould be the fix then? If yes, I would like to pull this in (Po-Yu Chuang's patch, that is).
Do you agree?
Your commit message is better. Please just use your v2 as is. :-)
Thanks, Po-Yu Chuang

On Mar 29, 2011, at 8:38 PM, Po-Yu Chuang wrote:
Hi Wolfgang,
On Wed, Mar 30, 2011 at 3:51 AM, Wolfgang Denk wd@denx.de wrote:
Dear Po-Yu Chuang,
In message 1301402371-8697-1-git-send-email-wd@denx.de I wrote:
Commit 44c6e65 "rename _end to __bss_end__ broke building of a large number of systems (at least all PowerPC?):
libstubs.o: In function `app_startup': examples/standalone/stubs.c:197: undefined reference to `__bss_end__'
The rename should not be done for the files in the examples/standalone/ directory, as these are not using the code from start.S, but do their own BSS clearing, and either use their own linker scripts or the ones provided by the compilers.
Signed-off-by: Wolfgang Denk wd@denx.de
V2: Instead of messing with linker defines, revert the patch in question for the files in examples/standalone/ as suggested by Albert Aribaud. (Thanks!)
Only now I realize that you submitted the very same patch before. Stupid me.
Does that mean that we have an agreement that this hould be the fix then? If yes, I would like to pull this in (Po-Yu Chuang's patch, that is).
Do you agree?
Your commit message is better. Please just use your v2 as is. :-)
We putting this into the tree, would be nice to have builds working again ;)
- k

From: Po-Yu Chuang ratbert@faraday-tech.com
It seems __bss_end__ is not a true convention for all toolchains, at least not for PPC. Using _end for standalone programs might be the simplest way to fix this problem.
One of the other choices may be writing a linker script to provide __bss_end__ for PPC.
Signed-off-by: Po-Yu Chuang ratbert@faraday-tech.com --- Hi all,
Not sure if this is the best solution, but I think this could fix Heiko's problem.
examples/standalone/mips.lds | 2 +- examples/standalone/sparc.lds | 2 +- examples/standalone/stubs.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/examples/standalone/mips.lds b/examples/standalone/mips.lds index 68ae217..63a1c92 100644 --- a/examples/standalone/mips.lds +++ b/examples/standalone/mips.lds @@ -55,5 +55,5 @@ SECTIONS .sbss (NOLOAD) : { *(.sbss) } .bss (NOLOAD) : { *(.bss) . = ALIGN(4); }
- __bss_end__ = .; + _end = .; } diff --git a/examples/standalone/sparc.lds b/examples/standalone/sparc.lds index 7f060b6..9733daa 100644 --- a/examples/standalone/sparc.lds +++ b/examples/standalone/sparc.lds @@ -57,5 +57,5 @@ SECTIONS } . = ALIGN(4); __bss_end = .; - __bss_end__ = .; + _end = .; } diff --git a/examples/standalone/stubs.c b/examples/standalone/stubs.c index 1379df7..2d2e709 100644 --- a/examples/standalone/stubs.c +++ b/examples/standalone/stubs.c @@ -187,14 +187,14 @@ void __attribute__((unused)) dummy(void) #include <_exports.h> }
-extern unsigned long __bss_start, __bss_end__; +extern unsigned long __bss_start, _end;
void app_startup(char * const *argv) { unsigned char * cp = (unsigned char *) &__bss_start;
/* Zero out BSS */ - while (cp < (unsigned char *)&__bss_end__) { + while (cp < (unsigned char *)&_end) { *cp++ = 0; }

Dear Po-Yu Chuang,
In message 1301301782-1644-1-git-send-email-ratbert.chuang@gmail.com you wrote:
From: Po-Yu Chuang ratbert@faraday-tech.com
It seems __bss_end__ is not a true convention for all toolchains, at least not for PPC. Using _end for standalone programs might be the simplest way to fix this problem.
One of the other choices may be writing a linker script to provide __bss_end__ for PPC.
Signed-off-by: Po-Yu Chuang ratbert@faraday-tech.com
Hi all,
Not sure if this is the best solution, but I think this could fix Heiko's problem.
examples/standalone/mips.lds | 2 +- examples/standalone/sparc.lds | 2 +- examples/standalone/stubs.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-)
Applied, with updated changelog as discussed. Thanks.
Best regards,
Wolfgang Denk

Dear Po-Yu Chuang,
In message AANLkTinnwR4sUAgiAsgSPB1MEJy8eT5rpHiJVSXShj2=@mail.gmail.com you wrote:
Could you use objdump to check what is the symbol name for end of BSS defined by ppc toolchain? I don't have the environment now.
It appears there is no default value used - we get what we define in the linker scripts, and (apparently) nothing else.
It seems that we need to find a symbol name globally accepted by all toolchains of all platform. If we rename it to another name careless, we might get the same problem on another platform. Or maybe we can just rename the one used in standalone examples back to _end?
I don;t really understand what's going on there on ARM - see my RC patch.
Best regards,
Wolfgang Denk
participants (5)
-
Albert ARIBAUD
-
Heiko Schocher
-
Kumar Gala
-
Po-Yu Chuang
-
Wolfgang Denk