binfmt/elf: bss section should init to zero

Signed-off-by: hujun5 <hujun5@xiaomi.com>
This commit is contained in:
hujun5 2023-07-13 11:32:01 +08:00 committed by Xiang Xiao
parent d89e0996f5
commit 9f1cb4135b

View File

@ -194,6 +194,15 @@ static inline int elf_loadfile(FAR struct elf_loadinfo_s *loadinfo)
}
}
/* If there is no data in an allocated section, then the
* allocated section must be cleared.
*/
else
{
memset((FAR uint8_t *)shdr->sh_addr, 0, shdr->sh_size);
}
continue;
}