diff options
Diffstat (limited to 'arch/x86_64/src')
| -rw-r--r-- | arch/x86_64/src/kernel/main.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/arch/x86_64/src/kernel/main.cpp b/arch/x86_64/src/kernel/main.cpp index 6486b7c..40b2fe5 100644 --- a/arch/x86_64/src/kernel/main.cpp +++ b/arch/x86_64/src/kernel/main.cpp @@ -63,13 +63,26 @@ namespace teachos::arch::kernel // value should be zero :( // assert(begin->is_null()); - // TODO: Check if only contains one DYNSYM or SYMTAB but not both! - // TODO: Check if only contains one dynamic section + std::size_t symbol_table_section_count = 0U; + std::size_t dynamic_section_count = 0U; for (auto section = begin; section != end; ++section) { + if (section->type == arch::memory::elf_section_type::DYNAMIC_SYMBOL_TABLE || + section->type == arch::memory::elf_section_type::SYMBOL_TABLE) + { + symbol_table_section_count++; + } + else if (section->type == arch::memory::elf_section_type::DYNAMIC) + { + dynamic_section_count++; + } video::vga::text::write("Looping Code section", video::vga::text::common_attributes::green_on_black); } + + // TODO: Contains two symbol tables and 4 dynamic sections, that is definetly wrong, perhaps same reason as above? + assert(symbol_table_section_count == 1U); + assert(dynamic_section_count == 1U); } auto main() -> void |
