The Pedigree Project 0.1
Classes | Macros | Typedefs | Functions
linker

the kernel linker More...

+ Collaboration diagram for linker:

Classes

class  Elf
 
class  Module
 
class  KernelElf
 

Macros

#define DEBUG   NOTICE
 
#define ET_NONE   0x0
 
#define ET_REL   0x1
 
#define ET_EXEC   0x2
 
#define ET_DYN   0x3
 
#define ET_CORE   0x4
 
#define SHT_PROGBITS   0x1
 
#define SHT_SYMTAB   0x2
 
#define SHT_STRTAB   0x3
 
#define SHT_RELA   0x4
 
#define SHT_HASH   0x5
 
#define SHT_DYNAMIC   0x6
 
#define SHT_NOTE   0x7
 
#define SHT_NOBITS   0x8
 
#define SHT_REL   0x9
 
#define SHT_DYNSYM   0xb
 
#define SHT_INIT_ARRAY   0xe
 
#define SHT_FINI_ARRAY   0xf
 
#define SHT_PREINIT_ARRAY   0x10
 
#define SHF_WRITE   0x1
 
#define SHF_ALLOC   0x2
 
#define SHF_EXECINSTR   0x4
 
#define SHF_MASKPROC   0xf0000000
 
#define PF_X   0x1
 
#define PF_W   0x2
 
#define PF_R   0x4
 
#define PT_NULL   0 /* Program header table entry unused */
 
#define PT_LOAD   1 /* Loadable program segment */
 
#define PT_DYNAMIC   2 /* Dynamic linking information */
 
#define PT_INTERP   3 /* Program interpreter */
 
#define PT_NOTE   4 /* Auxiliary information */
 
#define PT_SHLIB   5 /* Reserved */
 
#define PT_PHDR   6 /* Entry for header table itself */
 
#define PT_TLS   7 /* Thread-local storage segment */
 
#define PT_NUM   8 /* Number of defined types */
 
#define DT_NULL   0 /* Marks end of dynamic section */
 
#define DT_NEEDED   1 /* Name of needed library */
 
#define DT_PLTRELSZ   2 /* Size in bytes of PLT relocs */
 
#define DT_PLTGOT   3 /* Processor defined value */
 
#define DT_HASH   4 /* Address of symbol hash table */
 
#define DT_STRTAB   5 /* Address of string table */
 
#define DT_SYMTAB   6 /* Address of symbol table */
 
#define DT_RELA   7 /* Address of Rela relocs */
 
#define DT_RELASZ   8 /* Total size of Rela relocs */
 
#define DT_RELAENT   9 /* Size of one Rela reloc */
 
#define DT_STRSZ   10 /* Size of string table */
 
#define DT_SYMENT   11 /* Size of one symbol table entry */
 
#define DT_INIT   12 /* Address of init function */
 
#define DT_FINI   13 /* Address of termination function */
 
#define DT_SONAME   14 /* Name of shared object */
 
#define DT_RPATH   15 /* Library search path (deprecated) */
 
#define DT_SYMBOLIC   16 /* Start symbol search here */
 
#define DT_REL   17 /* Address of Rel relocs */
 
#define DT_RELSZ   18 /* Total size of Rel relocs */
 
#define DT_RELENT   19 /* Size of one Rel reloc */
 
#define DT_PLTREL   20 /* Type of reloc in PLT */
 
#define DT_DEBUG   21 /* For debugging; unspecified */
 
#define DT_TEXTREL   22 /* Reloc might modify .text */
 
#define DT_JMPREL   23 /* Address of PLT relocs */
 
#define DT_BIND_NOW   24 /* Process relocations of object */
 
#define DT_INIT_ARRAY   25 /* Array with addresses of init fct */
 
#define DT_FINI_ARRAY   26 /* Array with addresses of fini fct */
 
#define DT_INIT_ARRAYSZ   27 /* Size in bytes of DT_INIT_ARRAY */
 
