mirror of
https://github.com/apache/nuttx.git
synced 2026-05-27 11:26:12 +08:00
ELF: Critical bugfix.. BSS was not being cleared
This commit is contained in:
@@ -43,6 +43,7 @@
|
|||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <elf32.h>
|
#include <elf32.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
@@ -200,6 +201,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(*pptr, 0, shdr->sh_size);
|
||||||
|
}
|
||||||
|
|
||||||
/* Update sh_addr to point to copy in memory */
|
/* Update sh_addr to point to copy in memory */
|
||||||
|
|
||||||
bvdbg("%d. %08lx->%08lx\n", i,
|
bvdbg("%d. %08lx->%08lx\n", i,
|
||||||
|
|||||||
Reference in New Issue
Block a user