From patchwork Wed May 8 09:25:17 2013 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: 242526 X-Patchwork-Delegate: andreas.biessmann@googlemail.com 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 201B12C00E4 for ; Wed, 8 May 2013 19:24:29 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9C6CA4A154; Wed, 8 May 2013 11:24:27 +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 Nl3Mnyaw3icd; Wed, 8 May 2013 11:24:27 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9A4634A15E; Wed, 8 May 2013 11:24:26 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 203C14A154 for ; Wed, 8 May 2013 11:24:21 +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 zg2Twe8YpKXc for ; Wed, 8 May 2013 11:24:16 +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-ea0-f177.google.com (mail-ea0-f177.google.com [209.85.215.177]) by theia.denx.de (Postfix) with ESMTPS id 729444A15E for ; Wed, 8 May 2013 11:24:09 +0200 (CEST) Received: by mail-ea0-f177.google.com with SMTP id o10so781555eaj.22 for ; Wed, 08 May 2013 02:24:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:mime-version :content-type:content-transfer-encoding; bh=KVVS2W9ejv0qPcTwnMcbDtv+fm1RajOOaxYwBI1u9tg=; b=ix97qlEqhNp/Yw6xUCPbFdi0pkv3PK1cgAGfLLvw+1BUnPcpO055/w7GNrdKGChJGt zfBk0TsJBdhH/STYQiMpFkd3fiM8ldnMy2i2ABus2RdoPAOeZIcmDFpu/Tiq6NeHFRhX kbjt2tkegXCxGz6j4i6Xsl/d+PV36KByOPia0kUMOpIxAGgQ0gpukJHEIh75hGIK2qsY sgB8kbaIWc1PA07e2o0xC55DDykX4WKP8S3e94yJFwOuxNhL+K9iTzEV0UCcgvoMYeHg agsCFic3lfp8OJ8hiRlH4ZeXcsy9FMntzTREN1iLxaAGwxZGV8UXTyH4jvZ9lgxmsFFR TXQw== X-Received: by 10.15.32.71 with SMTP id z47mr15231198eeu.3.1368005048801; Wed, 08 May 2013 02:24:08 -0700 (PDT) Received: from localhost ([2a01:198:47b:1:210:75ff:fe1a:cd1e]) by mx.google.com with ESMTPSA id bp51sm42140859eeb.5.2013.05.08.02.24.06 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 08 May 2013 02:24:07 -0700 (PDT) From: =?UTF-8?q?Andreas=20Bie=C3=9Fmann?= To: u-boot@lists.denx.de Date: Wed, 8 May 2013 11:25:17 +0200 Message-Id: <1368005117-8624-1-git-send-email-andreas.devel@googlemail.com> X-Mailer: git-send-email 1.7.10.4 MIME-Version: 1.0 Subject: [U-Boot] [PATCH] avr32: fix relocation address calculation X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 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 Commit 1865286466a5d0c7f2e3c37632da56556c838e9e (Introduce generic link section.h symbol files) changed the __bss_end symbol type from char[] to ulong. This led to wrong relocation parameters which ended up in a not working u-boot. Unfortunately this is not clear to see cause due to RAM aliasing we may get a 'half-working' u-boot then. Fix this by dereferencing the __bss_end symbol where needed. Signed-off-by: Andreas Bießmann --- arch/avr32/lib/board.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/avr32/lib/board.c b/arch/avr32/lib/board.c index ccf862a..2e79e98 100644 --- a/arch/avr32/lib/board.c +++ b/arch/avr32/lib/board.c @@ -116,7 +116,7 @@ static int display_banner (void) printf ("\n\n%s\n\n", version_string); printf ("U-Boot code: %08lx -> %08lx data: %08lx -> %08lx\n", (unsigned long)_text, (unsigned long)_etext, - (unsigned long)_data, (unsigned long)__bss_end); + (unsigned long)_data, (unsigned long)(&__bss_end)); return 0; } @@ -183,7 +183,7 @@ void board_init_f(ulong board_type) * - stack */ addr = CONFIG_SYS_SDRAM_BASE + sdram_size; - monitor_len = (char *)__bss_end - _text; + monitor_len = (char *)(&__bss_end) - _text; /* * Reserve memory for u-boot code, data and bss.