#define DT_FINI_ARRAYSZ   28 /* Size in bytes of DT_FINI_ARRAY */
 
#define DT_RUNPATH   29 /* Library search path */
 
#define DT_FLAGS   30 /* Flags for the object being loaded */
 
#define DT_ENCODING   32 /* Start of encoded range */
 
#define DT_PREINIT_ARRAY   32 /* Array with addresses of preinit fct*/
 
#define DT_PREINIT_ARRAYSZ   33 /* size in bytes of DT_PREINIT_ARRAY */
 
#define STT_NOTYPE   0
 
#define STT_OBJECT   1
 
#define STT_FUNC   2
 
#define STT_SECTION   3
 
#define STT_FILE   4
 
#define STT_COMMON   5
 
#define STT_TLS   6
 
#define STB_LOCAL   0
 
#define STB_GLOBAL   1
 
#define STB_WEAK   2
 
#define STV_DEFAULT   0
 
#define STV_INTERNAL   1
 
#define STV_HIDDEN   2
 
#define STV_PROTECTED   3
 
#define R_SYM(val)   ((val) >> 32)
 
#define R_TYPE(val)   ((val) & 0xffffffffUL)
 
#define ST_BIND(i)   ((i) >> 4)
 
#define ST_TYPE(i)   ((i) & 0xf)
 
#define ST_INFO(b, t)   (((b) << 4) + ((t) & 0xf))
 
#define ST_TYPEOK(x)   (ST_TYPE((x)) <= STT_FUNC)
 

Typedefs

typedef uint64_t Elf_Addr
 
typedef uint64_t Elf_Off
 
typedef uint16_t Elf_Half
 
typedef uint32_t Elf_Word
 
typedef int32_t Elf_Sword
 
typedef uint64_t Elf_Xword
 
typedef int64_t Elf_Sxword
 
typedef uint32_t Elf32_Addr
 
typedef uint32_t Elf32_Off
 
typedef uint16_t Elf32_Half
 
typedef uint32_t Elf32_Word
 
typedef int32_t Elf32_Sword
 
typedef uint32_t Elf32_Xword
 
typedef int32_t Elf32_Sxword
 

Functions

template const char * Elf::lookupSymbol< Elf::ElfSymbol_t > (uintptr_t addr, uintptr_t *startAddr=0, ElfSymbol_t *symbolTable=0)
 
template const char * Elf::lookupSymbol< Elf::Elf32Symbol_t > (uintptr_t addr, uintptr_t *startAddr=0, Elf32Symbol_t *symbolTable=0)
 

Detailed Description

the kernel linker

the kernel linker

Macro Definition Documentation

◆ DEBUG

#define DEBUG   NOTICE

Definition at line 38 of file Elf.h.

◆ DT_BIND_NOW

#define DT_BIND_NOW   24 /* Process relocations of object */

Definition at line 112 of file Elf.h.

◆ DT_DEBUG

#define DT_DEBUG   21 /* For debugging; unspecified */

Definition at line 109 of file Elf.h.

◆ DT_ENCODING

#define DT_ENCODING   32 /* Start of encoded range */

Definition at line 119 of file Elf.h.

◆ DT_FINI

#define DT_FINI   13 /* Address of termination function */

Definition at line 101 of file Elf.h.

◆ DT_FINI_ARRAY

#define DT_FINI_ARRAY   26 /* Array with addresses of fini fct */

Definition at line 114 of file Elf.h.

◆ DT_FINI_ARRAYSZ

#define DT_FINI_ARRAYSZ   28 /* Size in bytes of DT_FINI_ARRAY */

Definition at line 116 of file Elf.h.

◆ DT_FLAGS

#define DT_FLAGS   30 /* Flags for the object being loaded */

Definition at line 118 of file Elf.h.

◆ DT_HASH

#define DT_HASH   4 /* Address of symbol hash table */

Definition at line 92 of file Elf.h.

◆ DT_INIT

#define DT_INIT   12 /* Address of init function */

Definition at line 100 of file Elf.h.

