aboutsummaryrefslogtreecommitdiff
path: root/libs/multiboot2
diff options
context:
space:
mode:
authorFelix Morgner <felix.morgner@ost.ch>2025-10-31 11:16:12 +0100
committerFelix Morgner <felix.morgner@ost.ch>2025-10-31 11:16:12 +0100
commit31c5f011b2c7b4cc65d4017d92c2fe0bdf7f4ba6 (patch)
treeb2c8c1a5b55487afdbd687d801de30bedc68eb52 /libs/multiboot2
parentb1143bde71bb029ac2bf7d08ba422fcdaedd56a6 (diff)
downloadteachos-31c5f011b2c7b4cc65d4017d92c2fe0bdf7f4ba6.tar.xz
teachos-31c5f011b2c7b4cc65d4017d92c2fe0bdf7f4ba6.zip
libs/elf: implement section headers
Diffstat (limited to 'libs/multiboot2')
-rw-r--r--libs/multiboot2/include/multiboot2/information.hpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/libs/multiboot2/include/multiboot2/information.hpp b/libs/multiboot2/include/multiboot2/information.hpp
index d2b4c98..462528d 100644
--- a/libs/multiboot2/include/multiboot2/information.hpp
+++ b/libs/multiboot2/include/multiboot2/information.hpp
@@ -176,7 +176,17 @@ namespace multiboot2
template<elf::format Format>
auto maybe_elf_symbols() const noexcept -> std::optional<elf_symbols<Format>>
{
- return get<multiboot2::elf_symbols<Format>>();
+ return get<multiboot2::elf_symbols<Format>>().and_then(
+ [](auto x) -> std::optional<multiboot2::elf_symbols<Format>> {
+ if (x.entry_size == elf::section_header_size<Format>)
+ {
+ return std::optional{x};
+ }
+ else
+ {
+ return std::nullopt;
+ }
+ });
}
template<elf::format Format>