From patchwork Mon Feb 28 11:46:15 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aneesh V X-Patchwork-Id: 224 Return-Path: Delivered-To: unknown Received: from imap.gmail.com (74.125.159.109) by localhost6.localdomain6 with IMAP4-SSL; 08 Jun 2011 14:41:02 -0000 Delivered-To: patches@linaro.org Received: by 10.224.19.208 with SMTP id c16cs91645qab; Mon, 28 Feb 2011 03:46:28 -0800 (PST) Received: by 10.151.112.14 with SMTP id p14mr7003065ybm.118.1298893588550; Mon, 28 Feb 2011 03:46:28 -0800 (PST) Received: from arroyo.ext.ti.com (arroyo.ext.ti.com [192.94.94.40]) by mx.google.com with ESMTPS id 1si8015943yhl.168.2011.02.28.03.46.28 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 28 Feb 2011 03:46:28 -0800 (PST) Received-SPF: pass (google.com: domain of aneesh@ti.com designates 192.94.94.40 as permitted sender) client-ip=192.94.94.40; Authentication-Results: mx.google.com; spf=pass (google.com: domain of aneesh@ti.com designates 192.94.94.40 as permitted sender) smtp.mail=aneesh@ti.com Received: from dbdp31.itg.ti.com ([172.24.170.98]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id p1SBkOpl005386 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 28 Feb 2011 05:46:27 -0600 Received: from localhost (localhost [127.0.0.1]) by dbdp31.itg.ti.com (8.13.8/8.13.8) with ESMTP id p1SBkOft011777; Mon, 28 Feb 2011 17:16:24 +0530 (IST) From: Aneesh V To: u-boot@lists.denx.de Cc: aneesh@ti.com, x-loader@googlegroups.com, patches@linaro.org, john.rigby@linaro.org Subject: [PATCH 06/22] arm: new labels in the linker script file Date: Mon, 28 Feb 2011 17:16:15 +0530 Message-Id: <1298893591-17636-7-git-send-email-aneesh@ti.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1298893591-17636-1-git-send-email-aneesh@ti.com> References: <1298893591-17636-1-git-send-email-aneesh@ti.com> _bss_start_ofs is used in start.S to indicate end of copied image. This may not be correct when we have a discontiguous memory map. For instance, .bss may be placed in SDRAM for some SPLS while rest of the image is placed in SRAM. Define a new label in linker script to indicate the end of the image copied during relocation and use it appropriately in start.S. Also, add a new label to indicate the end of flash image. This will be useful in identifying the size of flash image Signed-off-by: Aneesh V --- arch/arm/cpu/armv7/start.S | 6 +++++- arch/arm/cpu/armv7/u-boot.lds | 4 ++++ 2 files changed, 9 insertions(+), 1 deletions(-) diff --git a/arch/arm/cpu/armv7/start.S b/arch/arm/cpu/armv7/start.S index 3618190..8215d26 100644 --- a/arch/arm/cpu/armv7/start.S +++ b/arch/arm/cpu/armv7/start.S @@ -77,6 +77,10 @@ _TEXT_BASE: _bss_start_ofs: .word __bss_start - _start +.global _image_copy_end_ofs +_image_copy_end_ofs: + .word __image_copy_end - _start + .globl _bss_end_ofs _bss_end_ofs: .word _end - _start @@ -172,7 +176,7 @@ stack_setup: beq clear_bss /* skip relocation */ #endif mov r1, r6 /* r1 <- scratch for copy_loop */ - ldr r3, _bss_start_ofs + ldr r3, _image_copy_end_ofs add r2, r0, r3 /* r2 <- source end address */ copy_loop: diff --git a/arch/arm/cpu/armv7/u-boot.lds b/arch/arm/cpu/armv7/u-boot.lds index 5725c30..c3ad587 100644 --- a/arch/arm/cpu/armv7/u-boot.lds +++ b/arch/arm/cpu/armv7/u-boot.lds @@ -55,6 +55,8 @@ SECTIONS . = ALIGN(4); + __image_copy_end = .; + .rel.dyn : { __rel_dyn_start = .; *(.rel*) @@ -66,6 +68,8 @@ SECTIONS *(.dynsym) } + __flash_image_end = .; + .bss __rel_dyn_start (OVERLAY) : { __bss_start = .; *(.bss)