aboutsummaryrefslogtreecommitdiff
path: root/src/kernel/core/kmain.c
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2016-07-30 23:17:12 +0200
committerAlex Auvolat <alex@adnab.me>2016-07-30 23:17:12 +0200
commitf58f65c30de315d4419f69a92a708cbed797ff37 (patch)
treeefaaa82089523dc0f7a3b9a6ab4c963550f9b241 /src/kernel/core/kmain.c
parentfa5327d4cc5e47656326b8c0c55d23cd71b04462 (diff)
downloadkogata-f58f65c30de315d4419f69a92a708cbed797ff37.tar.gz
kogata-f58f65c30de315d4419f69a92a708cbed797ff37.zip
Release mode (enables some optimizations) ; fix tests.
Diffstat (limited to 'src/kernel/core/kmain.c')
-rw-r--r--src/kernel/core/kmain.c8
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();