boot: zero bss after jump to C entry point

This commit is contained in:
K. Lange 2018-12-20 15:45:13 +09:00
parent 0433c683e7
commit 38691a2f01
2 changed files with 5 additions and 0 deletions

View File

@ -110,7 +110,10 @@ efi_main (EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
ST = SystemTable;
ImageHandleIn = ImageHandle;
#else
extern char _bss_start[];
extern char _bss_end[];
int kmain() {
memset(&_bss_start,0,(uintptr_t)&_bss_end-(uintptr_t)&_bss_start);
#endif
BOOT_OPTION(_debug, 0, "Debug output",

View File

@ -28,10 +28,12 @@ SECTIONS
.bss BLOCK(1) : ALIGN(1)
{
PROVIDE(_bss_start = .);
bss = .;
*(COMMON)
*(.bss)
*(.stack)
PROVIDE(_bss_end = .);
}
end = .;