RetroLinker
Linker for several 8-bit, 16-bit and 32-bit formats
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Public Attributes | Static Public Attributes | List of all members
ELF::ELFFormat Class Reference

ELF object and executable format. More...

#include <elf.h>

Inheritance diagram for ELF::ELFFormat:
Linker::InputFormat Linker::SegmentManager Linker::Format Linker::OutputFormat Linker::Image Linker::Format Linker::Image

Classes

class  Array
 
class  Block
 
class  DynamicObject
 
class  DynamicSection
 
class  HashTable
 
struct  HobbitBeOSResource
 Resources for the prototype BeOS Development Release for the AT&T Hobbit. More...
 
class  IBMExportEntry
 
class  IBMExportTable
 
class  IBMImportEntry
 
class  IBMImportTable
 
class  IBMResource
 
class  IBMResourceCollection
 
class  IBMSystemInfo
 
class  IndexArray
 
class  Note
 
class  NotesSection
 
class  Relocation
 
class  Relocations
 
class  Section
 
class  SectionContents
 
class  SectionGroup
 
class  Segment
 
class  StringTable
 
class  Symbol
 
class  SymbolTable
 
class  VersionRequirement
 
class  VersionRequirements
 

Public Types

enum  cpu_type {
  EM_NONE = 0 , EM_M32 = 1 , EM_SPARC = 2 , EM_386 = 3 ,
  EM_68K = 4 , EM_88K = 5 , EM_IAMCU = 6 , EM_860 = 7 ,
  EM_MIPS = 8 , EM_S370 = 9 , EM_MIPS_RS3_LE = 10 , EM_OLD_SPARCV9 = 11 ,
  EM_PARISC = 15 , EM_VPP500 = 17 , EM_SPARC32PLUS = 18 , EM_960 = 19 ,
  EM_PPC = 20 , EM_PPC64 = 21 , EM_S390 = 22 , EM_SPU = 23 ,
  EM_V800 = 36 , EM_FR20 = 37 , EM_RH32 = 38 , EM_MCORE = 39 ,
  EM_RCE = EM_MCORE , EM_ARM = 40 , EM_ALPHA = 41 , EM_SH = 42 ,
  EM_SPARCV9 = 43 , EM_TRICORE = 44 , EM_ARC = 45 , EM_H8_300 = 46 ,
  EM_H8_300H = 47 , EM_H8S = 48 , EM_H8_500 = 49 , EM_IA_64 = 50 ,
  EM_MIPS_X = 51 , EM_COLDFIRE = 52 , EM_68HC12 = 53 , EM_MMA = 54 ,
  EM_PCP = 55 , EM_NCPU = 56 , EM_NDR1 = 57 , EM_STARCORE = 58 ,
  EM_ME16 = 59 , EM_ST100 = 60 , EM_TINYJ = 61 , EM_X86_64 = 62 ,
  EM_PDSP = 63 , EM_PDP10 = 64 , EM_PDP11 = 65 , EM_FX66 = 66 ,
  EM_ST9PLUS = 67 , EM_ST7 = 68 , EM_68HC16 = 69 , EM_68HC11 = 70 ,
  EM_68HC08 = 71 , EM_68HC05 = 72 , EM_SVX = 73 , EM_ST19 = 74 ,
  EM_VAX = 75 , EM_CRIS = 76 , EM_JAVELIN = 77 , EM_FIREPATH = 78 ,
  EM_ZSP = 79 , EM_MMIX = 80 , EM_HUANY = 81 , EM_PRISM = 82 ,
  EM_AVR = 83 , EM_FR30 = 84 , EM_D10V = 85 , EM_D30V = 86 ,
  EM_V850 = 87 , EM_M32R = 88 , EM_MN10300 = 89 , EM_MN10200 = 90 ,
  EM_PJ = 91 , EM_OPENRISC = 92 , EM_ARC_COMPACT = 93 , EM_ARC_A5 = EM_ARC_COMPACT ,
  EM_XTENSA = 94 , EM_SCORE_OLD = 95 , EM_VIDEOCORE = 95 , EM_TMM_GPP = 96 ,
  EM_NS32K = 97 , EM_TPC = 98 , EM_PJ_OLD = 99 , EM_SNP1K = 99 ,
  EM_ST200 = 100 , EM_IP2K = 101 , EM_MAX = 102 , EM_CR = 103 ,
  EM_F2MC16 = 104 , EM_MSP430 = 105 , EM_BLACKFIN = 106 , EM_SE_C33 = 107 ,
  EM_SEP = 108 , EM_ARCA = 109 , EM_UNICORE = 110 , EM_EXCESS = 111 ,
  EM_DXP = 112 , EM_ALTERA_NIOS32 = 113 , EM_CRX = 114 , EM_CR16_OLD = 115 ,
  EM_XGATE = 115 , EM_C166 = 116 , EM_M16C = 117 , EM_DSPIC30F = 118 ,
  EM_CE = 119 , EM_M32C = 120 , EM_TSK3000 = 131 , EM_RS08 = 132 ,
  EM_SHARC = 133 , EM_ECOG2 = 134 , EM_SCORE7 = 135 , EM_DSP24 = 136 ,
  EM_VIDEOCORE3 = 137 , EM_LATTICEMICO32 = 138 , EM_SE_CE17 = 139 , EM_TI_C6000 = 140 ,
  EM_TI_C2000 = 141 , EM_TI_C5500 = 142 , EM_TI_ARP32 = 143 , EM_TI_PRU = 144 ,
  EM_MMDSP_PLUS = 160 , EM_CYPRESS_M8C = 161 , EM_R32C = 162 , EM_TRIMEDIA = 163 ,
  EM_QDSP6 = 164 , EM_8051 = 165 , EM_STXP7X = 166 , EM_NDS32 = 167 ,
  EM_ECOG1 = 168 , EM_ECOG1X = EM_ECOG1 , EM_MAXQ30 = 169 , EM_XIMO16 = 170 ,
  EM_MANIK = 171 , EM_CRAYNV2 = 172 , EM_RX = 173 , EM_METAG = 174 ,
  EM_MCST_ELBRUS = 175 , EM_ECOG16 = 176 , EM_CR16 = 177 , EM_ETPU = 178 ,
  EM_SLE9X = 179 , EM_L10M = 180 , EM_K10M = 181 , EM_INTEL182 = 182 ,
  EM_AARCH64 = 183 , EM_ARM184 = 184 , EM_AVR32 = 185 , EM_STM8 = 186 ,
  EM_TILE64 = 187 , EM_TILEPRO = 188 , EM_MICROBLAZE = 189 , EM_CUDA = 190 ,
  EM_TILEGX = 191 , EM_CLOUDSHIELD = 192 , EM_COREA_1ST = 193 , EM_COREA_2ND = 194 ,
  EM_ARC_COMPACT2 = 195 , EM_OPEN8 = 196 , EM_RL78 = 197 , EM_VIDEOCORE5 = 198 ,
  EM_78KOR = 199 , EM_56800EX = 200 , EM_BA1 = 201 , EM_BA2 = 202 ,
  EM_XCORE = 203 , EM_MCHP_PIC = 204 , EM_INTELGT = 205 , EM_INTEL206 = 206 ,
  EM_INTEL207 = 207 , EM_INTEL208 = 208 , EM_INTEL209 = 209 , EM_KM32 = 210 ,
  EM_KMX32 = 211 , EM_KMX16 = 212 , EM_KMX8 = 213 , EM_KVARC = 214 ,
  EM_CDP = 215 , EM_COGE = 216 , EM_COOL = 217 , EM_NORC = 218 ,
  EM_CSR_KALIMBA = 219 , EM_Z80 = 220 , EM_VISIUM = 221 , EM_FT32 = 222 ,
  EM_MOXIE = 223 , EM_AMDGPU = 224 , EM_RISCV = 243 , EM_LANAI = 244 ,
  EM_CEVA = 245 , EM_CEVA_X2 = 246 , EM_BPF = 247 , EM_GRAPHCORE_IPU = 248 ,
  EM_IMG1 = 249 , EM_NFP = 250 , EM_VE = 251 , EM_CSKY = 252 ,
  EM_ARC_COMPACT3_64 = 253 , EM_MCS6502 = 254 , EM_ARC_COMPACT3 = 255 , EM_KVX = 256 ,
  EM_65816 = 257 , EM_LOONGARCH = 258 , EM_KF32 = 259 , EM_U16_U8CORE = 260 ,
  EM_TACHYUM = 261 , EM_56800EF = 262 , EM_HOBBIT = 925 , EM_MOS = 6502
}
 
