diff mbox

[U-Boot,v2,05/22] arm: new labels in the linker script file

Message ID 1305472900-4004-6-git-send-email-aneesh@ti.com
State Superseded
Delegated to: Tom Rini
Headers show

Commit Message

Aneesh V May 15, 2011, 3:21 p.m. UTC
_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 <aneesh@ti.com>
---
V2:
* Removed the label __flash_image_end because _end serves the
  same purpose after rebasing to latest mainline
---
 arch/arm/cpu/armv7/start.S    |    6 +++++-
 arch/arm/cpu/armv7/u-boot.lds |    2 ++
 2 files changed, 7 insertions(+), 1 deletions(-)
diff mbox

Patch

diff --git a/arch/arm/cpu/armv7/start.S b/arch/arm/cpu/armv7/start.S
index e6e05e9..13178cd 100644
--- a/arch/arm/cpu/armv7/start.S
+++ b/arch/arm/cpu/armv7/start.S
@@ -89,6 +89,10 @@  _armboot_start:
 _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 __bss_end__ - _start
@@ -188,7 +192,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 dbae54d..40ecf78 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*)