From patchwork Tue Nov 30 23:58:36 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_Bie=C3=9Fmann?= X-Patchwork-Id: 73686 X-Patchwork-Delegate: wd@denx.de 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 2E88AB70E9 for ; Wed, 1 Dec 2010 11:00:04 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5DE17280EE; Wed, 1 Dec 2010 00:59:23 +0100 (CET) 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 sS3G9ls4S+Tl; Wed, 1 Dec 2010 00:59:23 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 91E18280DF; Wed, 1 Dec 2010 00:59:01 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 7D08D280C2 for ; Wed, 1 Dec 2010 00:58:56 +0100 (CET) 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 VruzCdtj6Sqx for ; Wed, 1 Dec 2010 00:58:55 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 IN_SPAMCOP=3.75 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-bw0-f66.google.com (mail-bw0-f66.google.com [209.85.214.66]) by theia.denx.de (Postfix) with ESMTP id 21C9E280B3 for ; Wed, 1 Dec 2010 00:58:55 +0100 (CET) Received: by mail-bw0-f66.google.com with SMTP id 7so3327670bwz.9 for ; Tue, 30 Nov 2010 15:58:55 -0800 (PST) Received: by 10.204.98.12 with SMTP id o12mr1054603bkn.131.1291161534921; Tue, 30 Nov 2010 15:58:54 -0800 (PST) Received: from andreas-mbp.erlangen.biessmann.tld (dslb-092-075-127-153.pools.arcor-ip.net [92.75.127.153]) by mx.google.com with ESMTPS id v20sm3040682bku.10.2010.11.30.15.58.53 (version=SSLv3 cipher=RC4-MD5); Tue, 30 Nov 2010 15:58:54 -0800 (PST) From: =?UTF-8?q?Andreas=20Bie=C3=9Fmann?= To: u-boot@lists.denx.de Date: Wed, 1 Dec 2010 00:58:36 +0100 Message-Id: <1291161516-21861-5-git-send-email-andreas.devel@googlemail.com> X-Mailer: git-send-email 1.7.3.2 In-Reply-To: <1291161516-21861-1-git-send-email-andreas.devel@googlemail.com> References: <1291161516-21861-1-git-send-email-andreas.devel@googlemail.com> MIME-Version: 1.0 Cc: Albert ARIBAUD Subject: [U-Boot] [PATCH 4/4] armv7: fix relocation skip 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: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de I doubt the stack_setup() was defective before: we load the current location of _start and compare against destination of relocate_code(). If we are already there we shoud skip the relocation and jump over to clear_bss. Before the clear_bss was also skipped. Signed-off-by: Andreas Bießmann Acked-by: Albert ARIBAUD --- Dear Albert, (or whoever works with armv7 currently) However I doubt there is another issue when CONFIG_PRELOADER is not set! Then the bss will never be setup, is that correct? arch/arm/cpu/armv7/start.S | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/cpu/armv7/start.S b/arch/arm/cpu/armv7/start.S index 5d79f34..7e31cc2 100644 --- a/arch/arm/cpu/armv7/start.S +++ b/arch/arm/cpu/armv7/start.S @@ -165,9 +165,9 @@ stack_setup: mov sp, r4 adr r0, _start - cmp r0, r6 #ifndef CONFIG_PRELOADER - beq jump_2_ram + cmp r0, r6 + beq clear_bss /* skip relocation */ #endif mov r1, r6 /* r1 <- scratch for copy_loop */ ldr r2, _TEXT_BASE