enum  file_type {
  ET_NONE = 0 , ET_REL = 1 , ET_EXEC = 2 , ET_DYN = 3 ,
  ET_CORE = 4
}
 

Public Member Functions

void ReadFile (Linker::Reader &rd) override
 Loads file into memory.
 
offset_t WriteFile (Linker::Writer &wr) const override
 Stores data in memory to file.
 
void Dump (Dumper::Dumper &dump) const override
 Display file contents in a nice manner.
 
bool IsOldOS2Format () const
 Attempts to heuristically determine if it is in a beta OS/2 format.
 
void SetupOptions (std::shared_ptr< Linker::OutputFormat > format) override
 Initializes the reader for linking purposes.
 
void GenerateModule (Linker::Module &module) const override
 Loads the information into a module object, a convenience method when there is a single module generated.
 
void CalculateValues () override
 Intermediate step between processing module and generating output file to set up headers and management sections It is expected that after a module is processed, additional steps are required to evaluate the final values of the fields.
 
- Public Member Functions inherited from Linker::InputFormat
virtual void ProduceModule (ModuleCollector &linker, Reader &rd, std::string file_name)
 Reads a file and loads the information into a module object.
 
virtual void ProduceModule (Module &module, Reader &rd)
 Reads a file and loads the information into a module object, a convenience method when there is a single module generated.
 
