diff options
-rw-r--r-- | kexec/kexec-elf.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/kexec/kexec-elf.c b/kexec/kexec-elf.c index 1d6320a..be60bbd 100644 --- a/kexec/kexec-elf.c +++ b/kexec/kexec-elf.c @@ -432,7 +432,8 @@ static int build_mem_phdrs(const char *buf, off_t len, struct mem_ehdr *ehdr, } return -1; } - if ((phdr->p_paddr + phdr->p_memsz) < phdr->p_paddr) { + if (phdr->p_paddr != (unsigned long long)-1 && + (phdr->p_paddr + phdr->p_memsz) < phdr->p_paddr) { /* The memory address wraps */ if (probe_debug) { fprintf(stderr, "ELF address wrap around\n"); |