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.
This commit is contained in:
SPRESENSE 2024-02-05 19:06:21 +09:00 committed by Xiang Xiao
parent 1b3b12ed00
commit 3ff9432975

View File

@ -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;