virtual void GenerateModule (ModuleCollector &linker, std::string file_name, bool is_library=false) const
 Loads the information into a module object.
 
virtual bool FormatProvidesSegmentation () const
 Whether the format enables multiple x86 segments.
 
virtual bool FormatRequiresDataStreamFix () const
 Whether the generated file might contain bugs that require fixing.
 
virtual bool FormatProvidesResources () const
 Whether the format supports resources.
 
virtual bool FormatProvidesLibraries () const
 Whether the format enables importing/exporting libraries.
 
- Public Member Functions inherited from Linker::Format
 Format (offset_t file_offset=0)
 
virtual void Clear ()
 Resets all fields to their default values, deallocate memory.
 
offset_t ImageSize () const override
 Retrieves size of stored data.
 
offset_t WriteFile (Writer &wr, offset_t count, offset_t offset=0) const override
 Writes data of non-zero filled sections.
 
- Public Member Functions inherited from Linker::Image
virtual std::shared_ptr< const ActualImageAsImage () const
 Retrieves a randomly accessible image.
 
std::shared_ptr< ActualImageAsImage ()
 Retrieves a randomly accessible image.
 
- Public Member Functions inherited from Linker::SegmentManager
void ClearSegmentManager ()
 
void SetLinkScript (std::string script_file, std::map< std::string, std::string > &options) override
 Sets up the linker script and linker parameters.
 
std::unique_ptr< Script::ListGetScript (Module &module)
 Compiles the linker script into an internal format.
 
offset_t GetCurrentAddress () const
 Retrieves current address pointer.
 
void SetCurrentAddress (offset_t address)
 Moves the current address pointer further, and if the current segment already contains data, fill it up to the point.
 
void AlignCurrentAddress (offset_t align)
 Aligns current address to alignment, using SetCurrentAddress.
 
void SetLatestBase (offset_t address)
 Sets the base of the current section (the value from which offsets are counted from)
 
void FinishCurrentSegment ()
 Closes the current segment, sets current_segment to null.
 
virtual void OnNewSegment (std::shared_ptr< Segment > segment)
 Callback function when allocating a new segment When the linker script runs, it creates segments consecutively. Overriding this method permits the output format to handle the allocated segment.
 
std::shared_ptr< SegmentAppendSegment (std::string name)
 Terminates the current segment (if there is one), creates a new segment and attaches it to the image.
 
std::shared_ptr< SegmentFetchSegment (std::string name)
 Attempts to fetch a segment, returns null if not found.
 
void AppendSection (std::shared_ptr< Section > section)
 Adds a new section to the current segment, sets the base to the same as the segment.
 
void ProcessScript (std::unique_ptr< Script::List > &directives, Module &module)
 Executes a parsed linker script on a module and collects segments The function OnNewSegment can be defined to handle each newly allocated segment.
 
void ProcessAction (std::unique_ptr< Script::Node > &action, Module &module)
 
void PostProcessAction (std::unique_ptr< Script::Node > &action, Module &module)
 
