ARM relocation fixes
cover ARM relocation fixes
As discussed in
http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/89864/focus=89905
here are the changes for r8 usage in all arm relocate_code() implementations.
Additionally there is a change to armv7 code which is persumably broken (at least when CONFIG_PRELADER is _not_ defined). Please comment on that patch, the rest should go in v2010.12.
Andreas Bie?mann (4):
arm: copy_loop(): use scratch register
arm: relocate_code(): do not set register useless
arm: fixloop(): do not use r8 for relocation
armv7: fix relocation skip
arch/arm/cpu/arm1136/start.S | 20 ++++++++++---------- arch/arm/cpu/arm1176/start.S | 20 ++++++++++---------- arch/arm/cpu/arm720t/start.S | 20 ++++++++++---------- arch/arm/cpu/arm920t/start.S | 20 ++++++++++---------- arch/arm/cpu/arm925t/start.S | 20 ++++++++++---------- arch/arm/cpu/arm926ejs/start.S | 20 ++++++++++---------- arch/arm/cpu/arm946es/start.S | 20 ++++++++++---------- arch/arm/cpu/arm_intcm/start.S | 20 ++++++++++---------- arch/arm/cpu/armv7/start.S | 24 ++++++++++++------------ arch/arm/cpu/ixp/start.S | 20 ++++++++++---------- arch/arm/cpu/lh7a40x/start.S | 20 ++++++++++---------- arch/arm/cpu/pxa/start.S | 20 ++++++++++---------- arch/arm/cpu/s3c44b0/start.S | 20 ++++++++++---------- arch/arm/cpu/sa1100/start.S | 20 ++++++++++---------- 14 files changed, 142 insertions(+), 142 deletions(-)
Signature · 1 line
1.7.3.2
PATCH 1/4 arm: copy_loop(): use scratch register
This patch uses r1 as scratch register for copy_loop(). Therefore we do not longer need r7 for the storage of relocate_code()'s 'addr_moni' (the destination address of relocation).
Therefore r7 can be used later on for other purposes.
--- arch/arm/cpu/arm1136/start.S | 10 +++++----- arch/arm/cpu/arm1176/start.S | 10 +++++----- arch/arm/cpu/arm720t/start.S | 10 +++++----- arch/arm/cpu/arm920t/start.S | 10 +++++----- arch/arm/cpu/arm925t/start.S | 10 +++++----- arch/arm/cpu/arm926ejs/start.S | 10 +++++----- arch/arm/cpu/arm946es/start.S | 10 +++++----- arch/arm/cpu/arm_intcm/start.S | 10 +++++----- arch/arm/cpu/armv7/start.S | 10 +++++----- arch/arm/cpu/ixp/start.S | 10 +++++----- arch/arm/cpu/lh7a40x/start.S | 10 +++++----- arch/arm/cpu/pxa/start.S | 10 +++++----- arch/arm/cpu/s3c44b0/start.S | 10 +++++----- arch/arm/cpu/sa1100/start.S | 10 +++++----- 14 files changed, 70 insertions(+), 70 deletions(-)
arch/arm/cpu/arm1136/start.S +5 -5
@@ -186,13 +186,13 @@ relocate_code: mov r4, r0 /* save addr_sp */ mov r5, r1 /* save addr of gd */ mov r6, r2 /* save addr of destination */ - mov r7, r2 /* save addr of destination */ /* Set up the stack */ stack_setup: mov sp, r4 adr r0, _start + mov r1, r6 /* r1 <- scratch for copy_loop */ ldr r2, _TEXT_BASE ldr r3, _bss_start_ofs add r2, r0, r3 /* r2 <- source end address */
@@ -201,7 +201,7 @@ stack_setup: copy_loop: ldmia r0!, {r9-r10} /* copy from source address [r0] */ - stmia r6!, {r9-r10} /* copy to target address [r1] */ + stmia r1!, {r9-r10} /* copy to target address [r1] */ cmp r0, r2 /* until source end address [r2] */ blo copy_loop
@@ -210,7 +210,7 @@ copy_loop: * fix .rel.dyn relocations */ ldr r0, _TEXT_BASE /* r0 <- Text base */ - sub r9, r7, r0 /* r9 <- relocation offset */ + sub r9, r6, r0 /* r9 <- relocation offset */ ldr r10, _dynsym_start_ofs /* r10 <- sym table ofs */ add r10, r10, r0 /* r10 <- sym table in FLASH */ ldr r2, _rel_dyn_start_ofs /* r2 <- rel dyn start ofs */
@@ -251,7 +251,7 @@ clear_bss: ldr r0, _bss_start_ofs ldr r1, _bss_end_ofs ldr r3, _TEXT_BASE /* Text base */ - mov r4, r7 /* reloc addr */ + mov r4, r6 /* reloc addr */ add r0, r0, r4 add r1, r1, r4 mov r2, #0x00000000 /* clear */
@@ -280,7 +280,7 @@ jump_2_ram: add lr, lr, r9 /* setup parameters for board_init_r */ mov r0, r5 /* gd_t */ - mov r1, r7 /* dest_addr */ + mov r1, r6 /* dest_addr */ /* jump to it ... */ mov pc, lr
arch/arm/cpu/arm1176/start.S +5 -5
@@ -240,13 +240,13 @@ relocate_code: mov r4, r0 /* save addr_sp */ mov r5, r1 /* save addr of gd */ mov r6, r2 /* save addr of destination */ - mov r7, r2 /* save addr of destination */ /* Set up the stack */ stack_setup: mov sp, r4 adr r0, _start + mov r1, r6 /* r1 <- scratch for copy_loop */ ldr r2, _TEXT_BASE ldr r3, _bss_start_ofs add r2, r0, r3 /* r2 <- source end address */
@@ -255,7 +255,7 @@ stack_setup: copy_loop: ldmia r0!, {r9-r10} /* copy from source address [r0] */ - stmia r6!, {r9-r10} /* copy to target address [r1] */ + stmia r1!, {r9-r10} /* copy to target address [r1] */ cmp r0, r2 /* until source end address [r2] */ blo copy_loop
@@ -264,7 +264,7 @@ copy_loop: * fix .rel.dyn relocations */ ldr r0, _TEXT_BASE /* r0 <- Text base */ - sub r9, r7, r0 /* r9 <- relocation offset */ + sub r9, r6, r0 /* r9 <- relocation offset */ ldr r10, _dynsym_start_ofs /* r10 <- sym table ofs */ add r10, r10, r0 /* r10 <- sym table in FLASH */ ldr r2, _rel_dyn_start_ofs /* r2 <- rel dyn start ofs */
@@ -343,7 +343,7 @@ clear_bss: ldr r0, _bss_start_ofs ldr r1, _bss_end_ofs ldr r3, _TEXT_BASE /* Text base */ - mov r4, r7 /* reloc addr */ + mov r4, r6 /* reloc addr */ add r0, r0, r4 add r1, r1, r4 mov r2, #0x00000000 /* clear */
@@ -372,7 +372,7 @@ _nand_boot: .word nand_boot add lr, lr, r9 /* setup parameters for board_init_r */ mov r0, r5 /* gd_t */ - mov r1, r7 /* dest_addr */ + mov r1, r6 /* dest_addr */ /* jump to it ... */ mov pc, lr
arch/arm/cpu/arm720t/start.S +5 -5
@@ -155,13 +155,13 @@ relocate_code: mov r4, r0 /* save addr_sp */ mov r5, r1 /* save addr of gd */ mov r6, r2 /* save addr of destination */ - mov r7, r2 /* save addr of destination */ /* Set up the stack */ stack_setup: mov sp, r4 adr r0, _start + mov r1, r6 /* r1 <- scratch for copy_loop */ ldr r2, _TEXT_BASE ldr r3, _bss_start_ofs add r2, r0, r3 /* r2 <- source end address */
@@ -170,7 +170,7 @@ stack_setup: copy_loop: ldmia r0!, {r9-r10} /* copy from source address [r0] */ - stmia r6!, {r9-r10} /* copy to target address [r1] */ + stmia r1!, {r9-r10} /* copy to target address [r1] */ cmp r0, r2 /* until source end address [r2] */ blo copy_loop
@@ -179,7 +179,7 @@ copy_loop: * fix .rel.dyn relocations */ ldr r0, _TEXT_BASE /* r0 <- Text base */ - sub r9, r7, r0 /* r9 <- relocation offset */ + sub r9, r6, r0 /* r9 <- relocation offset */ ldr r10, _dynsym_start_ofs /* r10 <- sym table ofs */ add r10, r10, r0 /* r10 <- sym table in FLASH */ ldr r2, _rel_dyn_start_ofs /* r2 <- rel dyn start ofs */
@@ -220,7 +220,7 @@ clear_bss: ldr r0, _bss_start_ofs ldr r1, _bss_end_ofs ldr r3, _TEXT_BASE /* Text base */ - mov r4, r7 /* reloc addr */ + mov r4, r6 /* reloc addr */ add r0, r0, r4 add r1, r1, r4 mov r2, #0x00000000 /* clear */
@@ -244,7 +244,7 @@ clbss_l:str r2, [r0] /* clear loop... */ add lr, lr, r9 /* setup parameters for board_init_r */ mov r0, r5 /* gd_t */ - mov r1, r7 /* dest_addr */ + mov r1, r6 /* dest_addr */ /* jump to it ... */ mov pc, lr
arch/arm/cpu/arm920t/start.S +5 -5
@@ -201,13 +201,13 @@ relocate_code: mov r4, r0 /* save addr_sp */ mov r5, r1 /* save addr of gd */ mov r6, r2 /* save addr of destination */ - mov r7, r2 /* save addr of destination */ /* Set up the stack */ stack_setup: mov sp, r4 adr r0, _start + mov r1, r6 /* r1 <- scratch for copy_loop */ ldr r2, _TEXT_BASE ldr r3, _bss_start_ofs add r2, r0, r3 /* r2 <- source end address */
@@ -216,7 +216,7 @@ stack_setup: copy_loop: ldmia r0!, {r9-r10} /* copy from source address [r0] */ - stmia r6!, {r9-r10} /* copy to target address [r1] */ + stmia r1!, {r9-r10} /* copy to target address [r1] */ cmp r0, r2 /* until source end address [r2] */ blo copy_loop
@@ -225,7 +225,7 @@ copy_loop: * fix .rel.dyn relocations */ ldr r0, _TEXT_BASE /* r0 <- Text base */ - sub r9, r7, r0 /* r9 <- relocation offset */ + sub r9, r6, r0 /* r9 <- relocation offset */ ldr r10, _dynsym_start_ofs /* r10 <- sym table ofs */ add r10, r10, r0 /* r10 <- sym table in FLASH */ ldr r2, _rel_dyn_start_ofs /* r2 <- rel dyn start ofs */
@@ -266,7 +266,7 @@ clear_bss: ldr r0, _bss_start_ofs ldr r1, _bss_end_ofs ldr r3, _TEXT_BASE /* Text base */ - mov r4, r7 /* reloc addr */ + mov r4, r6 /* reloc addr */ add r0, r0, r4 add r1, r1, r4 mov r2, #0x00000000 /* clear */
@@ -297,7 +297,7 @@ _nand_boot_ofs: add lr, lr, r9 /* setup parameters for board_init_r */ mov r0, r5 /* gd_t */ - mov r1, r7 /* dest_addr */ + mov r1, r6 /* dest_addr */ /* jump to it ... */ mov pc, lr
arch/arm/cpu/arm925t/start.S +5 -5
@@ -192,13 +192,13 @@ relocate_code: mov r4, r0 /* save addr_sp */ mov r5, r1 /* save addr of gd */ mov r6, r2 /* save addr of destination */ - mov r7, r2 /* save addr of destination */ /* Set up the stack */ stack_setup: mov sp, r4 adr r0, _start + mov r1, r6 /* r1 <- scratch for copy_loop */ ldr r2, _TEXT_BASE ldr r3, _bss_start_ofs add r2, r0, r3 /* r2 <- source end address */
@@ -207,7 +207,7 @@ stack_setup: copy_loop: ldmia r0!, {r9-r10} /* copy from source address [r0] */ - stmia r6!, {r9-r10} /* copy to target address [r1] */ + stmia r1!, {r9-r10} /* copy to target address [r1] */ cmp r0, r2 /* until source end address [r2] */ blo copy_loop
@@ -216,7 +216,7 @@ copy_loop: * fix .rel.dyn relocations */ ldr r0, _TEXT_BASE /* r0 <- Text base */ - sub r9, r7, r0 /* r9 <- relocation offset */ + sub r9, r6, r0 /* r9 <- relocation offset */ ldr r10, _dynsym_start_ofs /* r10 <- sym table ofs */ add r10, r10, r0 /* r10 <- sym table in FLASH */ ldr r2, _rel_dyn_start_ofs /* r2 <- rel dyn start ofs */
@@ -257,7 +257,7 @@ clear_bss: ldr r0, _bss_start_ofs ldr r1, _bss_end_ofs ldr r3, _TEXT_BASE /* Text base */ - mov r4, r7 /* reloc addr */ + mov r4, r6 /* reloc addr */ add r0, r0, r4 add r1, r1, r4 mov r2, #0x00000000 /* clear */
@@ -288,7 +288,7 @@ _nand_boot_ofs: add lr, lr, r9 /* setup parameters for board_init_r */ mov r0, r5 /* gd_t */ - mov r1, r7 /* dest_addr */ + mov r1, r6 /* dest_addr */ /* jump to it ... */ mov pc, lr
arch/arm/cpu/arm926ejs/start.S +5 -5
@@ -191,13 +191,13 @@ relocate_code: mov r4, r0 /* save addr_sp */ mov r5, r1 /* save addr of gd */ mov r6, r2 /* save addr of destination */ - mov r7, r2 /* save addr of destination */ /* Set up the stack */ stack_setup: mov sp, r4 adr r0, _start + mov r1, r6 /* r1 <- scratch for copy loop */ ldr r2, _TEXT_BASE ldr r3, _bss_start_ofs add r2, r0, r3 /* r2 <- source end address */
@@ -206,7 +206,7 @@ stack_setup: copy_loop: ldmia r0!, {r9-r10} /* copy from source address [r0] */ - stmia r6!, {r9-r10} /* copy to target address [r1] */ + stmia r1!, {r9-r10} /* copy to target address [r1] */ cmp r0, r2 /* until source end address [r2] */ blo copy_loop
@@ -215,7 +215,7 @@ copy_loop: * fix .rel.dyn relocations */ ldr r0, _TEXT_BASE /* r0 <- Text base */ - sub r9, r7, r0 /* r9 <- relocation offset */ + sub r9, r6, r0 /* r9 <- relocation offset */ ldr r10, _dynsym_start_ofs /* r10 <- sym table ofs */ add r10, r10, r0 /* r10 <- sym table in FLASH */ ldr r2, _rel_dyn_start_ofs /* r2 <- rel dyn start ofs */
@@ -256,7 +256,7 @@ clear_bss: ldr r0, _bss_start_ofs ldr r1, _bss_end_ofs ldr r3, _TEXT_BASE /* Text base */ - mov r4, r7 /* reloc addr */ + mov r4, r6 /* reloc addr */ add r0, r0, r4 add r1, r1, r4 mov r2, #0x00000000 /* clear */
@@ -287,7 +287,7 @@ _nand_boot_ofs: add lr, lr, r9 /* setup parameters for board_init_r */ mov r0, r5 /* gd_t */ - mov r1, r7 /* dest_addr */ + mov r1, r6 /* dest_addr */ /* jump to it ... */ mov pc, lr
arch/arm/cpu/arm946es/start.S +5 -5
@@ -163,13 +163,13 @@ relocate_code: mov r4, r0 /* save addr_sp */ mov r5, r1 /* save addr of gd */ mov r6, r2 /* save addr of destination */ - mov r7, r2 /* save addr of destination */ /* Set up the stack */ stack_setup: mov sp, r4 adr r0, _start + mov r1, r6 /* r1 <- scratch for copy_loop */ ldr r2, _TEXT_BASE ldr r3, _bss_start_ofs add r2, r0, r3 /* r2 <- source end address */
@@ -178,7 +178,7 @@ stack_setup: copy_loop: ldmia r0!, {r9-r10} /* copy from source address [r0] */ - stmia r6!, {r9-r10} /* copy to target address [r1] */ + stmia r1!, {r9-r10} /* copy to target address [r1] */ cmp r0, r2 /* until source end address [r2] */ blo copy_loop
@@ -187,7 +187,7 @@ copy_loop: * fix .rel.dyn relocations */ ldr r0, _TEXT_BASE /* r0 <- Text base */ - sub r9, r7, r0 /* r9 <- relocation offset */ + sub r9, r6, r0 /* r9 <- relocation offset */ ldr r10, _dynsym_start_ofs /* r10 <- sym table ofs */ add r10, r10, r0 /* r10 <- sym table in FLASH */ ldr r2, _rel_dyn_start_ofs /* r2 <- rel dyn start ofs */
@@ -228,7 +228,7 @@ clear_bss: ldr r0, _bss_start_ofs ldr r1, _bss_end_ofs ldr r3, _TEXT_BASE /* Text base */ - mov r4, r7 /* reloc addr */ + mov r4, r6 /* reloc addr */ add r0, r0, r4 add r1, r1, r4 mov r2, #0x00000000 /* clear */
@@ -254,7 +254,7 @@ _nand_boot: .word nand_boot add lr, lr, r9 /* setup parameters for board_init_r */ mov r0, r5 /* gd_t */ - mov r1, r7 /* dest_addr */ + mov r1, r6 /* dest_addr */ /* jump to it ... */ mov pc, lr
arch/arm/cpu/arm_intcm/start.S +5 -5
@@ -159,13 +159,13 @@ relocate_code: mov r4, r0 /* save addr_sp */ mov r5, r1 /* save addr of gd */ mov r6, r2 /* save addr of destination */ - mov r7, r2 /* save addr of destination */ /* Set up the stack */ stack_setup: mov sp, r4 adr r0, _start + mov r1, r6 /* r1 <- scratch for copy_loop */ ldr r2, _TEXT_BASE ldr r3, _bss_start_ofs add r2, r0, r3 /* r2 <- source end address */
@@ -174,7 +174,7 @@ stack_setup: copy_loop: ldmia r0!, {r9-r10} /* copy from source address [r0] */ - stmia r6!, {r9-r10} /* copy to target address [r1] */ + stmia r1!, {r9-r10} /* copy to target address [r1] */ cmp r0, r2 /* until source end address [r2] */ blo copy_loop
@@ -183,7 +183,7 @@ copy_loop: * fix .rel.dyn relocations */ ldr r0, _TEXT_BASE /* r0 <- Text base */ - sub r9, r7, r0 /* r9 <- relocation offset */ + sub r9, r6, r0 /* r9 <- relocation offset */ ldr r10, _dynsym_start_ofs /* r10 <- sym table ofs */ add r10, r10, r0 /* r10 <- sym table in FLASH */ ldr r2, _rel_dyn_start_ofs /* r2 <- rel dyn start ofs */
@@ -224,7 +224,7 @@ clear_bss: ldr r0, _bss_start_ofs ldr r1, _bss_end_ofs ldr r3, _TEXT_BASE /* Text base */ - mov r4, r7 /* reloc addr */ + mov r4, r6 /* reloc addr */ add r0, r0, r4 add r1, r1, r4 mov r2, #0x00000000 /* clear */
@@ -255,7 +255,7 @@ _nand_boot_ofs: add lr, lr, r9 /* setup parameters for board_init_r */ mov r0, r5 /* gd_t */ - mov r1, r7 /* dest_addr */ + mov r1, r6 /* dest_addr */ /* jump to it ... */ mov pc, lr
arch/arm/cpu/armv7/start.S +5 -5
@@ -159,7 +159,6 @@ relocate_code: mov r4, r0 /* save addr_sp */ mov r5, r1 /* save addr of gd */ mov r6, r2 /* save addr of destination */ - mov r7, r2 /* save addr of destination */ /* Set up the stack */ stack_setup:
@@ -169,6 +168,7 @@ stack_setup: ldr r2, _TEXT_BASE ldr r3, _bss_start_ofs add r2, r0, r3 /* r2 <- source end address */ + mov r1, r6 /* r1 <- scratch for copy_loop */ cmp r0, r6 #ifndef CONFIG_PRELOADER beq jump_2_ram
@@ -176,7 +176,7 @@ stack_setup: copy_loop: ldmia r0!, {r9-r10} /* copy from source address [r0] */ - stmia r6!, {r9-r10} /* copy to target address [r1] */ + stmia r1!, {r9-r10} /* copy to target address [r1] */ cmp r0, r2 /* until source end address [r2] */ blo copy_loop
@@ -185,7 +185,7 @@ copy_loop: * fix .rel.dyn relocations */ ldr r0, _TEXT_BASE /* r0 <- Text base */ - sub r9, r7, r0 /* r9 <- relocation offset */ + sub r9, r6, r0 /* r9 <- relocation offset */ ldr r10, _dynsym_start_ofs /* r10 <- sym table ofs */ add r10, r10, r0 /* r10 <- sym table in FLASH */ ldr r2, _rel_dyn_start_ofs /* r2 <- rel dyn start ofs */
@@ -224,7 +224,7 @@ clear_bss: ldr r0, _bss_start_ofs ldr r1, _bss_end_ofs ldr r3, _TEXT_BASE /* Text base */ - mov r4, r7 /* reloc addr */ + mov r4, r6 /* reloc addr */ add r0, r0, r4 add r1, r1, r4 mov r2, #0x00000000 /* clear */
@@ -246,7 +246,7 @@ jump_2_ram: add lr, lr, r9 /* setup parameters for board_init_r */ mov r0, r5 /* gd_t */ - mov r1, r7 /* dest_addr */ + mov r1, r6 /* dest_addr */ /* jump to it ... */ mov pc, lr
arch/arm/cpu/ixp/start.S +5 -5
@@ -285,13 +285,13 @@ relocate_code: mov r4, r0 /* save addr_sp */ mov r5, r1 /* save addr of gd */ mov r6, r2 /* save addr of destination */ - mov r7, r2 /* save addr of destination */ /* Set up the stack */ stack_setup: mov sp, r4 adr r0, _start + mov r1, r6 /* r1 <- scratch for copy_loop */ ldr r2, _TEXT_BASE ldr r3, _bss_start_ofs add r2, r0, r3 /* r2 <- source end address */
@@ -300,7 +300,7 @@ stack_setup: copy_loop: ldmia r0!, {r9-r10} /* copy from source address [r0] */ - stmia r6!, {r9-r10} /* copy to target address [r1] */ + stmia r1!, {r9-r10} /* copy to target address [r1] */ cmp r0, r2 /* until source end address [r2] */ blo copy_loop
@@ -309,7 +309,7 @@ copy_loop: * fix .rel.dyn relocations */ ldr r0, _TEXT_BASE /* r0 <- Text base */ - sub r9, r7, r0 /* r9 <- relocation offset */ + sub r9, r6, r0 /* r9 <- relocation offset */ ldr r10, _dynsym_start_ofs /* r10 <- sym table ofs */ add r10, r10, r0 /* r10 <- sym table in FLASH */ ldr r2, _rel_dyn_start_ofs /* r2 <- rel dyn start ofs */
@@ -350,7 +350,7 @@ clear_bss: ldr r0, _bss_start_ofs ldr r1, _bss_end_ofs ldr r3, _TEXT_BASE /* Text base */ - mov r4, r7 /* reloc addr */ + mov r4, r6 /* reloc addr */ add r0, r0, r4 add r1, r1, r4 mov r2, #0x00000000 /* clear */
@@ -374,7 +374,7 @@ clbss_l:str r2, [r0] /* clear loop... */ add lr, lr, r9 /* setup parameters for board_init_r */ mov r0, r5 /* gd_t */ - mov r1, r7 /* dest_addr */ + mov r1, r6 /* dest_addr */ /* jump to it ... */ mov pc, lr
arch/arm/cpu/lh7a40x/start.S +5 -5
@@ -172,13 +172,13 @@ relocate_code: mov r4, r0 /* save addr_sp */ mov r5, r1 /* save addr of gd */ mov r6, r2 /* save addr of destination */ - mov r7, r2 /* save addr of destination */ /* Set up the stack */ stack_setup: mov sp, r4 adr r0, _start + mov r1, r6 /* r1 <- scratch for copy_loop */ ldr r2, _TEXT_BASE ldr r3, _bss_start_ofs add r2, r0, r3 /* r2 <- source end address */
@@ -187,7 +187,7 @@ stack_setup: copy_loop: ldmia r0!, {r9-r10} /* copy from source address [r0] */ - stmia r6!, {r9-r10} /* copy to target address [r1] */ + stmia r1!, {r9-r10} /* copy to target address [r1] */ cmp r0, r2 /* until source end address [r2] */ blo copy_loop
@@ -196,7 +196,7 @@ copy_loop: * fix .rel.dyn relocations */ ldr r0, _TEXT_BASE /* r0 <- Text base */ - sub r9, r7, r0 /* r9 <- relocation offset */ + sub r9, r6, r0 /* r9 <- relocation offset */ ldr r10, _dynsym_start_ofs /* r10 <- sym table ofs */ add r10, r10, r0 /* r10 <- sym table in FLASH */ ldr r2, _rel_dyn_start_ofs /* r2 <- rel dyn start ofs */
@@ -237,7 +237,7 @@ clear_bss: ldr r0, _bss_start_ofs ldr r1, _bss_end_ofs ldr r3, _TEXT_BASE /* Text base */ - mov r4, r7 /* reloc addr */ + mov r4, r6 /* reloc addr */ add r0, r0, r4 add r1, r1, r4 mov r2, #0x00000000 /* clear */
@@ -258,7 +258,7 @@ clbss_l:str r2, [r0] /* clear loop... */ add lr, lr, r9 /* setup parameters for board_init_r */ mov r0, r5 /* gd_t */ - mov r1, r7 /* dest_addr */ + mov r1, r6 /* dest_addr */ /* jump to it ... */ mov pc, lr
arch/arm/cpu/pxa/start.S +5 -5
@@ -237,13 +237,13 @@ relocate_code: mov r4, r0 /* save addr_sp */ mov r5, r1 /* save addr of gd */ mov r6, r2 /* save addr of destination */ - mov r7, r2 /* save addr of destination */ /* Set up the stack */ stack_setup: mov sp, r4 adr r0, _start + mov r1, r6 /* r1 <- scratch for copy_loop */ ldr r2, _TEXT_BASE ldr r3, _bss_start_ofs add r2, r0, r3 /* r2 <- source end address */
@@ -253,7 +253,7 @@ stack_setup: stmfd sp!, {r0-r12} copy_loop: ldmia r0!, {r3-r5, r7-r11} /* copy from source address [r0] */ - stmia r6!, {r3-r5, r7-r11} /* copy to target address [r1] */ + stmia r1!, {r3-r5, r7-r11} /* copy to target address [r1] */ cmp r0, r2 /* until source end address [r2] */ blo copy_loop ldmfd sp!, {r0-r12}
@@ -263,7 +263,7 @@ copy_loop: * fix .rel.dyn relocations */ ldr r0, _TEXT_BASE /* r0 <- Text base */ - sub r9, r7, r0 /* r9 <- relocation offset */ + sub r9, r6, r0 /* r9 <- relocation offset */ ldr r10, _dynsym_start_ofs /* r10 <- sym table ofs */ add r10, r10, r0 /* r10 <- sym table in FLASH */ ldr r2, _rel_dyn_start_ofs /* r2 <- rel dyn start ofs */
@@ -304,7 +304,7 @@ clear_bss: ldr r0, _bss_start_ofs ldr r1, _bss_end_ofs ldr r3, _TEXT_BASE /* Text base */ - mov r4, r7 /* reloc addr */ + mov r4, r6 /* reloc addr */ add r0, r0, r4 add r1, r1, r4 mov r2, #0x00000000 /* clear */
@@ -332,7 +332,7 @@ _start_oneboot_ofs add lr, lr, r9 /* setup parameters for board_init_r */ mov r0, r5 /* gd_t */ - mov r1, r7 /* dest_addr */ + mov r1, r6 /* dest_addr */ /* jump to it ... */ mov pc, lr
arch/arm/cpu/s3c44b0/start.S +5 -5
@@ -144,13 +144,13 @@ relocate_code: mov r4, r0 /* save addr_sp */ mov r5, r1 /* save addr of gd */ mov r6, r2 /* save addr of destination */ - mov r7, r2 /* save addr of destination */ /* Set up the stack */ stack_setup: mov sp, r4 adr r0, _start + mov r1, r6 /* r1 <- scratch for copy_loop */ ldr r2, _TEXT_BASE ldr r3, _bss_start_ofs add r2, r0, r3 /* r2 <- source end address */
@@ -159,7 +159,7 @@ stack_setup: copy_loop: ldmia r0!, {r9-r10} /* copy from source address [r0] */ - stmia r6!, {r9-r10} /* copy to target address [r1] */ + stmia r1!, {r9-r10} /* copy to target address [r1] */ cmp r0, r2 /* until source end address [r2] */ blo copy_loop
@@ -168,7 +168,7 @@ copy_loop: * fix .rel.dyn relocations */ ldr r0, _TEXT_BASE /* r0 <- Text base */ - sub r9, r7, r0 /* r9 <- relocation offset */ + sub r9, r6, r0 /* r9 <- relocation offset */ ldr r10, _dynsym_start_ofs /* r10 <- sym table ofs */ add r10, r10, r0 /* r10 <- sym table in FLASH */ ldr r2, _rel_dyn_start_ofs /* r2 <- rel dyn start ofs */
@@ -209,7 +209,7 @@ clear_bss: ldr r0, _bss_start_ofs ldr r1, _bss_end_ofs ldr r3, _TEXT_BASE /* Text base */ - mov r4, r7 /* reloc addr */ + mov r4, r6 /* reloc addr */ add r0, r0, r4 add r1, r1, r4 mov r2, #0x00000000 /* clear */
@@ -233,7 +233,7 @@ clbss_l:str r2, [r0] /* clear loop... */ add lr, lr, r9 /* setup parameters for board_init_r */ mov r0, r5 /* gd_t */ - mov r1, r7 /* dest_addr */ + mov r1, r6 /* dest_addr */ /* jump to it ... */ mov pc, lr
arch/arm/cpu/sa1100/start.S +5 -5
@@ -148,13 +148,13 @@ relocate_code: mov r4, r0 /* save addr_sp */ mov r5, r1 /* save addr of gd */ mov r6, r2 /* save addr of destination */ - mov r7, r2 /* save addr of destination */ /* Set up the stack */ stack_setup: mov sp, r4 adr r0, _start + mov r1, r6 /* r1 <- scratch for copy_loop */ ldr r2, _TEXT_BASE ldr r3, _bss_start_ofs add r2, r0, r3 /* r2 <- source end address */
@@ -163,7 +163,7 @@ stack_setup: copy_loop: ldmia r0!, {r9-r10} /* copy from source address [r0] */ - stmia r6!, {r9-r10} /* copy to target address [r1] */ + stmia r1!, {r9-r10} /* copy to target address [r1] */ cmp r0, r2 /* until source end address [r2] */ blo copy_loop
@@ -172,7 +172,7 @@ copy_loop: * fix .rel.dyn relocations */ ldr r0, _TEXT_BASE /* r0 <- Text base */ - sub r9, r7, r0 /* r9 <- relocation offset */ + sub r9, r6, r0 /* r9 <- relocation offset */ ldr r10, _dynsym_start_ofs /* r10 <- sym table ofs */ add r10, r10, r0 /* r10 <- sym table in FLASH */ ldr r2, _rel_dyn_start_ofs /* r2 <- rel dyn start ofs */
@@ -213,7 +213,7 @@ clear_bss: ldr r0, _bss_start_ofs ldr r1, _bss_end_ofs ldr r3, _TEXT_BASE /* Text base */ - mov r4, r7 /* reloc addr */ + mov r4, r6 /* reloc addr */ add r0, r0, r4 add r1, r1, r4 mov r2, #0x00000000 /* clear */
@@ -234,7 +234,7 @@ clbss_l:str r2, [r0] /* clear loop... */ add lr, lr, r9 /* setup parameters for board_init_r */ mov r0, r5 /* gd_t */ - mov r1, r7 /* dest_addr */ + mov r1, r6 /* dest_addr */ /* jump to it ... */ mov pc, lr
Signature · 1 line
1.7.3.2
Wolfgang Denk
AppliedPATCH 1/4 arm: copy_loop(): use scratch register
Dear =?UTF-8?q?Andreas=20Bie=C3=9Fmann?=,
Quoted 6 lines · In message <[email protected]>…
This patch uses r1 as scratch register for
copy_loop(). Therefore we do not longer need r7 for the storage of relocate_code()'s 'addr_moni' (the destination address of relocation).
Therefore r7 can be used later on for other purposes.Signed-off-by Andreas Bie?mann <[email protected]>
Quoted 16 lines
--- arch/arm/cpu/arm1136/start.S | 10 +++++----- arch/arm/cpu/arm1176/start.S | 10 +++++----- arch/arm/cpu/arm720t/start.S | 10 +++++----- arch/arm/cpu/arm920t/start.S | 10 +++++----- arch/arm/cpu/arm925t/start.S | 10 +++++----- arch/arm/cpu/arm926ejs/start.S | 10 +++++----- arch/arm/cpu/arm946es/start.S | 10 +++++----- arch/arm/cpu/arm_intcm/start.S | 10 +++++----- arch/arm/cpu/armv7/start.S | 10 +++++----- arch/arm/cpu/ixp/start.S | 10 +++++----- arch/arm/cpu/lh7a40x/start.S | 10 +++++----- arch/arm/cpu/pxa/start.S | 10 +++++----- arch/arm/cpu/s3c44b0/start.S | 10 +++++----- arch/arm/cpu/sa1100/start.S | 10 +++++----- 14 files changed, 70 insertions(+), 70 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk
Signature · 4 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Computers are not intelligent. They only think they are.
PATCH 1/4 arm: copy_loop(): use scratch register
In reply to Andreas BießmannLe 01/12/2010 00:58, Andreas Bie?mann a ?crit :
Quoted 6 lines
This patch uses r1 as scratch register for
copy_loop(). Therefore we do not longer need r7 for the storage of relocate_code()'s 'addr_moni' (the destination address of relocation).
Therefore r7 can be used later on for other purposes.Signed-off-by Andreas Bie?mann<[email protected]>
Amicalement,
Signature · 1 line
Albert.
PATCH 2/4 arm: relocate_code(): do not set register useless
In reply to Andreas BießmannIn case we are still at relocation target address before relocation we do not need to load the registers needed for relocation. We should instead skip the whole relocation part and jump over to clear_bss immediately.
--- arch/arm/cpu/arm1136/start.S | 4 ++-- arch/arm/cpu/arm1176/start.S | 4 ++-- arch/arm/cpu/arm720t/start.S | 4 ++-- arch/arm/cpu/arm920t/start.S | 4 ++-- arch/arm/cpu/arm925t/start.S | 4 ++-- arch/arm/cpu/arm926ejs/start.S | 4 ++-- arch/arm/cpu/arm946es/start.S | 4 ++-- arch/arm/cpu/arm_intcm/start.S | 4 ++-- arch/arm/cpu/armv7/start.S | 8 ++++---- arch/arm/cpu/ixp/start.S | 4 ++-- arch/arm/cpu/lh7a40x/start.S | 4 ++-- arch/arm/cpu/pxa/start.S | 4 ++-- arch/arm/cpu/s3c44b0/start.S | 4 ++-- arch/arm/cpu/sa1100/start.S | 4 ++-- 14 files changed, 30 insertions(+), 30 deletions(-)
arch/arm/cpu/arm1136/start.S +2 -2
@@ -192,12 +192,12 @@ stack_setup: mov sp, r4 adr r0, _start + cmp r0, r6 + beq clear_bss /* skip relocation */ mov r1, r6 /* r1 <- scratch for copy_loop */ ldr r2, _TEXT_BASE ldr r3, _bss_start_ofs add r2, r0, r3 /* r2 <- source end address */ - cmp r0, r6 - beq clear_bss copy_loop: ldmia r0!, {r9-r10} /* copy from source address [r0] */
arch/arm/cpu/arm1176/start.S +2 -2
@@ -246,12 +246,12 @@ stack_setup: mov sp, r4 adr r0, _start + cmp r0, r6 + beq clear_bss /* skip relocation */ mov r1, r6 /* r1 <- scratch for copy_loop */ ldr r2, _TEXT_BASE ldr r3, _bss_start_ofs add r2, r0, r3 /* r2 <- source end address */ - cmp r0, r6 - beq clear_bss copy_loop: ldmia r0!, {r9-r10} /* copy from source address [r0] */
arch/arm/cpu/arm720t/start.S +2 -2
@@ -161,12 +161,12 @@ stack_setup: mov sp, r4 adr r0, _start + cmp r0, r6 + beq clear_bss /* skip relocation */ mov r1, r6 /* r1 <- scratch for copy_loop */ ldr r2, _TEXT_BASE ldr r3, _bss_start_ofs add r2, r0, r3 /* r2 <- source end address */ - cmp r0, r6 - beq clear_bss copy_loop: ldmia r0!, {r9-r10} /* copy from source address [r0] */
arch/arm/cpu/arm920t/start.S +2 -2
@@ -207,12 +207,12 @@ stack_setup: mov sp, r4 adr r0, _start + cmp r0, r6 + beq clear_bss /* skip relocation */ mov r1, r6 /* r1 <- scratch for copy_loop */ ldr r2, _TEXT_BASE ldr r3, _bss_start_ofs add r2, r0, r3 /* r2 <- source end address */ - cmp r0, r6 - beq clear_bss copy_loop: ldmia r0!, {r9-r10} /* copy from source address [r0] */
arch/arm/cpu/arm925t/start.S +2 -2
@@ -198,12 +198,12 @@ stack_setup: mov sp, r4 adr r0, _start + cmp r0, r6 + beq clear_bss /* skip relocation */ mov r1, r6 /* r1 <- scratch for copy_loop */ ldr r2, _TEXT_BASE ldr r3, _bss_start_ofs add r2, r0, r3 /* r2 <- source end address */ - cmp r0, r6 - beq clear_bss copy_loop: ldmia r0!, {r9-r10} /* copy from source address [r0] */
arch/arm/cpu/arm926ejs/start.S +2 -2
@@ -197,12 +197,12 @@ stack_setup: mov sp, r4 adr r0, _start + cmp r0, r6 + beq clear_bss /* skip relocation */ mov r1, r6 /* r1 <- scratch for copy loop */ ldr r2, _TEXT_BASE ldr r3, _bss_start_ofs add r2, r0, r3 /* r2 <- source end address */ - cmp r0, r6 - beq clear_bss copy_loop: ldmia r0!, {r9-r10} /* copy from source address [r0] */
arch/arm/cpu/arm946es/start.S +2 -2
@@ -169,12 +169,12 @@ stack_setup: mov sp, r4 adr r0, _start + cmp r0, r6 + beq clear_bss /* skip relocation */ mov r1, r6 /* r1 <- scratch for copy_loop */ ldr r2, _TEXT_BASE ldr r3, _bss_start_ofs add r2, r0, r3 /* r2 <- source end address */ - cmp r0, r6 - beq clear_bss copy_loop: ldmia r0!, {r9-r10} /* copy from source address [r0] */
arch/arm/cpu/arm_intcm/start.S +2 -2
@@ -165,12 +165,12 @@ stack_setup: mov sp, r4 adr r0, _start + cmp r0, r6 + beq clear_bss /* skip relocation */ mov r1, r6 /* r1 <- scratch for copy_loop */ ldr r2, _TEXT_BASE ldr r3, _bss_start_ofs add r2, r0, r3 /* r2 <- source end address */ - cmp r0, r6 - beq clear_bss copy_loop: ldmia r0!, {r9-r10} /* copy from source address [r0] */
arch/arm/cpu/armv7/start.S +4 -4
@@ -165,14 +165,14 @@ stack_setup: mov sp, r4 adr r0, _start - ldr r2, _TEXT_BASE - ldr r3, _bss_start_ofs - add r2, r0, r3 /* r2 <- source end address */ - mov r1, r6 /* r1 <- scratch for copy_loop */ cmp r0, r6 #ifndef CONFIG_PRELOADER beq jump_2_ram #endif + mov r1, r6 /* r1 <- scratch for copy_loop */ + ldr r2, _TEXT_BASE + ldr r3, _bss_start_ofs + add r2, r0, r3 /* r2 <- source end address */ copy_loop: ldmia r0!, {r9-r10} /* copy from source address [r0] */
arch/arm/cpu/ixp/start.S +2 -2
@@ -291,12 +291,12 @@ stack_setup: mov sp, r4 adr r0, _start + cmp r0, r6 + beq clear_bss /* skip relocation */ mov r1, r6 /* r1 <- scratch for copy_loop */ ldr r2, _TEXT_BASE ldr r3, _bss_start_ofs add r2, r0, r3 /* r2 <- source end address */ - cmp r0, r6 - beq clear_bss copy_loop: ldmia r0!, {r9-r10} /* copy from source address [r0] */
arch/arm/cpu/lh7a40x/start.S +2 -2
@@ -178,12 +178,12 @@ stack_setup: mov sp, r4 adr r0, _start + cmp r0, r6 + beq clear_bss /* skip relocation */ mov r1, r6 /* r1 <- scratch for copy_loop */ ldr r2, _TEXT_BASE ldr r3, _bss_start_ofs add r2, r0, r3 /* r2 <- source end address */ - cmp r0, r6 - beq clear_bss copy_loop: ldmia r0!, {r9-r10} /* copy from source address [r0] */
arch/arm/cpu/pxa/start.S +2 -2
@@ -243,12 +243,12 @@ stack_setup: mov sp, r4 adr r0, _start + cmp r0, r6 + beq clear_bss /* skip relocation */ mov r1, r6 /* r1 <- scratch for copy_loop */ ldr r2, _TEXT_BASE ldr r3, _bss_start_ofs add r2, r0, r3 /* r2 <- source end address */ - cmp r0, r6 - beq clear_bss stmfd sp!, {r0-r12} copy_loop:
arch/arm/cpu/s3c44b0/start.S +2 -2
@@ -150,12 +150,12 @@ stack_setup: mov sp, r4 adr r0, _start + cmp r0, r6 + beq clear_bss /* skip relocation */ mov r1, r6 /* r1 <- scratch for copy_loop */ ldr r2, _TEXT_BASE ldr r3, _bss_start_ofs add r2, r0, r3 /* r2 <- source end address */ - cmp r0, r6 - beq clear_bss copy_loop: ldmia r0!, {r9-r10} /* copy from source address [r0] */
arch/arm/cpu/sa1100/start.S +2 -2
@@ -154,12 +154,12 @@ stack_setup: mov sp, r4 adr r0, _start + cmp r0, r6 + beq clear_bss /* skip relocation */ mov r1, r6 /* r1 <- scratch for copy_loop */ ldr r2, _TEXT_BASE ldr r3, _bss_start_ofs add r2, r0, r3 /* r2 <- source end address */ - cmp r0, r6 - beq clear_bss copy_loop: ldmia r0!, {r9-r10} /* copy from source address [r0] */
Signature · 1 line
1.7.3.2
Wolfgang Denk
AppliedPATCH 2/4 arm: relocate_code(): do not set register useless
Dear =?UTF-8?q?Andreas=20Bie=C3=9Fmann?=,
Quoted 6 lines · In message <[email protected]>…
In case we are still at relocation target address before relocation we do not need to load the registers needed for relocation. We should instead skip the whole relocation part and jump over to
clear_bssimmediately.Signed-off-by Andreas Bie??mann <[email protected]>
Quoted 16 lines
--- arch/arm/cpu/arm1136/start.S | 4 ++-- arch/arm/cpu/arm1176/start.S | 4 ++-- arch/arm/cpu/arm720t/start.S | 4 ++-- arch/arm/cpu/arm920t/start.S | 4 ++-- arch/arm/cpu/arm925t/start.S | 4 ++-- arch/arm/cpu/arm926ejs/start.S | 4 ++-- arch/arm/cpu/arm946es/start.S | 4 ++-- arch/arm/cpu/arm_intcm/start.S | 4 ++-- arch/arm/cpu/armv7/start.S | 8 ++++---- arch/arm/cpu/ixp/start.S | 4 ++-- arch/arm/cpu/lh7a40x/start.S | 4 ++-- arch/arm/cpu/pxa/start.S | 4 ++-- arch/arm/cpu/s3c44b0/start.S | 4 ++-- arch/arm/cpu/sa1100/start.S | 4 ++-- 14 files changed, 30 insertions(+), 30 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk
Signature · 4 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de "A little knowledge is a dangerous thing." - Doug Gwyn
PATCH 2/4 arm: relocate_code(): do not set register useless
In reply to Andreas BießmannLe 01/12/2010 00:58, Andreas Bie?mann a ?crit :
Quoted 6 lines
In case we are still at relocation target address before relocation we do not need to load the registers needed for relocation. We should instead skip the whole relocation part and jump over to
clear_bssimmediately.Signed-off-by Andreas Bie?mann<[email protected]>
Amicalement,
Signature · 1 line
Albert.
PATCH 2/4 arm: relocate_code(): do not set register useless
In reply to Andreas BießmannLe 01/12/2010 00:58, Andreas Bie?mann a ?crit :
Quoted 6 lines
In case we are still at relocation target address before relocation we do not need to load the registers needed for relocation. We should instead skip the whole relocation part and jump over to
clear_bssimmediately.Signed-off-by Andreas Bie?mann<[email protected]>
(note: other patches in the series have a typo in my e-mail address -- missing dot between my name and surname. In my case, lack not of beer but of coffee.)
Amicalement,
Signature · 1 line
Albert.
PATCH 3/4 arm: fixloop(): do not use r8 for relocation
In reply to Andreas Bießmannr8 is used for global_data and should therefore be left alone!
For C code the compiler flag --fixed-r8 does the job, but in assembler we need to be aware of that fact.
--- arch/arm/cpu/arm1136/start.S | 6 +++--- arch/arm/cpu/arm1176/start.S | 6 +++--- arch/arm/cpu/arm720t/start.S | 6 +++--- arch/arm/cpu/arm920t/start.S | 6 +++--- arch/arm/cpu/arm925t/start.S | 6 +++--- arch/arm/cpu/arm926ejs/start.S | 6 +++--- arch/arm/cpu/arm946es/start.S | 6 +++--- arch/arm/cpu/arm_intcm/start.S | 6 +++--- arch/arm/cpu/armv7/start.S | 6 +++--- arch/arm/cpu/ixp/start.S | 6 +++--- arch/arm/cpu/lh7a40x/start.S | 6 +++--- arch/arm/cpu/pxa/start.S | 6 +++--- arch/arm/cpu/s3c44b0/start.S | 6 +++--- arch/arm/cpu/sa1100/start.S | 6 +++--- 14 files changed, 42 insertions(+), 42 deletions(-)
arch/arm/cpu/arm1136/start.S +3 -3
@@ -221,10 +221,10 @@ fixloop: ldr r0, [r2] /* r0 <- location to fix up, IN FLASH! */ add r0, r0, r9 /* r0 <- location to fix up in RAM */ ldr r1, [r2, #4] - and r8, r1, #0xff - cmp r8, #23 /* relative fixup? */ + and r7, r1, #0xff + cmp r7, #23 /* relative fixup? */ beq fixrel - cmp r8, #2 /* absolute fixup? */ + cmp r7, #2 /* absolute fixup? */ beq fixabs /* ignore unknown type of fixup */ b fixnext
arch/arm/cpu/arm1176/start.S +3 -3
@@ -275,10 +275,10 @@ fixloop: ldr r0, [r2] /* r0 <- location to fix up, IN FLASH! */ add r0, r0, r9 /* r0 <- location to fix up in RAM */ ldr r1, [r2, #4] - and r8, r1, #0xff - cmp r8, #23 /* relative fixup? */ + and r7, r1, #0xff + cmp r7, #23 /* relative fixup? */ beq fixrel - cmp r8, #2 /* absolute fixup? */ + cmp r7, #2 /* absolute fixup? */ beq fixabs /* ignore unknown type of fixup */ b fixnext
arch/arm/cpu/arm720t/start.S +3 -3
@@ -190,10 +190,10 @@ fixloop: ldr r0, [r2] /* r0 <- location to fix up, IN FLASH! */ add r0, r0, r9 /* r0 <- location to fix up in RAM */ ldr r1, [r2, #4] - and r8, r1, #0xff - cmp r8, #23 /* relative fixup? */ + and r7, r1, #0xff + cmp r7, #23 /* relative fixup? */ beq fixrel - cmp r8, #2 /* absolute fixup? */ + cmp r7, #2 /* absolute fixup? */ beq fixabs /* ignore unknown type of fixup */ b fixnext
arch/arm/cpu/arm920t/start.S +3 -3
@@ -236,10 +236,10 @@ fixloop: ldr r0, [r2] /* r0 <- location to fix up, IN FLASH! */ add r0, r0, r9 /* r0 <- location to fix up in RAM */ ldr r1, [r2, #4] - and r8, r1, #0xff - cmp r8, #23 /* relative fixup? */ + and r7, r1, #0xff + cmp r7, #23 /* relative fixup? */ beq fixrel - cmp r8, #2 /* absolute fixup? */ + cmp r7, #2 /* absolute fixup? */ beq fixabs /* ignore unknown type of fixup */ b fixnext
arch/arm/cpu/arm925t/start.S +3 -3
@@ -227,10 +227,10 @@ fixloop: ldr r0, [r2] /* r0 <- location to fix up, IN FLASH! */ add r0, r0, r9 /* r0 <- location to fix up in RAM */ ldr r1, [r2, #4] - and r8, r1, #0xff - cmp r8, #23 /* relative fixup? */ + and r7, r1, #0xff + cmp r7, #23 /* relative fixup? */ beq fixrel - cmp r8, #2 /* absolute fixup? */ + cmp r7, #2 /* absolute fixup? */ beq fixabs /* ignore unknown type of fixup */ b fixnext
arch/arm/cpu/arm926ejs/start.S +3 -3
@@ -226,10 +226,10 @@ fixloop: ldr r0, [r2] /* r0 <- location to fix up, IN FLASH! */ add r0, r0, r9 /* r0 <- location to fix up in RAM */ ldr r1, [r2, #4] - and r8, r1, #0xff - cmp r8, #23 /* relative fixup? */ + and r7, r1, #0xff + cmp r7, #23 /* relative fixup? */ beq fixrel - cmp r8, #2 /* absolute fixup? */ + cmp r7, #2 /* absolute fixup? */ beq fixabs /* ignore unknown type of fixup */ b fixnext
arch/arm/cpu/arm946es/start.S +3 -3
@@ -198,10 +198,10 @@ fixloop: ldr r0, [r2] /* r0 <- location to fix up, IN FLASH! */ add r0, r0, r9 /* r0 <- location to fix up in RAM */ ldr r1, [r2, #4] - and r8, r1, #0xff - cmp r8, #23 /* relative fixup? */ + and r7, r1, #0xff + cmp r7, #23 /* relative fixup? */ beq fixrel - cmp r8, #2 /* absolute fixup? */ + cmp r7, #2 /* absolute fixup? */ beq fixabs /* ignore unknown type of fixup */ b fixnext
arch/arm/cpu/arm_intcm/start.S +3 -3
@@ -194,10 +194,10 @@ fixloop: ldr r0, [r2] /* r0 <- location to fix up, IN FLASH! */ add r0, r0, r9 /* r0 <- location to fix up in RAM */ ldr r1, [r2, #4] - and r8, r1, #0xff - cmp r8, #23 /* relative fixup? */ + and r7, r1, #0xff + cmp r7, #23 /* relative fixup? */ beq fixrel - cmp r8, #2 /* absolute fixup? */ + cmp r7, #2 /* absolute fixup? */ beq fixabs /* ignore unknown type of fixup */ b fixnext
arch/arm/cpu/armv7/start.S +3 -3
@@ -196,10 +196,10 @@ fixloop: ldr r0, [r2] /* r0 <- location to fix up, IN FLASH! */ add r0, r0, r9 /* r0 <- location to fix up in RAM */ ldr r1, [r2, #4] - and r8, r1, #0xff - cmp r8, #23 /* relative fixup? */ + and r7, r1, #0xff + cmp r7, #23 /* relative fixup? */ beq fixrel - cmp r8, #2 /* absolute fixup? */ + cmp r7, #2 /* absolute fixup? */ beq fixabs /* ignore unknown type of fixup */ b fixnext
arch/arm/cpu/ixp/start.S +3 -3
@@ -320,10 +320,10 @@ fixloop: ldr r0, [r2] /* r0 <- location to fix up, IN FLASH! */ add r0, r0, r9 /* r0 <- location to fix up in RAM */ ldr r1, [r2, #4] - and r8, r1, #0xff - cmp r8, #23 /* relative fixup? */ + and r7, r1, #0xff + cmp r7, #23 /* relative fixup? */ beq fixrel - cmp r8, #2 /* absolute fixup? */ + cmp r7, #2 /* absolute fixup? */ beq fixabs /* ignore unknown type of fixup */ b fixnext
arch/arm/cpu/lh7a40x/start.S +3 -3
@@ -207,10 +207,10 @@ fixloop: ldr r0, [r2] /* r0 <- location to fix up, IN FLASH! */ add r0, r0, r9 /* r0 <- location to fix up in RAM */ ldr r1, [r2, #4] - and r8, r1, #0xff - cmp r8, #23 /* relative fixup? */ + and r7, r1, #0xff + cmp r7, #23 /* relative fixup? */ beq fixrel - cmp r8, #2 /* absolute fixup? */ + cmp r7, #2 /* absolute fixup? */ beq fixabs /* ignore unknown type of fixup */ b fixnext
arch/arm/cpu/pxa/start.S +3 -3
@@ -274,10 +274,10 @@ fixloop: ldr r0, [r2] /* r0 <- location to fix up, IN FLASH! */ add r0, r9 /* r0 <- location to fix up in RAM */ ldr r1, [r2, #4] - and r8, r1, #0xff - cmp r8, #23 /* relative fixup? */ + and r7, r1, #0xff + cmp r7, #23 /* relative fixup? */ beq fixrel - cmp r8, #2 /* absolute fixup? */ + cmp r7, #2 /* absolute fixup? */ beq fixabs /* ignore unknown type of fixup */ b fixnext
arch/arm/cpu/s3c44b0/start.S +3 -3
@@ -179,10 +179,10 @@ fixloop: ldr r0, [r2] /* r0 <- location to fix up, IN FLASH! */ add r0, r0, r9 /* r0 <- location to fix up in RAM */ ldr r1, [r2, #4] - and r8, r1, #0xff - cmp r8, #23 /* relative fixup? */ + and r7, r1, #0xff + cmp r7, #23 /* relative fixup? */ beq fixrel - cmp r8, #2 /* absolute fixup? */ + cmp r7, #2 /* absolute fixup? */ beq fixabs /* ignore unknown type of fixup */ b fixnext
arch/arm/cpu/sa1100/start.S +3 -3
@@ -183,10 +183,10 @@ fixloop: ldr r0, [r2] /* r0 <- location to fix up, IN FLASH! */ add r0, r0, r9 /* r0 <- location to fix up in RAM */ ldr r1, [r2, #4] - and r8, r1, #0xff - cmp r8, #23 /* relative fixup? */ + and r7, r1, #0xff + cmp r7, #23 /* relative fixup? */ beq fixrel - cmp r8, #2 /* absolute fixup? */ + cmp r7, #2 /* absolute fixup? */ beq fixabs /* ignore unknown type of fixup */ b fixnext
Signature · 1 line
1.7.3.2
Wolfgang Denk
AppliedPATCH 3/4 arm: fixloop(): do not use r8 for relocation
Dear =?UTF-8?q?Andreas=20Bie=C3=9Fmann?=,
Quoted 6 lines · In message <[email protected]>…
r8 is used for
global_dataand should therefore be left alone!For C code the compiler flag --fixed-r8 does the job, but in assembler we need to be aware of that fact.
Signed-off-by Andreas Bie?mann <[email protected]>
Quoted 16 lines
--- arch/arm/cpu/arm1136/start.S | 6 +++--- arch/arm/cpu/arm1176/start.S | 6 +++--- arch/arm/cpu/arm720t/start.S | 6 +++--- arch/arm/cpu/arm920t/start.S | 6 +++--- arch/arm/cpu/arm925t/start.S | 6 +++--- arch/arm/cpu/arm926ejs/start.S | 6 +++--- arch/arm/cpu/arm946es/start.S | 6 +++--- arch/arm/cpu/arm_intcm/start.S | 6 +++--- arch/arm/cpu/armv7/start.S | 6 +++--- arch/arm/cpu/ixp/start.S | 6 +++--- arch/arm/cpu/lh7a40x/start.S | 6 +++--- arch/arm/cpu/pxa/start.S | 6 +++--- arch/arm/cpu/s3c44b0/start.S | 6 +++--- arch/arm/cpu/sa1100/start.S | 6 +++--- 14 files changed, 42 insertions(+), 42 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk
Signature · 5 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de The IQ of the group is the lowest IQ of a member of the group divided by the number of people in the group.
PATCH 3/4 arm: fixloop(): do not use r8 for relocation
In reply to Andreas BießmannLe 01/12/2010 00:58, Andreas Bie?mann a ?crit :
Quoted 6 lines
r8 is used for
global_dataand should therefore be left alone!For C code the compiler flag --fixed-r8 does the job, but in assembler we need to be aware of that fact.
Signed-off-by Andreas Bie?mann<[email protected]>
Amicalement,
Signature · 1 line
Albert.
PATCH 4/4 armv7: fix relocation skip
In reply to Andreas BießmannI doubt the stack_setup() was defective before:
we load the current location of _start and compare against destination of relocate_code(). If we are already there we shoud skip the relocation and jump over to clear_bss. Before the clear_bss was also skipped.
---
Dear Albert,
(or whoever works with armv7 currently)
However I doubt there is another issue when CONFIG_PRELOADER is not set! Then the bss will never be setup, is that correct?
arch/arm/cpu/armv7/start.S | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
arch/arm/cpu/armv7/start.S +2 -2
@@ -165,9 +165,9 @@ stack_setup: mov sp, r4 adr r0, _start - cmp r0, r6 #ifndef CONFIG_PRELOADER - beq jump_2_ram + cmp r0, r6 + beq clear_bss /* skip relocation */ #endif mov r1, r6 /* r1 <- scratch for copy_loop */ ldr r2, _TEXT_BASE
Signature · 1 line
1.7.3.2
PATCH 4/4 armv7: fix relocation skip
Le 01/12/2010 00:58, Andreas Bie?mann a ?crit :
Quoted 5 lines
I doubt the
stack_setup()was defective before:
we load the current location of_startand compare against destination ofrelocate_code(). If we are already there we shoud skip the relocation and jump over toclear_bss. Before theclear_bsswas also skipped.
Quoted 7 lines
Signed-off-by Andreas Bie?mann<[email protected]>---
Dear Albert,
(or whoever works with armv7 currently)However I doubt there is another issue when
CONFIG_PRELOADERis not set! Then the bss will never be setup, is that correct?
That is correct and had to be fixed indeed. Thanks!
Amicalement,
Signature · 1 line
Albert.
Wolfgang Denk
AppliedPATCH 4/4 armv7: fix relocation skip
In reply to Andreas BießmannDear =?UTF-8?q?Andreas=20Bie=C3=9Fmann?=,
Quoted 10 lines · In message <[email protected]>…
I doubt the
stack_setup()was defective before:
we load the current location of_startand compare against destination ofrelocate_code(). If we are already there we shoud skip the relocation and jump over toclear_bss. Before theclear_bsswas also skipped.Signed-off-by Andreas Bie?mann <[email protected]>---
Dear Albert,
(or whoever works with armv7 currently)
Quoted 5 lines
However I doubt there is another issue when
CONFIG_PRELOADERis not set! Then the bss will never be setup, is that correct?arch/arm/cpu/armv7/start.S | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk
Signature · 6 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de I have never understood the female capacity to avoid a direct answer to any question. -- Spock, "This Side of Paradise", stardate 3417.3
PATCH 4/4 armv7: fix relocation skip
In reply to Andreas BießmannLe 01/12/2010 00:58, Andreas Bie?mann a ?crit :
Quoted 6 lines
I doubt the
stack_setup()was defective before:
we load the current location of_startand compare against destination ofrelocate_code(). If we are already there we shoud skip the relocation and jump over toclear_bss. Before theclear_bsswas also skipped.Signed-off-by Andreas Bie?mann<[email protected]>
Amicalement,
Signature · 1 line
Albert.