summaryrefslogtreecommitdiff
path: root/arch/x86/lib/board.c
diff options
context:
space:
mode:
authorGabe Black <gabeblack@chromium.org>2011-11-12 16:34:48 +0000
committerGraeme Russ <graeme.russ@gmail.com>2011-11-29 21:30:44 +1100
commit769db03a4a4ea1dc7e43c089c2227a0c8b4ffcbc (patch)
treedc6c62ac0b9f6c24e566a0057a115daba078f1c2 /arch/x86/lib/board.c
parent03228b26d5d999b05ea6e5946ad0375715b9043c (diff)
downloadu-boot-imx-769db03a4a4ea1dc7e43c089c2227a0c8b4ffcbc.zip
u-boot-imx-769db03a4a4ea1dc7e43c089c2227a0c8b4ffcbc.tar.gz
u-boot-imx-769db03a4a4ea1dc7e43c089c2227a0c8b4ffcbc.tar.bz2
x86: Don't relocate symbols which point to things that aren't relocated
This change adds an upper bound for symbols which are fixed up after u-boot is relocated into RAM. This way portions that are left at their original location can be referred to without having to manually fix up any pointers. Signed-off-by: Gabe Black <gabeblack@chromium.org>
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 244a021..18e0ede 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);