aboutsummaryrefslogtreecommitdiff
path: root/libs/elf
diff options
context:
space:
mode:
authorFelix Morgner <felix.morgner@ost.ch>2026-08-20 15:08:38 +0200
committerFelix Morgner <felix.morgner@ost.ch>2026-08-20 15:08:38 +0200
commit51bd0daba2fa3cd42242b2c07cf4851bc7845fb1 (patch)
tree66217854d939dee1e20d6972ae996bca12aed458 /libs/elf
parent9638a27c37f1f85625d9b3681792fce37fb935af (diff)
downloadkernel-51bd0daba2fa3cd42242b2c07cf4851bc7845fb1.tar.xz
kernel-51bd0daba2fa3cd42242b2c07cf4851bc7845fb1.zip
chore: clean up some more doc comments
Diffstat (limited to 'libs/elf')
-rw-r--r--libs/elf/elf/section_header.hpp114
1 files changed, 76 insertions, 38 deletions
diff --git a/libs/elf/elf/section_header.hpp b/libs/elf/elf/section_header.hpp
index b1305ec2..cf738d00 100644
--- a/libs/elf/elf/section_header.hpp
+++ b/libs/elf/elf/section_header.hpp
@@ -47,39 +47,67 @@ namespace elf
//! The type of the section described by this header.
enum struct header_type : std::uint32_t
{
- null = 0, ///< Is inactive
- program_data = 1, ///< Contains program data
- symbol_table = 2, ///< Contains a symbol table
- string_table = 3, ///< Contains a string table
- relocation_entries_with_addends = 4, ///< Contains relocation information with addends
- hash_table = 5, ///< Contains a symbol hash table
- dynamic_linking_entries = 6, ///< Contains dynamic linking information
- notes = 7, ///< Contains additional notes about the object file
- no_content = 8, ///< Contains no data
- relocation_entries_without_addends = 9, ///< Contains relocation information without addends
- reserved = 10, ///< Reserved for future use
- dynamic_linker_symbol_table = 11, ///< Contains the dynamic linker symbol table
- init_array = 14, ///< Contains an array of constructor pointers
- fini_array = 15, ///< Contains an array of destructor pointers
- preinit_array = 16, ///< Contains an array of pre-constructor pointers
- group_table = 17, ///< Defines a section group
- extended_section_header_indices = 18, ///< Contains extended section header indices
+ //! Is inactive
+ null = 0,
+ //! Contains program data
+ program_data = 1,
+ //! Contains a symbol table
+ symbol_table = 2,
+ //! Contains a string table
+ string_table = 3,
+ //! Contains relocation information with addends
+ relocation_entries_with_addends = 4,
+ //! Contains a symbol hash table
+ hash_table = 5,
+ //! Contains dynamic linking information
+ dynamic_linking_entries = 6,
+ //! Contains additional notes about the object file
+ notes = 7,
+ //! Contains no data
+ no_content = 8,
+ //! Contains relocation information without addends
+ relocation_entries_without_addends = 9,
+ //! Reserved for future use
+ reserved = 10,
+ //! Contains the dynamic linker symbol table
+ dynamic_linker_symbol_table = 11,
+ //! Contains an array of constructor pointers
+ init_array = 14,
+ //! Contains an array of destructor pointers
+ fini_array = 15,
+ //! Contains an array of destructor pointers
+ preinit_array = 16,
+ //! Defines a section group
+ group_table = 17,
+ //! Contains extended section header indices
+ extended_section_header_indices = 18,
};
//! The properties of the section describe by this header.
enum struct header_flags : format_uint
{
- writable = 0x1, ///< Contains writable data
- allocated = 0x2, ///< Occupies memory during execution
- executable = 0x4, ///< Contains executable instructions
- mergeable = 0x10, ///< Contained data may be merged for deduplication
- strings = 0x20, ///< Contains null-terminated strings
- info_link = 0x40, ///< Contains the section header index of linked section
- link_order = 0x80, ///< Must respect linking location relative to linked section
- os_specific = 0x100, ///< Must be handled in an OS specific way
- group_member = 0x200, ///< Is a member of a section group
- thread_local_storage = 0x400, ///< Contains thread local storage data
- compressed = 0x800, ///< Is compressed
+ //! Contains writable data
+ writable = 0x1,
+ //! Occupies memory during execution
+ allocated = 0x2,
+ //! Contains executable instructions
+ executable = 0x4,
+ //! Contained data may be merged for deduplication
+ mergeable = 0x10,
+ //! Contains null-terminated strings
+ strings = 0x20,
+ //! Contains the section header index of linked section
+ info_link = 0x40,
+ //! Must respect linking location relative to linked section
+ link_order = 0x80,
+ //! Must be handled in an OS specific way
+ os_specific = 0x100,
+ //! Is a member of a section group
+ group_member = 0x200,
+ //! Contains thread local storage data
+ thread_local_storage = 0x400,
+ //! Is compressed
+ compressed = 0x800,
};
//! Check if the section is allocated
@@ -100,16 +128,26 @@ namespace elf
return std::to_underlying(flags) & std::to_underlying(header_flags::writable);
}
- std::uint32_t name_offset; ///< Offset into the section header string table, defining the section name
- header_type type; ///< Type of this section
- header_flags flags; ///< Flags of this section
- format_uint virtual_load_address; ///< Virtual address where this section is loaded
- format_uint file_offset; ///< Offset of the start of this section's data in the file
- format_uint size; ///< Size of this section in memory
- std::uint32_t linked_section; ///< Index of a section this section is linked to
- std::uint32_t extra_info; ///< Additional information for this section (type and flag dependent)
- format_uint alignment; ///< Alignment requirement of this section in memory
- format_uint entry_size; ///< Size of the entries inside this section (if any)
+ //! Offset into the section header string table, defining the section name
+ std::uint32_t name_offset;
+ //! Type of this section
+ header_type type;
+ //! Flags of this section
+ header_flags flags;
+ //! Virtual address where this section is loaded
+ format_uint virtual_load_address;
+ //! Offset of the start of this section's data in the file
+ format_uint file_offset;
+ //! Size of this section in memory
+ format_uint size;
+ //! Index of a section this section is linked to
+ std::uint32_t linked_section;
+ //! Additional information for this section (type and flag dependent)
+ std::uint32_t extra_info;
+ //! Alignment requirement of this section in memory
+ format_uint alignment;
+ //! Size of the entries inside this section (if any)
+ format_uint entry_size;
};
static_assert(sizeof(section_header<format::elf32>) == section_header_size<format::elf32>);