◆ DT_INIT_ARRAY

#define DT_INIT_ARRAY   25 /* Array with addresses of init fct */

Definition at line 113 of file Elf.h.

◆ DT_INIT_ARRAYSZ

#define DT_INIT_ARRAYSZ   27 /* Size in bytes of DT_INIT_ARRAY */

Definition at line 115 of file Elf.h.

◆ DT_JMPREL

#define DT_JMPREL   23 /* Address of PLT relocs */

Definition at line 111 of file Elf.h.

◆ DT_NEEDED

#define DT_NEEDED   1 /* Name of needed library */

Definition at line 89 of file Elf.h.

◆ DT_NULL

#define DT_NULL   0 /* Marks end of dynamic section */

Definition at line 88 of file Elf.h.

◆ DT_PLTGOT

#define DT_PLTGOT   3 /* Processor defined value */

Definition at line 91 of file Elf.h.

◆ DT_PLTREL

#define DT_PLTREL   20 /* Type of reloc in PLT */

Definition at line 108 of file Elf.h.

◆ DT_PLTRELSZ

#define DT_PLTRELSZ   2 /* Size in bytes of PLT relocs */

Definition at line 90 of file Elf.h.

◆ DT_PREINIT_ARRAY

#define DT_PREINIT_ARRAY   32 /* Array with addresses of preinit fct*/

Definition at line 120 of file Elf.h.

◆ DT_PREINIT_ARRAYSZ

#define DT_PREINIT_ARRAYSZ   33 /* size in bytes of DT_PREINIT_ARRAY */

Definition at line 121 of file Elf.h.

◆ DT_REL

#define DT_REL   17 /* Address of Rel relocs */

Definition at line 105 of file Elf.h.

◆ DT_RELA

#define DT_RELA   7 /* Address of Rela relocs */

Definition at line 95 of file Elf.h.

◆ DT_RELAENT

#define DT_RELAENT   9 /* Size of one Rela reloc */

Definition at line 97 of file Elf.h.

◆ DT_RELASZ

#define DT_RELASZ   8 /* Total size of Rela relocs */

Definition at line 96 of file Elf.h.

◆ DT_RELENT

#define DT_RELENT   19 /* Size of one Rel reloc */

Definition at line 107 of file Elf.h.

◆ DT_RELSZ

#define DT_RELSZ   18 /* Total size of Rel relocs */

Definition at line 106 of file Elf.h.

◆ DT_RPATH

#define DT_RPATH   15 /* Library search path (deprecated) */

Definition at line 103 of file Elf.h.

◆ DT_RUNPATH

#define DT_RUNPATH   29 /* Library search path */

Definition at line 117 of file Elf.h.

◆ DT_SONAME

#define DT_SONAME   14 /* Name of shared object */

Definition at line 102 of file Elf.h.

◆ DT_STRSZ

#define DT_STRSZ   10 /* Size of string table */

Definition at line 98 of file Elf.h.

◆ DT_STRTAB

#define DT_STRTAB   5 /* Address of string table */

Definition at line 93 of file Elf.h.

◆ DT_SYMBOLIC

#define DT_SYMBOLIC   16 /* Start symbol search here */

Definition at line 104 of file Elf.h.

◆ DT_SYMENT

#define DT_SYMENT   11 /* Size of one symbol table entry */

Definition at line 99 of file Elf.h.

◆ DT_SYMTAB

#define DT_SYMTAB   6 /* Address of symbol table */

Definition at line 94 of file Elf.h.

◆ DT_TEXTREL

#define DT_TEXTREL   22 /* Reloc might modify .text */

Definition at line 110 of file Elf.h.

◆ ET_CORE

#define ET_CORE   0x4

Definition at line 48 of file Elf.h.

◆ ET_DYN

#define ET_DYN   0x3

Definition at line 47 of file Elf.h.

◆ ET_EXEC

#define ET_EXEC   0x2

Definition at line 46 of file Elf.h.

