]> git.sur5r.net Git - u-boot/commitdiff
arm: relocate_code(): Use __image_copy_end for end of relocation
authorBenoît Thébaudeau <benoit.thebaudeau@advansee.com>
Thu, 11 Apr 2013 09:35:46 +0000 (09:35 +0000)
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>
Fri, 12 Apr 2013 05:55:05 +0000 (07:55 +0200)
Use __image_copy_end instead of __bss_start for the end of the image to
relocate. This is the same as commit 033ca72, but applied to all ARM start.S.

This is a more appropriate symbol naming for an image copy & relocate feature,
and this also saves a useless copy of data put between __image_copy_end and
__bss_start in linker scripts (e.g. relocation information, or MMU
initialization tables used only before jumping to the relocated image).

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
24 files changed:
arch/arm/cpu/arm1136/start.S
arch/arm/cpu/arm1176/start.S
arch/arm/cpu/arm720t/start.S
arch/arm/cpu/arm920t/ep93xx/u-boot.lds
arch/arm/cpu/arm920t/start.S
arch/arm/cpu/arm925t/start.S
arch/arm/cpu/arm926ejs/start.S
arch/arm/cpu/arm946es/start.S
arch/arm/cpu/arm_intcm/start.S
arch/arm/cpu/armv7/start.S
arch/arm/cpu/ixp/start.S
arch/arm/cpu/ixp/u-boot.lds
arch/arm/cpu/pxa/start.S
arch/arm/cpu/s3c44b0/start.S
arch/arm/cpu/sa1100/start.S
board/actux1/u-boot.lds
board/actux2/u-boot.lds
board/actux3/u-boot.lds
board/davinci/da8xxevm/u-boot-spl-hawk.lds
board/dvlhost/u-boot.lds
board/samsung/smdk6400/u-boot-nand.lds
board/vpac270/u-boot-spl.lds
nand_spl/board/karo/tx25/u-boot.lds
nand_spl/board/samsung/smdk6400/u-boot.lds

index 67fcc4f687af92bd8dd7ea9ddb092d64c7a73256..e36d7d32b927b05f3908d4ec66bfaf23104c907b 100644 (file)
@@ -104,9 +104,9 @@ _TEXT_BASE:
 _bss_start_ofs:
        .word __bss_start - _start
 
-.global        _image_copy_end_ofs
+.globl _image_copy_end_ofs
 _image_copy_end_ofs:
-       .word   __image_copy_end - _start
+       .word __image_copy_end - _start
 
 .globl _bss_end_ofs
 _bss_end_ofs:
index 17b12777c94c1efe633da5d692677b87420728e9..0b570d599bb74dd0ea1dac3adb65d434ca3e1f44 100644 (file)
@@ -127,6 +127,10 @@ _TEXT_PHY_BASE:
 _bss_start_ofs:
        .word __bss_start - _start
 
+.globl _image_copy_end_ofs
+_image_copy_end_ofs:
+       .word __image_copy_end - _start
+
 .globl _bss_end_ofs
 _bss_end_ofs:
        .word __bss_end - _start
@@ -251,7 +255,7 @@ relocate_code:
        subs    r9, r6, r0              /* r9 <- relocation offset */
        beq     relocate_done           /* skip relocation */
        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:
index 95f4447c3a23f214c65a3994d8d93d84574dbbaa..a640eaaa3bda822b404d70f1689147f9660000b0 100644 (file)
@@ -101,6 +101,10 @@ _TEXT_BASE:
 _bss_start_ofs:
        .word __bss_start - _start
 
+.globl _image_copy_end_ofs
+_image_copy_end_ofs:
+       .word __image_copy_end - _start
+
 .globl _bss_end_ofs
 _bss_end_ofs:
        .word __bss_end - _start
@@ -166,7 +170,7 @@ relocate_code:
        subs    r9, r6, r0              /* r9 <- relocation offset */
        beq     relocate_done           /* skip relocation */
        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:
index e483820f3f93b0ab02cc8bfc86daf5f97b11986b..d0b1ada8c63064437a64a23121c5918f6e4d0edd 100644 (file)
@@ -55,6 +55,9 @@ SECTIONS
        }
 
        . = ALIGN(4);
+
+       __image_copy_end = .;
+
        __bss_start = .;
        .bss : { *(.bss) }
        __bss_end = .;
index cd8c8db1a912df57449b258ebf5ba470c0ecda77..940ce729b880b2124c0038b02c853371c0e77f3f 100644 (file)
@@ -89,6 +89,10 @@ _TEXT_BASE:
 _bss_start_ofs:
        .word __bss_start - _start
 
+.globl _image_copy_end_ofs
+_image_copy_end_ofs:
+       .word __image_copy_end - _start
+
 .globl _bss_end_ofs
 _bss_end_ofs:
        .word __bss_end - _start
@@ -205,7 +209,7 @@ relocate_code:
        subs    r9, r6, r0              /* r9 <- relocation offset */
        beq     relocate_done           /* skip relocation */
        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:
