diff --git a/tools/cxd56/mkspk.c b/tools/cxd56/mkspk.c index f34d06dc2e..6e20403049 100644 --- a/tools/cxd56/mkspk.c +++ b/tools/cxd56/mkspk.c @@ -243,7 +243,7 @@ static void *create_image(struct elf_file *elf, int core, char *savename, psize = 0; for (i = 0, ph = elf->phdr; i < elf->ehdr->e_phnum; i++, ph++) { - if (ph->p_type != PT_LOAD || ph->p_filesz == 0) + if (ph->p_type != PT_LOAD || ph->p_memsz == 0) { continue; } @@ -297,7 +297,7 @@ static void *create_image(struct elf_file *elf, int core, char *savename, offset = ((char *)pi - img) + (nphs * sizeof(*pi)); for (i = 0; i < elf->ehdr->e_phnum; i++, ph++) { - if (ph->p_type != PT_LOAD || ph->p_filesz == 0) + if (ph->p_type != PT_LOAD || ph->p_memsz == 0) continue; pi->load_address = ph->p_paddr; pi->offset = offset;