From 3ff9432975ce1378ffc490f4eab2aef2da262c41 Mon Sep 17 00:00:00 2001 From: SPRESENSE <41312067+SPRESENSE@users.noreply.github.com> Date: Mon, 5 Feb 2024 19:06:21 +0900 Subject: [PATCH] tools/cxd56: Update to output bss-only section to spk file In creating spk image, the section which filesz is 0 is ignored, so change to check memsz instead of filesz. --- tools/cxd56/mkspk.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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;