From patchwork Mon Feb 28 11:46:15 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [U-Boot,06/22] arm: new labels in the linker script file Date: Mon, 28 Feb 2011 01:46:15 -0000 From: Aneesh V X-Patchwork-Id: 84808 Message-Id: <1298893591-17636-7-git-send-email-aneesh@ti.com> To: u-boot@lists.denx.de Cc: x-loader@googlegroups.com, patches@linaro.org _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)