index 9358f3e45f9f8fae6a82961d88dd39fb11aa9c44..ed683b44d544986b0df9e3cfb4d052856fc94b8f 100644 (file)
@@ -95,6 +95,10 @@ _TEXT_BASE:
 _bss_start_ofs:
        .word __bss_start - _start
 
+.globl _image_copy_end_ofs
+_image_copy_end_ofs:
+       .word __image_copy_end - _start
+
 .globl _bss_end_ofs
 _bss_end_ofs:
        .word __bss_end - _start
@@ -195,7 +199,7 @@ relocate_code:
        subs    r9, r6, r0              /* r9 <- relocation offset */
        beq     relocate_done           /* skip relocation */
        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:
index 6949645d1a57cd5a39cdb2edd2ff39f4b3115036..552279feeeca72402e7f71240172355557e0b89f 100644 (file)
@@ -140,6 +140,10 @@ _TEXT_BASE:
 _bss_start_ofs:
        .word __bss_start - _start
 
+.globl _image_copy_end_ofs
+_image_copy_end_ofs:
+       .word __image_copy_end - _start
+
 .globl _bss_end_ofs
 _bss_end_ofs:
        .word __bss_end - _start
@@ -212,7 +216,7 @@ relocate_code:
        subs    r9, r6, r0              /* r9 <- relocation offset */
        beq     relocate_done           /* skip relocation */
        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:
index 90c15f25c9c74affcb48f746413adc7faa3f87a5..2dd1fa3407d982c39fa7885217ff0b5279a5df71 100644 (file)
@@ -105,6 +105,10 @@ _TEXT_BASE:
 _bss_start_ofs:
        .word __bss_start - _start
 
+.globl _image_copy_end_ofs
+_image_copy_end_ofs:
+       .word __image_copy_end - _start
+
 .globl _bss_end_ofs
 _bss_end_ofs:
        .word __bss_end - _start
@@ -170,7 +174,7 @@ relocate_code:
        subs    r9, r6, r0              /* r9 <- relocation offset */
        beq     relocate_done           /* skip relocation */
        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:
index a6e08ab5cd2626137db3dbedd515d89387793ca2..cc054e8c283a84dda1deb2f08c74acb0aeed679f 100644 (file)
@@ -101,6 +101,10 @@ _TEXT_BASE:
 _bss_start_ofs:
        .word __bss_start - _start
 
+.globl _image_copy_end_ofs
+_image_copy_end_ofs:
+       .word __image_copy_end - _start
+
 .globl _bss_end_ofs
 _bss_end_ofs:
        .word __bss_end - _start
@@ -166,7 +170,7 @@ relocate_code:
        subs    r9, r6, r0              /* r9 <- relocation offset */
        beq     relocate_done           /* skip relocation */
        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:
index 222b5050b1424e92d9bdb1cd011c3ae662ea2992..d0b17c9abf4b2976962bc2b302b61b6cf5736f36 100644 (file)
@@ -94,9 +94,9 @@ _TEXT_BASE:
 _bss_start_ofs:
        .word __bss_start - _start
 
-.global        _image_copy_end_ofs
+.globl _image_copy_end_ofs
 _image_copy_end_ofs:
-       .word   __image_copy_end - _start
+       .word __image_copy_end - _start
 
 .globl _bss_end_ofs
 _bss_end_ofs:
index 3a1253dbe9466bf41d3649463732715e8d4c5615..a305ff5e0ae4ea47b1fc9a7ec06125c3cb8ab447 100644 (file)
@@ -114,6 +114,10 @@ _TEXT_BASE:
 _bss_start_ofs:
        .word __bss_start - _start
 
+.globl _image_copy_end_ofs
+_image_copy_end_ofs:
+       .word __image_copy_end - _start
+
 .globl _bss_end_ofs
 _bss_end_ofs:
        .word __bss_end - _start
@@ -268,7 +272,7 @@ relocate_code:
        subs    r9, r6, r0              /* r9 <- relocation offset */
        beq     relocate_done           /* skip relocation */
        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:
index 8345b55032395c8459b5c30e401af180865559f8..388a67f101cf75037efe17519e2c169e883497a3 100644 (file)
@@ -54,6 +54,8 @@ SECTIONS
 
        . = ALIGN(4);
 
