arm: do not compile relocate_code() for SPL builds
[oweals/u-boot.git] / arch / arm / cpu / arm946es / start.S
index 2dd1fa3407d982c39fa7885217ff0b5279a5df71..2fc730cee10db1b9f377ddbddab745d3da2fc45c 100644 (file)
@@ -105,10 +105,6 @@ _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
@@ -159,16 +155,15 @@ reset:
 
 /*------------------------------------------------------------------------------*/
 
+#ifndef CONFIG_SPL_BUILD
 /*
- * void relocate_code (addr_sp, gd, addr_moni)
+ * void relocate_code(addr_moni)
  *
  * This function relocates the monitor code.
  */
        .globl  relocate_code
 relocate_code:
-       mov     r4, r0  /* save addr_sp */
-       mov     r5, r1  /* save addr of gd */
-       mov     r6, r2  /* save addr of destination */
+       mov     r6, r0  /* save addr of destination */
 
        adr     r0, _start
        subs    r9, r6, r0              /* r9 <- relocation offset */
@@ -183,7 +178,6 @@ copy_loop:
        cmp     r0, r2                  /* until source end address [r2]    */
        blo     copy_loop
 
-#ifndef CONFIG_SPL_BUILD
        /*
         * fix .rel.dyn relocations
         */
@@ -221,12 +215,13 @@ fixnext:
        add     r2, r2, #8              /* each rel.dyn entry is 8 bytes */
        cmp     r2, r3
        blo     fixloop
-#endif
 
 relocate_done:
 
        mov     pc, lr
 
+_image_copy_end_ofs:
+       .word __image_copy_end - _start
 _rel_dyn_start_ofs:
        .word __rel_dyn_start - _start
 _rel_dyn_end_ofs:
@@ -234,6 +229,8 @@ _rel_dyn_end_ofs:
 _dynsym_start_ofs:
        .word __dynsym_start - _start
 
+#endif
+
        .globl  c_runtime_cpu_setup
 c_runtime_cpu_setup: