Skip to content

Commit

Permalink
binfmt/elf: bss section should init to zero
Browse files Browse the repository at this point in the history
Signed-off-by: hujun5 <[email protected]>
  • Loading branch information
hujun260 committed Jul 29, 2023
1 parent d89e099 commit 6f07d50
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions binfmt/libelf/libelf_load.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 6f07d50

Please sign in to comment.