+       __image_copy_end = .;
+
        .rel.dyn : {
                __rel_dyn_start = .;
                *(.rel*)
index d8072417d8db49aef2a1b4bbca5ce634cc75a71e..cd88af845692c46efbb1eb98288b986cab49c147 100644 (file)
@@ -118,6 +118,10 @@ _TEXT_BASE:
 _bss_start_ofs:
        .word __bss_start - _start
 
+.globl _image_copy_end_ofs
+_image_copy_end_ofs:
+       .word __image_copy_end - _start
+
 .globl _bss_end_ofs
 _bss_end_ofs:
        .word __bss_end - _start
@@ -190,7 +194,7 @@ relocate_code:
        subs    r9, r6, r0              /* r9 <- relocation offset */
        beq     relocate_done           /* skip relocation */
        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:
index 8cd4a5bda634f95b43b62e62430b7a6307cc13c3..579f6e2fa124d77a02a75c758ca53f971115b0c7 100644 (file)
@@ -80,6 +80,10 @@ _TEXT_BASE:
 _bss_start_ofs:
        .word __bss_start - _start
 
+.globl _image_copy_end_ofs
+_image_copy_end_ofs:
+       .word __image_copy_end - _start
+
 .globl _bss_end_ofs
 _bss_end_ofs:
        .word __bss_end - _start
@@ -151,7 +155,7 @@ relocate_code:
        subs    r9, r6, r0              /* r9 <- relocation offset */
        beq     relocate_done           /* skip relocation */
        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:
index 508c21e305b55578e55fd694605d2ee8e70ca1ac..13cf13226ad8d5b2ef8cc45282ef5f21bd16d14a 100644 (file)
@@ -90,6 +90,10 @@ _TEXT_BASE:
 _bss_start_ofs:
        .word __bss_start - _start
 
+.globl _image_copy_end_ofs
+_image_copy_end_ofs:
+       .word __image_copy_end - _start
+
 .globl _bss_end_ofs
 _bss_end_ofs:
        .word __bss_end - _start
@@ -155,7 +159,7 @@ relocate_code:
        subs    r9, r6, r0              /* r9 <- relocation offset */
        beq     relocate_done           /* skip relocation */
        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:
index c76728a7fbd3ff9cf06787bf205be4cb32f3fa78..52fc9fc0c66bd99225ceb1b58bd1890836e52e75 100644 (file)
@@ -61,6 +61,9 @@ SECTIONS
        }
 
        . = ALIGN (4);
+
+       __image_copy_end = .;
+
        .rel.dyn : {
                __rel_dyn_start = .;
                *(.rel*)
index 984f70e510b17d121babb4e6c41bbda65258582f..cafd3d859d493baeb97b4aed25eacfaa70afa919 100644 (file)
@@ -61,6 +61,9 @@ SECTIONS
        }
 
        . = ALIGN (4);
+
+       __image_copy_end = .;
+
        .rel.dyn : {
                __rel_dyn_start = .;
                *(.rel*)
index fc48cf03fde15a93b02699dd1cc72e537e495137..168fe171c4e10aaadbb543faf01a2470fe044a3d 100644 (file)
@@ -61,6 +61,9 @@ SECTIONS
        }
 
        . = ALIGN (4);
+
+       __image_copy_end = .;
+
        .rel.dyn : {
                __rel_dyn_start = .;
                *(.rel*)
index 2557830f949ca3536e62a54dbd37c72d17d90543..4839364c656fd5b13e6e528d959eff28b4e5359c 100644 (file)
@@ -58,6 +58,7 @@ SECTIONS
        }
 
        . = ALIGN(4);
+       __image_copy_end = .;
        __rel_dyn_start = .;
        __rel_dyn_end = .;
        __dynsym_start = .;
index b13d3e1ec319f1b0736f2fafdb517b8888b9f5e1..dd50bdbecd7977282b2c56dd9e6df75843e88070 100644 (file)
@@ -61,6 +61,9 @@ SECTIONS
        }
 
        . = ALIGN (4);
+
+       __image_copy_end = .;
+
        .rel.dyn : {
                __rel_dyn_start = .;
                *(.rel*)
index 64c650d2e9c39ee964ef9917e349717bb9078473..7c74267ec4399f0bdf348fec55566dea6b0f9e50 100644 (file)
@@ -53,6 +53,10 @@ SECTIONS
                KEEP(*(SORT(.u_boot_list*)));
        }
 
+       . = ALIGN(4);
+
+       __image_copy_end = .;
+
        . = align(4);
        .mmudata : { *(.mmudata) }
 
index dc437d1f2329232320da07e3899d32895544a8d2..ab65407a6037b977055db5638dd5a5f96d8c86f5 100644 (file)
@@ -59,6 +59,8 @@ SECTIONS
 
        . = ALIGN(4);
 
+       __image_copy_end = .;
+
        .rel.dyn : {
                __rel_dyn_start = .;
                *(.rel*)
index 4d1aac367799f37672cc638f874403d0c6416ffd..e5363e2268d5250eb57561603378b51cf7f5921a 100644 (file)
@@ -54,6 +54,8 @@ SECTIONS
 
        . = ALIGN(4);
 
+       __image_copy_end = .;
+
        .rel.dyn : {
                __rel_dyn_start = .;
                *(.rel*)
index b6c573be5c32acf57648d0f4d63f76d366d7f84a..78907fde7f5cc438c88922784daa8c13474b1c5f 100644 (file)
@@ -58,6 +58,8 @@ SECTIONS
 
        . = ALIGN(4);
 
+       __image_copy_end = .;
+
        .rel.dyn : {
        __rel_dyn_start = .;
        *(.rel*)