summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2014-11-14 18:18:23 -0700
committerSimon Glass <sjg@chromium.org>2014-11-25 06:33:59 -0700
commit512e581c86a4066147a9a095eaed05a7aa9043df (patch)
tree8c6d6ada2d9292edf47bc3b03bd17f3336117644 /arch
parent65990d568074ad878cbc7e4eb1053508e3707cb6 (diff)
downloadu-boot-imx-512e581c86a4066147a9a095eaed05a7aa9043df.zip
u-boot-imx-512e581c86a4066147a9a095eaed05a7aa9043df.tar.gz
u-boot-imx-512e581c86a4066147a9a095eaed05a7aa9043df.tar.bz2
x86: Panic if there is no relocation data
This normally indicates a problem which will prevent relocation from functioning, resulting in a hang. Panic in this case to make it easier to debug. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/lib/relocate.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/x86/lib/relocate.c b/arch/x86/lib/relocate.c
index faca38f..b33586b 100644
--- a/arch/x86/lib/relocate.c
+++ b/arch/x86/lib/relocate.c
@@ -76,6 +76,9 @@ int do_elf_reloc_fixups(void)
/* The size of the region of u-boot that runs out of RAM. */
uintptr_t size = (uintptr_t)&__bss_end - (uintptr_t)&__text_start;
+ if (re_src == re_end)
+ panic("No relocation data");
+
do {
/* Get the location from the relocation entry */
offset_ptr_rom = (Elf32_Addr *)re_src->r_offset;