diff mbox

[U-Boot,RFC,v2] Fix build problems caused by "_end" -> "__bss_end__" rename

Message ID 1301402371-8697-1-git-send-email-wd@denx.de
State Accepted
Headers show

Commit Message

Wolfgang Denk March 29, 2011, 12:39 p.m. UTC
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(-)

Comments

Wolfgang Denk March 29, 2011, 7:51 p.m. UTC | #1
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
Po-Yu Chuang March 30, 2011, 1:38 a.m. UTC | #2
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
Kumar Gala March 31, 2011, 5:37 a.m. UTC | #3
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
diff mbox

Patch

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;
 	}