From patchwork Mon Mar 28 08:43:02 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Po-Yu Chuang X-Patchwork-Id: 88578 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id CF4B0B6F84 for ; Mon, 28 Mar 2011 19:43:30 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 00FA0282B6; Mon, 28 Mar 2011 10:43:28 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id FRrOiNT1B4fz; Mon, 28 Mar 2011 10:43:28 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 097DC2828E; Mon, 28 Mar 2011 10:43:26 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 920322828E for ; Mon, 28 Mar 2011 10:43:23 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id YSiwx3OEMOrw for ; Mon, 28 Mar 2011 10:43:22 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-iw0-f172.google.com (mail-iw0-f172.google.com [209.85.214.172]) by theia.denx.de (Postfix) with ESMTPS id 06BF62827A for ; Mon, 28 Mar 2011 10:43:20 +0200 (CEST) Received: by iwn39 with SMTP id 39so2810859iwn.3 for ; Mon, 28 Mar 2011 01:43:18 -0700 (PDT) Received: by 10.42.151.193 with SMTP id f1mr3510190icw.290.1301301798637; Mon, 28 Mar 2011 01:43:18 -0700 (PDT) Received: from localhost.localdomain ([111.70.102.114]) by mx.google.com with ESMTPS id hc41sm1254370ibb.30.2011.03.28.01.43.15 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 28 Mar 2011 01:43:18 -0700 (PDT) From: Po-Yu Chuang To: u-boot@lists.denx.de Date: Mon, 28 Mar 2011 16:43:02 +0800 Message-Id: <1301301782-1644-1-git-send-email-ratbert.chuang@gmail.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: References: Cc: hs@denx.de, Po-Yu Chuang Subject: [U-Boot] [RFC PATCH] rename __bss_end__ back to _end for standalone programs X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.9 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de From: Po-Yu Chuang 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 --- 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; }