summaryrefslogtreecommitdiff
path: root/kexec/arch/ia64/kexec-elf-ia64.c
diff options
context:
space:
mode:
Diffstat (limited to 'kexec/arch/ia64/kexec-elf-ia64.c')
-rw-r--r--kexec/arch/ia64/kexec-elf-ia64.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/kexec/arch/ia64/kexec-elf-ia64.c b/kexec/arch/ia64/kexec-elf-ia64.c
index f5273b7..3bb5a4d 100644
--- a/kexec/arch/ia64/kexec-elf-ia64.c
+++ b/kexec/arch/ia64/kexec-elf-ia64.c
@@ -99,15 +99,19 @@ void elf_ia64_usage(void)
void move_loaded_segments(struct mem_ehdr *ehdr, unsigned long addr)
{
unsigned i;
- long offset;
+ long offset = 0;
+ int found = 0;
struct mem_phdr *phdr;
for(i = 0; i < ehdr->e_phnum; i++) {
phdr = &ehdr->e_phdr[i];
if (phdr->p_type == PT_LOAD) {
offset = addr - phdr->p_paddr;
+ found++;
break;
}
}
+ if (!found)
+ die("move_loaded_segments: no PT_LOAD region 0x%016x\n", addr);
ehdr->e_entry += offset;
for(i = 0; i < ehdr->e_phnum; i++) {
phdr = &ehdr->e_phdr[i];