X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=arch%2Fx86%2Flib%2Frelocate.c;h=b33586b54c0311a9b596cbcca23ed357ab78b3e0;hb=bceb9f0fc80c71b8b2a7371288199cdacca1bad9;hp=526daaf93a639194e693ef8fd5f5d6486f256721;hpb=3be2bdf5dc69b3142c1162a59bc67191c9077567;p=u-boot diff --git a/arch/x86/lib/relocate.c b/arch/x86/lib/relocate.c index 526daaf93a..b33586b54c 100644 --- a/arch/x86/lib/relocate.c +++ b/arch/x86/lib/relocate.c @@ -16,6 +16,7 @@ */ #include +#include #include #include #include @@ -75,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; @@ -94,7 +98,7 @@ int do_elf_reloc_fixups(void) *offset_ptr_ram += gd->reloc_off; } else { debug(" %p: rom reloc %x, ram %p, value %x," - " limit %lx\n", re_src, + " limit %" PRIXPTR "\n", re_src, re_src->r_offset, offset_ptr_ram, *offset_ptr_ram, CONFIG_SYS_TEXT_BASE + size);