diff options
| author | Felix Morgner <felix.morgner@ost.ch> | 2025-10-31 11:16:12 +0100 |
|---|---|---|
| committer | Felix Morgner <felix.morgner@ost.ch> | 2025-10-31 11:16:12 +0100 |
| commit | 31c5f011b2c7b4cc65d4017d92c2fe0bdf7f4ba6 (patch) | |
| tree | b2c8c1a5b55487afdbd687d801de30bedc68eb52 /libs/multiboot2 | |
| parent | b1143bde71bb029ac2bf7d08ba422fcdaedd56a6 (diff) | |
| download | teachos-31c5f011b2c7b4cc65d4017d92c2fe0bdf7f4ba6.tar.xz teachos-31c5f011b2c7b4cc65d4017d92c2fe0bdf7f4ba6.zip | |
libs/elf: implement section headers
Diffstat (limited to 'libs/multiboot2')
| -rw-r--r-- | libs/multiboot2/include/multiboot2/information.hpp | 12 |
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> |