void ProcessCommand (std::unique_ptr< Script::Node > &command, Module &module)
 
bool CheckPredicate (std::unique_ptr< Script::Node > &predicate, std::shared_ptr< Section > section, Module &module)
 
offset_t EvaluateExpression (std::unique_ptr< Script::Node > &expression, Module &module)
 
- Public Member Functions inherited from Linker::OutputFormat
virtual bool AddSupplementaryOutputFormat (std::string subformat)
 If the output format actually drives multiple output formats (resource file, apple double, etc.), specify multiple types, return false if unknown.
 
virtual void SetOptions (std::map< std::string, std::string > &options)
 Passes command line parameters as settings over to format object.
 
std::optional< std::string > FetchOption (std::map< std::string, std::string > &options, std::string name)
 Convenience method to look up option by name.
 
std::string FetchOption (std::map< std::string, std::string > &options, std::string name, std::string default_value)
 Convenience method to look up option by name, returning default value if name is missing.
 
std::optional< offset_t > FetchIntegerOption (std::map< std::string, std::string > &options, std::string name)
 Convenience method to look up option by name and convert it to integer.
 
virtual void SetModel (std::string model)
 Sets the way memory is organized, typically modifying a built-in script.
 
virtual void ProcessModule (Module &object)
 Processes the module object and initializes format fields.
 
virtual void GenerateFile (std::string filename, Module &module)
 The main function that handles processing, calculating and generating the final image.
 
virtual std::string GetDefaultExtension (Module &module, std::string filename) const
 Appends a default extension to the filename.
 
virtual std::string GetDefaultExtension (Module &module) const
 Provides a default filename for the output file.
 
virtual bool FormatSupportsSegmentation () const
 Whether the format supports multiple segments.
 
virtual bool FormatIs16bit () const
 Whether the format is 16-bit or not.
 
virtual bool FormatIsLinear () const
 Whether the address space is linear or segmented.
 
virtual bool FormatSupportsResources () const
 Whether the format supports resources.
 
virtual bool FormatSupportsLibraries () const
 Whether the format supports libraries.
 
virtual unsigned FormatAdditionalSectionFlags (std::string section_name) const
 

Public Attributes

offset_t file_offset = 0
 
uint8_t file_class = 0
 
EndianType endiantype = ::LittleEndian
 
uint8_t data_encoding = 0
 
size_t wordbytes = 4
 
cpu_type cpu = EM_NONE
 
uint8_t header_version = 0
 
uint8_t osabi = 0
 
uint8_t abi_version = 0
 
file_type object_file_type = ET_NONE
 
uint16_t file_version = 0
 
offset_t entry = 0
 
offset_t program_header_offset = 0
 
offset_t section_header_offset = 0
 
uint32_t flags = 0
 
uint16_t elf_header_size = 0
 
uint16_t program_header_entry_size = 0
 
uint16_t section_header_entry_size = 0
 
uint16_t section_name_string_table = 0
 
std::vector< Sectionsections
 
std::vector< Segmentsegments
 
std::vector< Blockblocks
 Collection of blocks of data that do not belong to any section.
 
offset_t hobbit_beos_resource_offset = 0
 
std::vector< HobbitBeOSResourcehobbit_beos_resources
 
bool option_16bit = true
 
bool option_linear = false
 
- Public Attributes inherited from Linker::Format
offset_t file_offset
 
- Public Attributes inherited from Linker::SegmentManager
offset_t current_base = 0
 The base address of the current section.
 
std::vector< std::shared_ptr< Segment > > segment_vector
 Ordered sequence of segments.
 
std::map< std::string, std::shared_ptr< Segment > > segment_map
 Map of segments from their names.
 
std::shared_ptr< Segmentcurrent_segment
 Currently processed segment.
 
std::map< std::string, Locationlinker_parameters
 Parameters that permit customizing the linker script.
 
std::string linker_script
 Contents of the linker script.
 

Static Public Attributes

static constexpr uint8_t EI_OSABI = 7
 
static constexpr uint8_t EI_ABIVERSION = 8
 
static constexpr uint8_t EI_CLASS = 4
 
static constexpr uint8_t EI_DATA = 5
 
static constexpr uint8_t ELFCLASSNONE = 0
 
static constexpr uint8_t ELFCLASS32 = 1
 
