ddn.elf.dynamic
ELF dynamic section handling functionality.
This module provides utilities for reading and manipulating ELF dynamic sections, which contain information needed for dynamic linking and loading.
NOTE: Implementation is minimal to ensure GDC compatibility. Some advanced features may be limited.
Types 3
structElfDynamicEntry
Represents a single entry in an ELF dynamic section.
Dynamic entries contain tags and values that describe how to program should be dynamically linked.
Methods
string getString()Resolve this entry's integer value as a string from the string table.Constructors
this(gelf.DynamicEntry entry, ElfStringTable strtab)Construct a dynamic entry.structDynamicEntryRange
Range for iterating over dynamic entries.
Fields
private const(ubyte)[] _dataprivate size_t _currentIndexprivate size_t _totalEntriesprivate types.ElfClass _classprivate ElfEndian _endianprivate ElfStringTable _strtabMethods
ElfDynamicEntry front()Get the current dynamic entry.void popFront()Advance to the next dynamic entry.typeof(this) save()Save the current state of the range.private
gelf.DynamicEntry readGelfEntry(size_t idx)Constructors
this()this(const(ubyte)[] data, size_t totalEntries, types.ElfClass elfClass,
ElfEndian endianness, ElfStringTable strtab)Construct a range over dynamic section entries.this(const(ubyte)[] data, size_t currentIndex, size_t totalEntries,
types.ElfClass elfClass, ElfEndian endianness, ElfStringTable strtab)Private constructor for creating saved copies of the range.structElfDynamic
Represents an ELF dynamic section.
This struct provides access to dynamic linking information needed to load shared libraries and resolve symbols.
Fields
private const(ubyte)[] _dataprivate size_t _numEntriesprivate ElfStringTable _strtabprivate types.ElfClass _classprivate ElfEndian _endianMethods
size_t numEntries() pure nothrow @nogc @safe constGet the number of active entries in the dynamic section.ElfDynamicEntry getEntry(size_t index)Get the dynamic entry at the given 0-based index.DynamicEntryRange entries()Get a range for iterating over all active dynamic entries.string getSoname()Get the shared library name (DT_SONAME) if present.string[] getNeededLibraries()Get the list of shared libraries this object depends on (DT_NEEDED).string getRpath()Get the deprecated library search path (DT_RPATH) if present.string getRunpath()Get the runtime library search path (DT_RUNPATH) if present.bool hasTextRelocations()Check whether text relocations are present.const(ElfStringTable) getStringTable() pure nothrow @nogc @safe ref return constGet the associated string table.private
gelf.DynamicEntry readGelfEntry(size_t idx)Functions 2
private fn
ElfDynamic buildDynamic(gelf.DynamicEntry[] entries)Build an ELF64 little-endian file with a .dynstr and a .dynamic section holding the given entries, and return the ElfDynamic for it.