ddn.elf.sections
ELF section access and manipulation functionality.
This module provides comprehensive access to ELF file sections, including section enumeration, lookup by index or name, type filtering, and data access. All section access is lazy-loaded and cached for efficiency.
Types 3
structElfSection
Represents a single ELF section with lazy-loaded data.
This struct provides access to section header information, name, and data. All values are loaded lazily and cached for subsequent access.
Fields
ElfFile _filesize_t _indexgelf.SectionHeader _headerstring _nameconst(ubyte)[] _databool _headerLoadedbool _nameLoadedbool _dataLoadedMethods
void _loadHeader()Load the section header from the ELF file.void _loadName()Load the section name from the section header string table.gelf.SectionHeader getHeader()Get the section header.string getName()Get the section name.const(ubyte)[] getData()Get the section data.bool isSymtab()Check if this is a symbol table section.bool isStrtab()Check if this is a string table section.bool isRela()Check if this is a RELA section (relocation with explicit addends).bool isRel()Check if this is a REL section (relocation without addends).bool isAllocatable()Check if this section is allocatable (occupies memory during execution).bool isExecutable()Check if this section is executable.bool isWritable()Check if this section is writable.structSectionTypeRange
Input range for iterating sections of a specific type.
This range filters sections by type and provides lazy-loaded ElfSection objects.
Fields
ElfFile _filetypes.SectionType _typegelf.SectionHeader[] _headerssize_t _currentIndexbool _initializedMethods
void _initialize()Initialize and find the first matching section.void _findNext()Find the next section matching the type.void popFront()Advance to the next section.Constructors
this(ElfFile file, types.SectionType type)Constructor.this(ElfFile file, types.SectionType type, gelf.SectionHeader[] headers, size_t currentIndex, bool initialized)Internal constructor for save().structSectionRange
Input range for iterating all sections in an ELF file.
This range provides lazy-loaded ElfSection objects for all sections.
Methods
void popFront()Advance to the next section.Functions 4
fn
SectionTypeRange getSectionsByType(ElfFile file, types.SectionType type)Get a range for iterating sections of a specific type.