static constexpr uint8_t ELFCLASS64 = 2
 
static constexpr uint8_t ELFDATANONE = 0
 
static constexpr uint8_t ELFDATA2LSB = 1
 
static constexpr uint8_t ELFDATA2MSB = 2
 
static constexpr uint8_t EV_NONE = 0
 
static constexpr uint8_t EV_CURRENT = 1
 
static constexpr uint8_t ELFOSABI_NONE = 0
 
static constexpr offset_t SHF_WRITE = 0x0001
 
static constexpr offset_t SHF_ALLOC = 0x0002
 
static constexpr offset_t SHF_EXECINSTR = 0x0004
 
static constexpr offset_t SHF_MERGE = 0x0010
 
static constexpr offset_t SHF_STRINGS = 0x0020
 
static constexpr offset_t SHF_INFO_LINK = 0x0040
 
static constexpr offset_t SHF_LINK_ORDER = 0x0080
 
static constexpr offset_t SHF_OS_NONCONFORMING = 0x0100
 
static constexpr offset_t SHF_GROUP = 0x0200
 
static constexpr offset_t SHF_TLS = 0x0400
 
static constexpr offset_t SHF_COMPRESSED = 0x0800
 
static constexpr offset_t SHF_GNU_RETAIN = 0x00200000
 
static constexpr offset_t SHF_GNU_MBIND = 0x01000000
 
static constexpr offset_t SHF_EXCLUDE = 0x80000000
 
static constexpr offset_t SHF_BEGIN = 0x01000000
 
static constexpr offset_t SHF_END = 0x02000000
 
static constexpr uint16_t SHN_UNDEF = 0
 
static constexpr uint16_t SHN_LORESERVE = 0xFF00
 
static constexpr uint16_t SHN_ABS = 0xFFF1
 
static constexpr uint16_t SHN_COMMON = 0xFFF2
 
static constexpr uint16_t SHN_XINDEX = 0xFFFF
 
static constexpr uint8_t STB_LOCAL = 0
 
static constexpr uint8_t STB_GLOBAL = 1
 
static constexpr uint8_t STB_WEAK = 2
 
static constexpr uint8_t STB_ENTRY = 12
 
static constexpr uint8_t STT_NOTYPE = 0
 
static constexpr uint8_t STT_OBJECT = 1
 
static constexpr uint8_t STT_FUNC = 2
 
static constexpr uint8_t STT_SECTION = 3
 
static constexpr uint8_t STT_FILE = 4
 
static constexpr uint8_t STT_COMMON = 5
 
static constexpr uint8_t STT_TLS = 6
 
static constexpr uint8_t STT_IMPORT = 11
 
static constexpr uint8_t STV_DEFAULT = 0
 
static constexpr uint8_t STV_INTERNAL = 1
 
static constexpr uint8_t STV_HIDDEN = 2
 
static constexpr uint8_t STV_PROTECTED = 3
 
static constexpr offset_t R_386_8 = 22
 
static constexpr offset_t R_386_PC8 = 23
 
static constexpr offset_t R_386_16 = 20
 
static constexpr offset_t R_386_PC16 = 21
 
static constexpr offset_t R_386_32 = 1
 
static constexpr offset_t R_386_PC32 = 2
 
static constexpr offset_t R_386_SEG16 = 45
 Extension, see here: https://gitlab.com/tkchia/build-ia16/-/blob/master/elf16-writeup.md (not yet implemented)
 
static constexpr offset_t R_386_SUB16 = 46
 Extension, see here: https://gitlab.com/tkchia/build-ia16/-/blob/master/elf16-writeup.md (not yet implemented)
 
static constexpr offset_t R_386_SUB32 = 47
 Extension, see here: https://gitlab.com/tkchia/build-ia16/-/blob/master/elf16-writeup.md (not yet implemented)
 
static constexpr offset_t R_386_SEGRELATIVE = 48
 Extension, see here: https://gitlab.com/tkchia/build-ia16/-/blob/master/elf16-writeup.md (not yet implemented)
 
static constexpr offset_t R_386_OZSEG16 = 80
 Extension, see here: https://gitlab.com/tkchia/build-ia16/-/blob/master/elf16-writeup.md (not yet implemented)
 
static constexpr offset_t R_386_OZRELSEG16 = 81
 Extension, see here: https://gitlab.com/tkchia/build-ia16/-/blob/master/elf16-writeup.md (not yet implemented)
 