◆ ET_NONE

#define ET_NONE   0x0

Definition at line 44 of file Elf.h.

◆ ET_REL

#define ET_REL   0x1

Definition at line 45 of file Elf.h.

◆ PF_R

#define PF_R   0x4

Definition at line 74 of file Elf.h.

◆ PF_W

#define PF_W   0x2

Definition at line 73 of file Elf.h.

◆ PF_X

#define PF_X   0x1

Definition at line 72 of file Elf.h.

◆ PT_DYNAMIC

#define PT_DYNAMIC   2 /* Dynamic linking information */

Definition at line 79 of file Elf.h.

◆ PT_INTERP

#define PT_INTERP   3 /* Program interpreter */

Definition at line 80 of file Elf.h.

◆ PT_LOAD

#define PT_LOAD   1 /* Loadable program segment */

Definition at line 78 of file Elf.h.

◆ PT_NOTE

#define PT_NOTE   4 /* Auxiliary information */

Definition at line 81 of file Elf.h.

◆ PT_NULL

#define PT_NULL   0 /* Program header table entry unused */

Definition at line 77 of file Elf.h.

◆ PT_NUM

#define PT_NUM   8 /* Number of defined types */

Definition at line 85 of file Elf.h.

◆ PT_PHDR

#define PT_PHDR   6 /* Entry for header table itself */

Definition at line 83 of file Elf.h.

◆ PT_SHLIB

#define PT_SHLIB   5 /* Reserved */

Definition at line 82 of file Elf.h.

◆ PT_TLS

#define PT_TLS   7 /* Thread-local storage segment */

Definition at line 84 of file Elf.h.

◆ R_SYM

#define R_SYM (   val)    ((val) >> 32)

Definition at line 165 of file Elf.h.

◆ R_TYPE

#define R_TYPE (   val)    ((val) & 0xffffffffUL)

Definition at line 166 of file Elf.h.

◆ SHF_ALLOC

#define SHF_ALLOC   0x2

Definition at line 67 of file Elf.h.

◆ SHF_EXECINSTR

#define SHF_EXECINSTR   0x4

Definition at line 68 of file Elf.h.

◆ SHF_MASKPROC

#define SHF_MASKPROC   0xf0000000

Definition at line 69 of file Elf.h.

◆ SHF_WRITE

#define SHF_WRITE   0x1

Definition at line 66 of file Elf.h.

◆ SHT_DYNAMIC

#define SHT_DYNAMIC   0x6

Definition at line 56 of file Elf.h.

◆ SHT_DYNSYM

#define SHT_DYNSYM   0xb

Definition at line 60 of file Elf.h.

◆ SHT_FINI_ARRAY

#define SHT_FINI_ARRAY   0xf

Definition at line 62 of file Elf.h.

◆ SHT_HASH

#define SHT_HASH   0x5

Definition at line 55 of file Elf.h.

◆ SHT_INIT_ARRAY

#define SHT_INIT_ARRAY   0xe

Definition at line 61 of file Elf.h.

◆ SHT_NOBITS

#define SHT_NOBITS   0x8

Definition at line 58 of file Elf.h.

◆ SHT_NOTE

#define SHT_NOTE   0x7

Definition at line 57 of file Elf.h.

◆ SHT_PREINIT_ARRAY

#define SHT_PREINIT_ARRAY   0x10

Definition at line 63 of file Elf.h.

◆ SHT_PROGBITS

#define SHT_PROGBITS   0x1

Definition at line 51 of file Elf.h.

◆ SHT_REL

#define SHT_REL   0x9

Definition at line 59 of file Elf.h.

◆ SHT_RELA

#define SHT_RELA   0x4

Definition at line 54 of file Elf.h.

◆ SHT_STRTAB

#define SHT_STRTAB   0x3

Definition at line 53 of file Elf.h.

◆ SHT_SYMTAB

#define SHT_SYMTAB   0x2

Definition at line 52 of file Elf.h.

◆ ST_BIND

