@@ -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:
@@ -55,6 +55,8 @@ SECTIONS
. = ALIGN(4);
+ __image_copy_end = .;
+
.rel.dyn : {
__rel_dyn_start = .;
*(.rel*)
_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(-)