static constexpr offset_t R_68K_8 = 3
 
static constexpr offset_t R_68K_PC8 = 6
 
static constexpr offset_t R_68K_16 = 2
 
static constexpr offset_t R_68K_PC16 = 5
 
static constexpr offset_t R_68K_32 = 1
 
static constexpr offset_t R_68K_PC32 = 4
 
static constexpr offset_t R_ARM_ABS8 = 8
 
static constexpr offset_t R_ARM_ABS16 = 16
 
static constexpr offset_t R_ARM_ABS32 = 2
 
static constexpr offset_t R_ARM_REL32 = 3
 
static constexpr offset_t R_ARM_CALL = 28
 
static constexpr offset_t R_ARM_JUMP24 = 29
 
static constexpr offset_t R_ARM_PC24 = 1
 
static constexpr offset_t R_ARM_V4BX = 40
 
static constexpr offset_t DT_NULL = 0
 
static constexpr offset_t DT_NEEDED = 1
 
static constexpr offset_t DT_PLTRELSZ = 2
 
static constexpr offset_t DT_PLTGOT = 3
 
static constexpr offset_t DT_HASH = 4
 
static constexpr offset_t DT_STRTAB = 5
 
static constexpr offset_t DT_SYMTAB = 6
 
static constexpr offset_t DT_RELA = 7
 
static constexpr offset_t DT_RELASZ = 8
 
static constexpr offset_t DT_RELAENT = 9
 
static constexpr offset_t DT_STRSZ = 10
 
static constexpr offset_t DT_SYMENT = 11
 
static constexpr offset_t DT_INIT = 12
 
static constexpr offset_t DT_FINI = 13
 
static constexpr offset_t DT_SONAME = 14
 
static constexpr offset_t DT_RPATH = 15
 
static constexpr offset_t DT_SYMBOLIC = 16
 
static constexpr offset_t DT_REL = 17
 
static constexpr offset_t DT_RELSZ = 18
 
static constexpr offset_t DT_RELENT = 19
 
static constexpr offset_t DT_PLTREL = 20
 
static constexpr offset_t DT_DEBUG = 21
 
static constexpr offset_t DT_TEXTREL = 22
 
static constexpr offset_t DT_JMPREL = 23
 
static constexpr offset_t DT_BIND_NOW = 24
 
static constexpr offset_t DT_INIT_ARRAY = 25
 
static constexpr offset_t DT_FINI_ARRAY = 26
 
static constexpr offset_t DT_INIT_ARRAYSZ = 27
 
static constexpr offset_t DT_FINI_ARRAYSZ = 28
 
static constexpr offset_t DT_RUNPATH = 29
 
static constexpr offset_t DT_FLAGS = 30
 
static constexpr offset_t DT_ENCODING = 31
 
static constexpr offset_t DT_PREINIT_ARRAY = 32
 
static constexpr offset_t DT_PREINIT_ARRAYSZ = 33
 
static constexpr offset_t DT_SYMTAB_SHNDX = 34
 
static constexpr offset_t DT_RELRSZ = 35
 
static constexpr offset_t DT_RELR = 36
 
static constexpr offset_t DT_RELRENT = 37
 
static constexpr offset_t DT_EXPORT = 0x60000001
 
static constexpr offset_t DT_EXPORTSZ = 0x60000002
 
static constexpr offset_t DT_EXPENT = 0x60000003
 
static constexpr offset_t DT_IMPORT = 0x60000004
 
static constexpr offset_t DT_IMPORTSZ = 0x60000005
 
static constexpr offset_t DT_IMPENT = 0x60000006
 
static constexpr offset_t DT_IT = 0x60000007
 
static constexpr offset_t DT_ITPRTY = 0x60000008
 
static constexpr offset_t DT_INITTERM = 0x60000009
 
static constexpr offset_t DT_STACKSZ = 0x6000000A
 
static constexpr offset_t DT_GNU_FLAGS1 = 0x6FFFFDF4
 
static constexpr offset_t DT_GNU_PRELINKED = 0x6FFFFDF5
 
static constexpr offset_t DT_GNU_CONFLICTSZ = 0x6FFFFDF6
 
static constexpr offset_t DT_GNU_LIBLISTSZ = 0x6FFFFDF7
 
