Go to the source code of this file.
Data Structures | |
| struct | Elf32_Ehdr |
| struct | Elf64_Ehdr |
| struct | elf32_phdr |
| struct | elf64_phdr |
| struct | Elf32_Shdr |
| struct | Elf64_Shdr |
| struct | Elf32_Rel |
| struct | Elf64_Rel |
| struct | Elf32_Rela |
| struct | elf64_rela |
| struct | Elf32_Sym |
| struct | elf64_sym |
| struct | elf32_info |
| struct | elf64_info |
Macros | |
| #define | EI_NIDENT 16 |
| #define | ET_NONE 0 |
| #define | ET_REL 1 /* Re-locatable file */ |
| #define | ET_EXEC 2 /* Executable file */ |
| #define | ET_DYN 3 /* Shared object file */ |
| #define | ET_CORE 4 /* Core file */ |
| #define | ET_LOOS 0xfe00 /* Operating system-specific */ |
| #define | ET_HIOS 0xfeff /* Operating system-specific */ |
| #define | ET_LOPROC 0xff00 /* remote_proc-specific */ |
| #define | ET_HIPROC 0xffff /* remote_proc-specific */ |
| #define | EM_ARM 40 /* ARM/Thumb Architecture */ |
| #define | EV_CURRENT 1 /* Current version */ |
| #define | EI_MAG0 0 /* File identification */ |
| #define | EI_MAG1 1 /* File identification */ |
| #define | EI_MAG2 2 /* File identification */ |
| #define | EI_MAG3 3 /* File identification */ |
| #define | EI_CLASS 4 /* File class */ |
| #define | EI_DATA 5 /* Data encoding */ |
| #define | EI_VERSION 6 /* File version */ |
| #define | EI_OSABI 7 /* Operating system/ABI identification */ |
| #define | EI_ABIVERSION 8 /* ABI version */ |
| #define | EI_PAD 9 /* Start of padding bytes */ |
| #define | EI_NIDENT 16 /* Size of e_ident[] */ |
| #define | ELFMAG0 0x7f /* e_ident[EI_MAG0] */ |
| #define | ELFMAG1 'E' /* e_ident[EI_MAG1] */ |
| #define | ELFMAG2 'L' /* e_ident[EI_MAG2] */ |
| #define | ELFMAG3 'F' /* e_ident[EI_MAG3] */ |
| #define | ELFMAG "\177ELF" |
| #define | SELFMAG 4 |
| #define | ELFCLASSNONE 0 /* Invalid class */ |
| #define | ELFCLASS32 1 /* 32-bit objects */ |
| #define | ELFCLASS64 2 /* 64-bit objects */ |
| #define | ELFDATANONE 0 /* Invalid data encoding */ |
| #define | ELFDATA2LSB 1 /* See Data encodings, below */ |
| #define | ELFDATA2MSB 2 /* See Data encodings, below */ |
| #define | ELFOSABI_NONE 0 |
| #define | PT_NULL 0 |
| #define | PT_LOAD 1 |
| #define | PT_DYNAMIC 2 |
| #define | PT_INTERP 3 |
| #define | PT_NOTE 4 |
| #define | PT_SHLIB 5 |
| #define | PT_PHDR 6 |
| #define | PT_TLS 7 /* Thread local storage segment */ |
| #define | PT_LOOS 0x60000000 /* OS-specific */ |
| #define | PT_HIOS 0x6fffffff /* OS-specific */ |
| #define | PT_LOPROC 0x70000000 |
| #define | PT_HIPROC 0x7fffffff |
| #define | SHT_NULL 0 |
| #define | SHT_PROGBITS 1 |
| #define | SHT_SYMTAB 2 |
| #define | SHT_STRTAB 3 |
| #define | SHT_RELA 4 |
| #define | SHT_HASH 5 |
| #define | SHT_DYNAMIC 6 |
| #define | SHT_NOTE 7 |
| #define | SHT_NOBITS 8 |
| #define | SHT_REL 9 |
| #define | SHT_SHLIB 10 |
| #define | SHT_DYNSYM 11 |
| #define | SHT_INIT_ARRAY 14 |
| #define | SHT_FINI_ARRAY 15 |
| #define | SHT_PREINIT_ARRAY 16 |
| #define | SHT_GROUP 17 |
| #define | SHT_SYMTAB_SHNDX 18 |
| #define | SHT_LOOS 0x60000000 |
| #define | SHT_HIOS 0x6fffffff |
| #define | SHT_LOPROC 0x70000000 |
| #define | SHT_HIPROC 0x7fffffff |
| #define | SHT_LOUSER 0x80000000 |
| #define | SHT_HIUSER 0xffffffff |
| #define | SHF_WRITE 0x1 |
| #define | SHF_ALLOC 0x2 |
| #define | SHF_EXECINSTR 0x4 |
| #define | SHF_MASKPROC 0xf0000000 |
| #define | ELF32_R_SYM(i) ((i) >> 8) |
| #define | ELF32_R_TYPE(i) ((unsigned char)(i)) |
| #define | ELF64_R_SYM(i) ((i) >> 32) |
| #define | ELF64_R_TYPE(i) ((i) & 0xffffffff) |
| #define | R_ARM_GLOB_DAT 21 /* 0x15 */ |
| #define | R_ARM_JUMP_SLOT 22 /* 0x16 */ |
| #define | R_ARM_RELATIVE 23 /* 0x17 */ |
| #define | R_ARM_ABS32 2 /* 0x02 */ |
| #define | ELF_STATE_INIT 0x0L |
| #define | ELF_STATE_WAIT_FOR_PHDRS 0x100L |
| #define | ELF_STATE_WAIT_FOR_SHDRS 0x200L |
| #define | ELF_STATE_WAIT_FOR_SHSTRTAB 0x400L |
| #define | ELF_STATE_HDRS_COMPLETE 0x800L |
| #define | ELF_STATE_MASK 0xFF00L |
| #define | ELF_NEXT_SEGMENT_MASK 0x00FFL |
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 uint64_t | Elf64_Addr |
| typedef uint16_t | Elf64_Half |
| typedef uint64_t | Elf64_Off |
| typedef int32_t | Elf64_Sword |
| typedef uint32_t | Elf64_Word |
| typedef uint64_t | Elf64_Xword |
| typedef int64_t | Elf64_Sxword |
| typedef struct elf32_phdr | Elf32_Phdr |
| typedef struct elf64_phdr | Elf64_Phdr |
| typedef struct elf64_rela | Elf64_Rela |
| typedef struct elf64_sym | Elf64_Sym |
Functions | |
| int | elf_identify (const void *img_data, size_t len) |
| int | elf_load_header (const void *img_data, size_t offset, size_t len, void **img_info, int last_load_state, size_t *noffset, size_t *nlen) |
| int | elf_load (struct remoteproc *rproc, const void *img_data, size_t offset, size_t len, void **img_info, int last_load_state, metal_phys_addr_t *da, size_t *noffset, size_t *nlen, unsigned char *padding, size_t *nmemsize) |
| void | elf_release (void *img_info) |
| metal_phys_addr_t | elf_get_entry (void *img_info) |
| int | elf_locate_rsc_table (void *img_info, metal_phys_addr_t *da, size_t *offset, size_t *size) |
Variables | |
| const struct loader_ops | elf_ops |
| #define EI_ABIVERSION 8 /* ABI version */ |
| #define EI_CLASS 4 /* File class */ |
| #define EI_DATA 5 /* Data encoding */ |
| #define EI_MAG0 0 /* File identification */ |
| #define EI_MAG1 1 /* File identification */ |
| #define EI_MAG2 2 /* File identification */ |
| #define EI_MAG3 3 /* File identification */ |
| #define EI_NIDENT 16 |
| #define EI_NIDENT 16 /* Size of e_ident[] */ |
| #define EI_OSABI 7 /* Operating system/ABI identification */ |
| #define EI_PAD 9 /* Start of padding bytes */ |
| #define EI_VERSION 6 /* File version */ |
| #define ELF32_R_SYM | ( | i | ) | ((i) >> 8) |
| #define ELF32_R_TYPE | ( | i | ) | ((unsigned char)(i)) |
| #define ELF64_R_SYM | ( | i | ) | ((i) >> 32) |
| #define ELF64_R_TYPE | ( | i | ) | ((i) & 0xffffffff) |
| #define ELF_NEXT_SEGMENT_MASK 0x00FFL |
| #define ELF_STATE_HDRS_COMPLETE 0x800L |
| #define ELF_STATE_INIT 0x0L |
| #define ELF_STATE_MASK 0xFF00L |
| #define ELF_STATE_WAIT_FOR_PHDRS 0x100L |
| #define ELF_STATE_WAIT_FOR_SHDRS 0x200L |
| #define ELF_STATE_WAIT_FOR_SHSTRTAB 0x400L |
| #define ELFCLASS32 1 /* 32-bit objects */ |
| #define ELFCLASS64 2 /* 64-bit objects */ |
| #define ELFCLASSNONE 0 /* Invalid class */ |
| #define ELFDATA2LSB 1 /* See Data encodings, below */ |
| #define ELFDATA2MSB 2 /* See Data encodings, below */ |
| #define ELFDATANONE 0 /* Invalid data encoding */ |
| #define ELFMAG "\177ELF" |
| #define ELFMAG0 0x7f /* e_ident[EI_MAG0] */ |
| #define ELFMAG1 'E' /* e_ident[EI_MAG1] */ |
| #define ELFMAG2 'L' /* e_ident[EI_MAG2] */ |
| #define ELFMAG3 'F' /* e_ident[EI_MAG3] */ |
| #define ELFOSABI_NONE 0 |
| #define EM_ARM 40 /* ARM/Thumb Architecture */ |
| #define ET_CORE 4 /* Core file */ |
| #define ET_DYN 3 /* Shared object file */ |
| #define ET_EXEC 2 /* Executable file */ |
| #define ET_HIOS 0xfeff /* Operating system-specific */ |
| #define ET_HIPROC 0xffff /* remote_proc-specific */ |
| #define ET_LOOS 0xfe00 /* Operating system-specific */ |
| #define ET_LOPROC 0xff00 /* remote_proc-specific */ |
| #define ET_NONE 0 |
| #define ET_REL 1 /* Re-locatable file */ |
| #define EV_CURRENT 1 /* Current version */ |
| #define PT_DYNAMIC 2 |
| #define PT_HIOS 0x6fffffff /* OS-specific */ |
| #define PT_HIPROC 0x7fffffff |
| #define PT_INTERP 3 |
| #define PT_LOAD 1 |
| #define PT_LOOS 0x60000000 /* OS-specific */ |
| #define PT_LOPROC 0x70000000 |
| #define PT_NOTE 4 |
| #define PT_NULL 0 |
| #define PT_PHDR 6 |
| #define PT_SHLIB 5 |
| #define PT_TLS 7 /* Thread local storage segment */ |
| #define R_ARM_ABS32 2 /* 0x02 */ |
| #define R_ARM_GLOB_DAT 21 /* 0x15 */ |
| #define R_ARM_JUMP_SLOT 22 /* 0x16 */ |
| #define R_ARM_RELATIVE 23 /* 0x17 */ |
| #define SELFMAG 4 |
| #define SHF_ALLOC 0x2 |
| #define SHF_EXECINSTR 0x4 |
| #define SHF_MASKPROC 0xf0000000 |
| #define SHF_WRITE 0x1 |
| #define SHT_DYNAMIC 6 |
| #define SHT_DYNSYM 11 |
| #define SHT_FINI_ARRAY 15 |
| #define SHT_GROUP 17 |
| #define SHT_HASH 5 |
| #define SHT_HIOS 0x6fffffff |
| #define SHT_HIPROC 0x7fffffff |
| #define SHT_HIUSER 0xffffffff |
| #define SHT_INIT_ARRAY 14 |
| #define SHT_LOOS 0x60000000 |
| #define SHT_LOPROC 0x70000000 |
| #define SHT_LOUSER 0x80000000 |
| #define SHT_NOBITS 8 |
| #define SHT_NOTE 7 |
| #define SHT_NULL 0 |
| #define SHT_PREINIT_ARRAY 16 |
| #define SHT_PROGBITS 1 |
| #define SHT_REL 9 |
| #define SHT_RELA 4 |
| #define SHT_SHLIB 10 |
| #define SHT_STRTAB 3 |
| #define SHT_SYMTAB 2 |
| #define SHT_SYMTAB_SHNDX 18 |
| typedef uint32_t Elf32_Addr |
| typedef uint16_t Elf32_Half |
| typedef uint32_t Elf32_Off |
| typedef struct elf32_phdr Elf32_Phdr |
| typedef int32_t Elf32_Sword |
| typedef uint32_t Elf32_Word |
| typedef uint64_t Elf64_Addr |
| typedef uint16_t Elf64_Half |
| typedef uint64_t Elf64_Off |
| typedef struct elf64_phdr Elf64_Phdr |
| typedef struct elf64_rela Elf64_Rela |
| typedef int32_t Elf64_Sword |
| typedef int64_t Elf64_Sxword |
| typedef uint32_t Elf64_Word |
| typedef uint64_t Elf64_Xword |
| metal_phys_addr_t elf_get_entry | ( | void * | img_info | ) |
| int elf_identify | ( | const void * | img_data, |
| size_t | len | ||
| ) |
| int elf_load | ( | struct remoteproc * | rproc, |
| const void * | img_data, | ||
| size_t | offset, | ||
| size_t | len, | ||
| void ** | img_info, | ||
| int | last_load_state, | ||
| metal_phys_addr_t * | da, | ||
| size_t * | noffset, | ||
| size_t * | nlen, | ||
| unsigned char * | padding, | ||
| size_t * | nmemsize | ||
| ) |
| int elf_load_header | ( | const void * | img_data, |
| size_t | offset, | ||
| size_t | len, | ||
| void ** | img_info, | ||
| int | last_load_state, | ||
| size_t * | noffset, | ||
| size_t * | nlen | ||
| ) |
| int elf_locate_rsc_table | ( | void * | img_info, |
| metal_phys_addr_t * | da, | ||
| size_t * | offset, | ||
| size_t * | size | ||
| ) |
| void elf_release | ( | void * | img_info | ) |
|
extern |