summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorAlbert ARIBAUD <albert.u.boot@aribaud.net>2013-06-11 14:17:33 +0200
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>2013-06-21 23:05:05 +0200
commitd026dec8751378473b4f12eb87717c8059472b3e (patch)
tree57b335731bbd1d1e445ad351ca43bfe49322da99 /arch
parentdf84502edffd1da48588a212b402602f032ed53d (diff)
downloadtalos-obmc-uboot-d026dec8751378473b4f12eb87717c8059472b3e.tar.gz
talos-obmc-uboot-d026dec8751378473b4f12eb87717c8059472b3e.zip
arm: make __image_copy_{start, end} compiler-generated
This change is only done where needed: some linker scripts may contain __image_copy_{start,end} yet remain unchanged. Also, __image_copy_end needs its own section; putting it in relocation sections changes their flags and makes relocation break. Signed-off-by: Albert ARIBAUD <albert.u.boot@aribaud.net> Tested-by: Lubomir Popov <lpopov@mm-sol.com> Tested-by: Jeroen Hofstee <jeroen@myspectrum.nl> Reviewed-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/cpu/arm920t/ep93xx/u-boot.lds6
-rw-r--r--arch/arm/cpu/ixp/u-boot.lds6
-rw-r--r--arch/arm/cpu/u-boot.lds7
-rw-r--r--arch/arm/lib/relocate.S7
-rw-r--r--arch/arm/lib/sections.c2
5 files changed, 19 insertions, 9 deletions
diff --git a/arch/arm/cpu/arm920t/ep93xx/u-boot.lds b/arch/arm/cpu/arm920t/ep93xx/u-boot.lds
index cf55bf7d4d..367c805e38 100644
--- a/arch/arm/cpu/arm920t/ep93xx/u-boot.lds
+++ b/arch/arm/cpu/arm920t/ep93xx/u-boot.lds
@@ -31,6 +31,7 @@ SECTIONS
. = ALIGN(4);
.text :
{
+ *(.__image_copy_start)
arch/arm/cpu/arm920t/start.o (.text*)
/* the EP93xx expects to find the pattern 'CRUS' at 0x1000 */
. = 0x1000;
@@ -56,7 +57,10 @@ SECTIONS
. = ALIGN(4);
- __image_copy_end = .;
+ .image_copy_end :
+ {
+ *(.__image_copy_end)
+ }
__bss_start = .;
.bss : { *(.bss*) }
diff --git a/arch/arm/cpu/ixp/u-boot.lds b/arch/arm/cpu/ixp/u-boot.lds
index 5cfff68e05..9141199bed 100644
--- a/arch/arm/cpu/ixp/u-boot.lds
+++ b/arch/arm/cpu/ixp/u-boot.lds
@@ -31,6 +31,7 @@ SECTIONS
. = ALIGN(4);
.text :
{
+ *(.__image_copy_start)
arch/arm/cpu/ixp/start.o(.text*)
*(.text*)
}
@@ -54,7 +55,10 @@ SECTIONS
. = ALIGN(4);
- __image_copy_end = .;
+ .image_copy_end :
+ {
+ *(.__image_copy_end)
+ }
.rel.dyn : {
__rel_dyn_start = .;
diff --git a/arch/arm/cpu/u-boot.lds b/arch/arm/cpu/u-boot.lds
index fe2ca98176..d7adf90daf 100644
--- a/arch/arm/cpu/u-boot.lds
+++ b/arch/arm/cpu/u-boot.lds
@@ -33,7 +33,7 @@ SECTIONS
. = ALIGN(4);
.text :
{
- __image_copy_start = .;
+ *(.__image_copy_start)
CPUDIR/start.o (.text*)
*(.text*)
}
@@ -57,7 +57,10 @@ SECTIONS
. = ALIGN(4);
- __image_copy_end = .;
+ .image_copy_end :
+ {
+ *(.__image_copy_end)
+ }
.rel.dyn : {
__rel_dyn_start = .;
diff --git a/arch/arm/lib/relocate.S b/arch/arm/lib/relocate.S
index 7a7c4c085e..3767a9550c 100644
--- a/arch/arm/lib/relocate.S
+++ b/arch/arm/lib/relocate.S
@@ -39,13 +39,12 @@
ENTRY(relocate_code)
mov r6, r0 /* save addr of destination */
- ldr r0, =_start /* r0 <- SRC &_start */
+ ldr r0, =__image_copy_start /* r0 <- SRC &__image_copy_start */
subs r9, r6, r0 /* r9 <- relocation offset */
beq relocate_done /* skip relocation */
mov r1, r6 /* r1 <- scratch for copy loop */
adr r7, relocate_code /* r7 <- SRC &relocate_code */
- ldr r3, _image_copy_end_ofs /* r3 <- __image_copy_end local ofs */
- add r2, r7, r3 /* r2 <- SRC &__image_copy_end */
+ ldr r2, =__image_copy_end /* r2 <- SRC &__image_copy_end */
copy_loop:
ldmia r0!, {r10-r11} /* copy from source address [r0] */
@@ -89,8 +88,6 @@ relocate_done:
bx lr
#endif
-_image_copy_end_ofs:
- .word __image_copy_end - relocate_code
_rel_dyn_start_ofs:
.word __rel_dyn_start - relocate_code
_rel_dyn_end_ofs:
diff --git a/arch/arm/lib/sections.c b/arch/arm/lib/sections.c
index e52fec9333..03e846fa25 100644
--- a/arch/arm/lib/sections.c
+++ b/arch/arm/lib/sections.c
@@ -37,3 +37,5 @@
char __bss_start[0] __attribute__((section(".__bss_start")));
char __bss_end[0] __attribute__((section(".__bss_end")));
+char __image_copy_start[0] __attribute__((section(".__image_copy_start")));
+char __image_copy_end[0] __attribute__((section(".__image_copy_end")));
OpenPOWER on IntegriCloud