diff options
author | Alex Auvolat <alex@adnab.me> | 2016-07-30 23:17:12 +0200 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2016-07-30 23:17:12 +0200 |
commit | f58f65c30de315d4419f69a92a708cbed797ff37 (patch) | |
tree | efaaa82089523dc0f7a3b9a6ab4c963550f9b241 /src/kernel/core | |
parent | fa5327d4cc5e47656326b8c0c55d23cd71b04462 (diff) | |
download | kogata-f58f65c30de315d4419f69a92a708cbed797ff37.tar.gz kogata-f58f65c30de315d4419f69a92a708cbed797ff37.zip |
Release mode (enables some optimizations) ; fix tests.
Diffstat (limited to 'src/kernel/core')
-rw-r--r-- | src/kernel/core/kmain.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/kernel/core/kmain.c b/src/kernel/core/kmain.c index dd66805..8ce9f0a 100644 --- a/src/kernel/core/kmain.c +++ b/src/kernel/core/kmain.c @@ -69,8 +69,12 @@ void kmain(multiboot_info_t *mbd, int32_t mb_magic) { // to allocate memory ; they just increment it of the allocated quantity void* kernel_data_end = (void*)&k_end_addr; - elf_shdr_t *elf_sections = (elf_shdr_t*)(mbd->elf_sec.addr + K_HIGHHALF_ADDR); - ASSERT(sizeof(elf_shdr_t) == mbd->elf_sec.size); + + elf_shdr_t *elf_sections = 0; + if (mbd->elf_sec.size != 0) { + elf_sections = (elf_shdr_t*)(mbd->elf_sec.addr + K_HIGHHALF_ADDR); + ASSERT(mbd->elf_sec.size == 0 || sizeof(elf_shdr_t) == mbd->elf_sec.size); + } dbglog_setup(); |