All of lore.kernel.org
 help / color / mirror / Atom feed
From: Po-Yu Chuang <ratbert.chuang@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [RFC PATCH] rename __bss_end__ back to _end for standalone programs
Date: Mon, 28 Mar 2011 16:43:02 +0800	[thread overview]
Message-ID: <1301301782-1644-1-git-send-email-ratbert.chuang@gmail.com> (raw)
In-Reply-To: <AANLkTinnwR4sUAgiAsgSPB1MEJy8eT5rpHiJVSXShj2=@mail.gmail.com>

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

  parent reply	other threads:[~2011-03-28  8:43 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-28  6:20 [U-Boot] current head don;t compile for mpc52xx based boards Heiko Schocher
2011-03-28  6:33 ` Wolfgang Denk
2011-03-28  7:29   ` Po-Yu Chuang
2011-03-28  8:40     ` [U-Boot] [PATCH RFC] Fix build problems caused by "_end" -> "__bss_end__" rename Wolfgang Denk
2011-03-28  8:48       ` Po-Yu Chuang
2011-03-28  8:54         ` Wolfgang Denk
2011-03-28  9:07           ` Po-Yu Chuang
2011-03-28 10:25             ` Wolfgang Denk
2011-03-28 16:42       ` Albert ARIBAUD
2011-03-29 12:39         ` Wolfgang Denk
2011-03-29 12:39         ` [U-Boot] [PATCH RFC v2] " Wolfgang Denk
2011-03-29 19:51           ` Wolfgang Denk
2011-03-30  1:38             ` Po-Yu Chuang
2011-03-31  5:37               ` Kumar Gala
2011-03-28  8:43     ` Po-Yu Chuang [this message]
2011-03-31  6:55       ` [U-Boot] [RFC PATCH] rename __bss_end__ back to _end for standalone programs Wolfgang Denk
2011-03-28  8:52     ` [U-Boot] current head don;t compile for mpc52xx based boards Wolfgang Denk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1301301782-1644-1-git-send-email-ratbert.chuang@gmail.com \
    --to=ratbert.chuang@gmail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.