Go to the source code of this file.
Data Structures | |||||
struct | elf32_hdr | ||||
32-bit ELF header. More... | |||||
struct | elf32_shdr | ||||
ELF32 Section header. More... | |||||
Defines | |||||
#define | EI_NIDENT 16 | ||||
Size of e_ident[]. | |||||
#define | EI_MAG0 0 | ||||
File magic number (0). | |||||
#define | EI_MAG1 1 | ||||
File magic number (1). | |||||
#define | EI_MAG2 2 | ||||
File magic number (2). | |||||
#define | EI_MAG3 3 | ||||
File magic number (3). | |||||
#define | EI_CLASS 4 | ||||
File class. | |||||
#define | EI_DATA 5 | ||||
Data encoding. | |||||
#define | EI_VERSION 6 | ||||
File version. | |||||
#define | EI_PAD 7 | ||||
Start of padding bytes. | |||||
#define | ELF_MAG0 0x7F | ||||
< ELF magic number. | |||||
#define | ELF_MAG1 'E' | ||||
< ELF magic number[0]. | |||||
#define | ELF_MAG2 'L' | ||||
ELF magic number[1]. | |||||
#define | ELF_MAG3 'F' | ||||
ELF magic number[2]. | |||||
#define | ELF_CLASSNONE 0 | ||||
Invalid class. | |||||
#define | ELF_CLASS32 1 | ||||
32-bit objects. | |||||
#define | ELF_CLASS64 2 | ||||
64-bit objects. | |||||
#define | ELF_DATANONE 0 | ||||
Invalid data encoding. | |||||
#define | ELF_DATA2LSB 1 | ||||
Least significant byte encoding. | |||||
#define | ELF_DATA2MSB 2 | ||||
Most significant byte encoding. | |||||
#define | SHT_NULL 0 | ||||
The section is inactive. | |||||
#define | SHT_PROGBITS 1 | ||||
The section holds informations defined by the program, whose format and meaning are determined solely by the program. | |||||
#define | SHT_SYMTAB 2 | ||||
The section holds a symbol table. | |||||
#define | SHT_STRTAB 3 | ||||
The section holds a string table. | |||||
#define | SHT_RELA 4 | ||||
The section holds relocation entries. | |||||
#define | SHT_HASH 5 | ||||
The section holds a symbol hash table. | |||||
#define | SHT_DYNAMIC 6 | ||||
The section holds informations for dynamic linking. | |||||
#define | SHT_NOTE 7 | ||||
The section holds informations that marks the file in some way. | |||||
#define | SHT_NOBITS 8 | ||||
A section of this type occupies no space in the file but otherwise resembles SHT_PROGBITS. Although this section contains no bytes, the sh_offset member contains the conceptual file offset. For example the ".bss" section can be considered a section of this type. | |||||
#define | SHT_REL 9 | ||||
The section holds a relocation entries without explicit addends. | |||||
#define | SHT_SHLIB 10 | ||||
This section type is reserved, but has unspecified semantics. | |||||
#define | SHT_DYNSYM 11 | ||||
This section contains a set of dynamic linking symbols. | |||||
#define | SHT_LOPROC 0x700000000 | ||||
Values in this exclusive range are reserved for processor-specific semantics. | |||||
#define | SHT_HIPROC 0x700000000 | ||||
Values in this exclusive range are reserved for processor-specific semantics. | |||||
#define | SHT_LOUSER 0x700000000 | ||||
This value specifies the lower bound of the range of indexes reserved for application programs. | |||||
#define | SHT_HIUSER 0x700000000 | ||||
This value specifies the upper bound of the range of indexes reserved for application programs. | |||||
#define | SHF_WRITE 0x1 | ||||
Data should be writable during the process execution. | |||||
#define | SHF_ALLOC 0x2 | ||||
The section occupies memory during the process execution. | |||||
#define | SHF_EXECINSTR 0x4 | ||||
The section contains executable machine instructions. | |||||
#define | SHF_MASKPROC 0xF00000000 | ||||
All bits included in this mask are reserved for processor-specific semantics. | |||||
Typedefs | |||||
typedef uint32_t | Elf32_Addr | ||||
typedef uint16_t | Elf32_Half | ||||
typedef uint32_t | Elf32_Off | ||||
typedef int32_t | Elf32_Sword | ||||
typedef uint32_t | Elf32_Word | ||||
typedef elf32_hdr | elf32_hdr_t | ||||
32-bit ELF header. | |||||
typedef elf32_shdr | elf32_shdr_t | ||||
ELF32 Section header. | |||||
Functions | |||||
uint32_t | elf32_copy_sections (elf32_hdr_t *f) | ||||
Copy the ELF32 sections at the right locations in memory.
| |||||
int | elf32_load_file (char *file_name, void *file_buffer) | ||||
Load an ELF32 file into a buffer.
| |||||
int | elf32_exec (void *f, int argc, char **argv) | ||||
Execute a file. |
Definition in file elf32.h.