Patchwork [U-Boot,RFC] rename __bss_end__ back to _end for standalone programs

login
register
mail settings
Submitter Po-Yu Chuang
Date March 28, 2011, 8:43 a.m.
Message ID <1301301782-1644-1-git-send-email-ratbert.chuang@gmail.com>
Download mbox | patch
Permalink /patch/88578/
State Accepted
Commit 7ec830d5804337afe19413c3eaedd16583af9076
Headers show

Comments

Po-Yu Chuang - March 28, 2011, 8:43 a.m.
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(-)
Wolfgang Denk - March 31, 2011, 6:55 a.m.
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

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