[U-Boot] [PATCH RFC 3/3] arm920t: do not relocate NULL pointer
Andreas Bießmann
andreas.devel at googlemail.com
Tue Nov 30 08:06:40 CET 2010
Signed-off-by: Andreas Bießmann <andreas.devel at googlemail.com>
---
arch/arm/cpu/arm920t/start.S | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/arch/arm/cpu/arm920t/start.S b/arch/arm/cpu/arm920t/start.S
index 629be3f..e3f9cdb 100644
--- a/arch/arm/cpu/arm920t/start.S
+++ b/arch/arm/cpu/arm920t/start.S
@@ -248,11 +248,15 @@ fixabs:
mov r1, r1, LSR #4 /* r1 <- symbol index in .dynsym */
add r1, r10, r1 /* r1 <- address of symbol in table */
ldr r1, [r1, #4] /* r1 <- symbol value */
+ cmp r1, #0 /* symbol == NULL ? */
+ beq fixnext
add r1, r9 /* r1 <- relocated sym addr */
b fixnext
fixrel:
/* relative fix: increase location by offset */
ldr r1, [r0] /* r1 <- address of symbol */
+ cmp r1, #0 /* symbol == NULL ? */
+ beq fixnext
add r1, r1, r9 /* r1 <- relocated address of symbol */
fixnext:
str r1, [r0] /* store back content of r1 */
--
1.7.3.2
More information about the U-Boot
mailing list