#define ST_BIND (   i)    ((i) >> 4)

Definition at line 168 of file Elf.h.

◆ ST_INFO

#define ST_INFO (   b,
  t 
)    (((b) << 4) + ((t) & 0xf))

Definition at line 170 of file Elf.h.

◆ ST_TYPE

#define ST_TYPE (   i)    ((i) & 0xf)

Definition at line 169 of file Elf.h.

◆ ST_TYPEOK

#define ST_TYPEOK (   x)    (ST_TYPE((x)) <= STT_FUNC)

Definition at line 192 of file Elf.h.

◆ STB_GLOBAL

#define STB_GLOBAL   1

Definition at line 134 of file Elf.h.

◆ STB_LOCAL

#define STB_LOCAL   0

Definition at line 133 of file Elf.h.

◆ STB_WEAK

#define STB_WEAK   2

Definition at line 135 of file Elf.h.

◆ STT_COMMON

#define STT_COMMON   5

Definition at line 129 of file Elf.h.

◆ STT_FILE

#define STT_FILE   4

Definition at line 128 of file Elf.h.

◆ STT_FUNC

#define STT_FUNC   2

Definition at line 126 of file Elf.h.

◆ STT_NOTYPE

#define STT_NOTYPE   0

Definition at line 124 of file Elf.h.

◆ STT_OBJECT

#define STT_OBJECT   1

Definition at line 125 of file Elf.h.

◆ STT_SECTION

#define STT_SECTION   3

Definition at line 127 of file Elf.h.

◆ STT_TLS

#define STT_TLS   6

Definition at line 130 of file Elf.h.

◆ STV_DEFAULT

#define STV_DEFAULT   0

Definition at line 138 of file Elf.h.

◆ STV_HIDDEN

#define STV_HIDDEN   2

Definition at line 140 of file Elf.h.

◆ STV_INTERNAL

#define STV_INTERNAL   1

Definition at line 139 of file Elf.h.

◆ STV_PROTECTED

#define STV_PROTECTED   3

Definition at line 141 of file Elf.h.

Typedef Documentation

◆ Elf32_Addr

typedef uint32_t Elf32_Addr

Definition at line 181 of file Elf.h.

◆ Elf32_Half

typedef uint16_t Elf32_Half

Definition at line 183 of file Elf.h.

◆ Elf32_Off

typedef uint32_t Elf32_Off

Definition at line 182 of file Elf.h.

◆ Elf32_Sword

typedef int32_t Elf32_Sword

Definition at line 185 of file Elf.h.

◆ Elf32_Sxword

typedef int32_t Elf32_Sxword

Definition at line 187 of file Elf.h.

◆ Elf32_Word

typedef uint32_t Elf32_Word

Definition at line 184 of file Elf.h.

◆ Elf32_Xword

typedef uint32_t Elf32_Xword

Definition at line 186 of file Elf.h.

◆ Elf_Addr

typedef uint64_t Elf_Addr

Definition at line 172 of file Elf.h.

◆ Elf_Half

typedef uint16_t Elf_Half

Definition at line 174 of file Elf.h.

◆ Elf_Off

typedef uint64_t Elf_Off

Definition at line 173 of file Elf.h.

◆ Elf_Sword

typedef int32_t Elf_Sword

Definition at line 176 of file Elf.h.

◆ Elf_Sxword

typedef int64_t Elf_Sxword

Definition at line 178 of file Elf.h.

◆ Elf_Word

typedef uint32_t Elf_Word

Definition at line 175 of file Elf.h.

◆ Elf_Xword

typedef uint64_t Elf_Xword

Definition at line 177 of file Elf.h.

Function Documentation

◆ Elf::lookupSymbol< Elf::ElfSymbol_t >()

template const char * Elf::lookupSymbol< Elf::ElfSymbol_t > ( uintptr_t  addr,
uintptr_t *  startAddr = 0,
ElfSymbol_t *  symbolTable = 0 
)
extern

External specializations for ELF symbol types.