aboutsummaryrefslogtreecommitdiff
path: root/libs/elf
diff options
context:
space:
mode:
authorFelix Morgner <felix.morgner@ost.ch>2025-10-30 15:59:48 +0100
committerFelix Morgner <felix.morgner@ost.ch>2025-10-30 15:59:48 +0100
commit78f0df1cf849af8b0ade40a8ebcffd7fb53635cb (patch)
tree1ceab6b4f2f518a32da5c12d0939637c7fbdd7e7 /libs/elf
parent5e9b7dd3dbc194ffa583e9efaab1aef1b6792d97 (diff)
downloadteachos-78f0df1cf849af8b0ade40a8ebcffd7fb53635cb.tar.xz
teachos-78f0df1cf849af8b0ade40a8ebcffd7fb53635cb.zip
libs: begin ELF support implementation
Diffstat (limited to 'libs/elf')
-rw-r--r--libs/elf/CMakeLists.txt19
-rw-r--r--libs/elf/include/elf/format.hpp15
-rw-r--r--libs/elf/include/elf/section_header.hpp23
3 files changed, 57 insertions, 0 deletions
diff --git a/libs/elf/CMakeLists.txt b/libs/elf/CMakeLists.txt
new file mode 100644
index 0000000..66e59ee
--- /dev/null
+++ b/libs/elf/CMakeLists.txt
@@ -0,0 +1,19 @@
+add_library("elf" INTERFACE)
+add_library("libs::elf" ALIAS "elf")
+
+target_sources("elf" INTERFACE
+ FILE_SET HEADERS
+ BASE_DIRS "include"
+ FILES
+ "include/elf/format.hpp"
+ "include/elf/section_header.hpp"
+
+)
+
+target_include_directories("elf" INTERFACE
+ "include"
+)
+
+set_target_properties("elf" PROPERTIES
+ VERIFY_INTERFACE_HEADER_SETS YES
+) \ No newline at end of file
diff --git a/libs/elf/include/elf/format.hpp b/libs/elf/include/elf/format.hpp
new file mode 100644
index 0000000..b3220f5
--- /dev/null
+++ b/libs/elf/include/elf/format.hpp
@@ -0,0 +1,15 @@
+#ifndef ELF_FORMAT_HPP
+#define ELF_FORMAT_HPP
+
+namespace elf
+{
+
+ enum struct format
+ {
+ elf32,
+ elf64,
+ };
+
+} // namespace elf
+
+#endif \ No newline at end of file
diff --git a/libs/elf/include/elf/section_header.hpp b/libs/elf/include/elf/section_header.hpp
new file mode 100644
index 0000000..0ff5e4b
--- /dev/null
+++ b/libs/elf/include/elf/section_header.hpp
@@ -0,0 +1,23 @@
+#ifndef ELF_SECTION_HEADER_HPP
+#define ELF_SECTION_HEADER_HPP
+
+#include "format.hpp"
+
+#include <cstdint>
+
+namespace elf
+{
+
+ enum struct section_header_type : std::uint32_t
+ {
+ };
+
+ template<format Format>
+ struct section_header
+ {
+ std::uint32_t name_offset;
+ section_header_type type;
+ };
+} // namespace elf
+
+#endif \ No newline at end of file