summaryrefslogtreecommitdiff
path: root/arch/x86/lib/board.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/lib/board.c')
-rw-r--r--arch/x86/lib/board.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/x86/lib/board.c b/arch/x86/lib/board.c
index 244a02163ce..18e0edee875 100644
--- a/arch/x86/lib/board.c
+++ b/arch/x86/lib/board.c
@@ -231,8 +231,11 @@ static int do_elf_reloc_fixups(void)
offset_ptr_ram = offset_ptr_rom + gd->reloc_off;
/* Check that the target points into .text */
- if (*offset_ptr_ram >= CONFIG_SYS_TEXT_BASE)
+ if (*offset_ptr_ram >= CONFIG_SYS_TEXT_BASE &&
+ *offset_ptr_ram <
+ (CONFIG_SYS_TEXT_BASE + size)) {
*offset_ptr_ram += gd->reloc_off;
+ }
}
} while (re_src++ < re_end);