Need to check that location is valid on RAM before the fixup.

Signed-off-by: Minkyu Kang <mk7.k...@samsung.com>
---
 arch/arm/cpu/armv7/start.S |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/arch/arm/cpu/armv7/start.S b/arch/arm/cpu/armv7/start.S
index 684f2d2..a052378 100644
--- a/arch/arm/cpu/armv7/start.S
+++ b/arch/arm/cpu/armv7/start.S
@@ -195,6 +195,11 @@ copy_loop:
        add     r3, r3, r0              /* r3 <- rel dyn end in FLASH */
 fixloop:
        ldr     r0, [r2]                /* r0 <- location to fix up, IN FLASH! 
*/
+       ldr     r7, _TEXT_BASE
+       cmp     r0, r7
+       blo     fixskip
+       cmp     r0, r6
+       bhs     fixskip
        add     r0, r0, r9              /* r0 <- location to fix up in RAM */
        ldr     r1, [r2, #4]
        and     r7, r1, #0xff
@@ -217,6 +222,7 @@ fixrel:
        add     r1, r1, r9
 fixnext:
        str     r1, [r0]
+fixskip:
        add     r2, r2, #8              /* each rel.dyn entry is 8 bytes */
        cmp     r2, r3
        blo     fixloop
-- 
1.7.1
_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to