static constexpr offset_t DT_CHECKSUM = 0x6FFFFDF8
 
static constexpr offset_t DT_PLTPADSZ = 0x6FFFFDF9
 
static constexpr offset_t DT_MOVEENT = 0x6FFFFDFA
 
static constexpr offset_t DT_MOVESZ = 0x6FFFFDFB
 
static constexpr offset_t DT_FEATURE = 0x6FFFFDFC
 
static constexpr offset_t DT_POSTFLAG_1 = 0x6FFFFDFD
 
static constexpr offset_t DT_SYMINSZ = 0x6FFFFDFE
 
static constexpr offset_t DT_SYMINENT = 0x6FFFFDFF
 
static constexpr offset_t DT_GNU_HASH = 0x6FFFFEF5
 
static constexpr offset_t DT_TLSDESC_PLT = 0x6FFFFEF6
 
static constexpr offset_t DT_TLSDESC_GOT = 0x6FFFFEF7
 
static constexpr offset_t DT_GNU_CONFLICT = 0x6FFFFFEF8
 
static constexpr offset_t DT_GNU_LIBLIST = 0x6FFFFEF9
 
static constexpr offset_t DT_CONFIG = 0x6FFFFEFA
 
static constexpr offset_t DT_DEPAUDIT = 0x6FFFFEFB
 
static constexpr offset_t DT_AUDIT = 0x6FFFFEFC
 
static constexpr offset_t DT_PLTPAD = 0x6FFFFEFD
 
static constexpr offset_t DT_MOVETAB = 0x6FFFFEFE
 
static constexpr offset_t DT_SYMINFO = 0x6FFFFEFF
 
static constexpr offset_t DT_VERSYM = 0x6FFFFFF0
 
static constexpr offset_t DT_RELACOUNT = 0x6FFFFFF9
 
static constexpr offset_t DT_RELCOUNT = 0x6FFFFFFA
 
static constexpr offset_t DT_FLAGS_1 = 0x6FFFFFFB
 
static constexpr offset_t DT_VERDEF = 0x6FFFFFFC
 
static constexpr offset_t DT_VERDEFNUM = 0x6FFFFFFD
 
static constexpr offset_t DT_VERNEED = 0x6FFFFFFE
 
static constexpr offset_t DT_VERNEEDNUM = 0x6FFFFFFF
 
static constexpr offset_t DT_AUXILIARY = 0x7FFFFFFD
 
static constexpr offset_t DT_USED = 0x7FFFFFFE
 
static constexpr offset_t DT_FILTER = 0x7FFFFFFFF
 

Additional Inherited Members

- Protected Attributes inherited from Linker::SegmentManager
offset_t current_address = 0
 Holds the current address value when there is no current_segment.
 
bool current_is_template = false
 
bool current_is_template_head = false
 
offset_t template_counter = 0
 
std::string current_template_name
 

Detailed Description

ELF object and executable format.

The latest and most widespread file format, developed for the UNIX operating system.

Member Function Documentation

◆ CalculateValues()

void ELFFormat::CalculateValues ( )
overridevirtual

Intermediate step between processing module and generating output file to set up headers and management sections It is expected that after a module is processed, additional steps are required to evaluate the final values of the fields.

Reimplemented from Linker::OutputFormat.

◆ Dump()

void ELFFormat::Dump ( Dumper::Dumper & dump) const
overridevirtual

Display file contents in a nice manner.

Reimplemented from Linker::Format.

◆ GenerateModule()

void ELFFormat::GenerateModule ( Linker::Module & module) const
overridevirtual

Loads the information into a module object, a convenience method when there is a single module generated.

Reimplemented from Linker::InputFormat.

◆ ReadFile()

void ELFFormat::ReadFile ( Linker::Reader & rd)
overridevirtual

Loads file into memory.

Implements Linker::Format.

◆ SetupOptions()

void ELFFormat::SetupOptions ( std::shared_ptr< Linker::OutputFormat > format)
overridevirtual

Initializes the reader for linking purposes.

Parameters
formatThe output format that will be used. This is required to know which extra special features need to be implemented (such as segmentation).

Reimplemented from Linker::InputFormat.

◆ WriteFile()

offset_t ELFFormat::WriteFile ( Linker::Writer & wr) const
overridevirtual

Stores data in memory to file.

Implements Linker::Format.


The documentation for this class was generated from the following files: