ELF image format.
Definition in file elf.h.
Process ELF segments.
- Parameters
-
image | ELF file |
ehdr | ELF executable header |
process | Segment processor |
- Return values
-
entry | Entry point, if found |
max | Maximum used address |
rc | Return status code |
Definition at line 154 of file elf.c.
173 DBGC (
image,
"ELF %p program header %d outside " 174 "image\n",
image, phnum );
179 entry,
max ) ) != 0 )
185 DBGC (
image,
"ELF %p entry point %lx outside image\n",
struct arbelprm_rc_send_wqe rc
userptr_t data
Raw file image.
#define ENOEXEC
Exec format error.
static __always_inline void copy_from_user(void *dest, userptr_t src, off_t src_off, size_t len)
Copy data from user buffer.
size_t len
Length of raw file image.
static int elf_segment(struct image *image, Elf_Ehdr *ehdr, Elf_Phdr *phdr, int(*process)(struct image *image, Elf_Phdr *phdr, physaddr_t dest), physaddr_t *entry, physaddr_t *max)
Process ELF segment.
References copy_from_user(), image::data, DBGC, Elf32_Ehdr::e_entry, Elf32_Ehdr::e_phentsize, Elf32_Ehdr::e_phnum, Elf32_Ehdr::e_phoff, elf_segment(), ENOEXEC, image::len, max, and rc.
Referenced by elf_load(), and elfboot_probe().
Load ELF image into memory.
- Parameters
-
- Return values
-
entry | Entry point |
max | Maximum used address |
rc | Return status code |
Definition at line 201 of file elf.c.
202 static const uint8_t e_ident[] = {
215 sizeof ( e_ident ) ) != 0 ) {
222 entry,
max ) ) != 0 )
struct arbelprm_rc_send_wqe rc
userptr_t data
Raw file image.
#define ENOEXEC
Exec format error.
static __always_inline void copy_from_user(void *dest, userptr_t src, off_t src_off, size_t len)
Copy data from user buffer.
static int elf_load_segment(struct image *image, Elf_Phdr *phdr, physaddr_t dest)
Load ELF segment into memory.
unsigned char e_ident[EI_NIDENT]
int elf_segments(struct image *image, Elf_Ehdr *ehdr, int(*process)(struct image *image, Elf_Phdr *phdr, physaddr_t dest), physaddr_t *entry, physaddr_t *max)
Process ELF segments.
int memcmp(const void *first, const void *second, size_t len)
Compare memory regions.
References copy_from_user(), image::data, DBGC, Elf32_Ehdr::e_ident, EI_CLASS, EI_MAG0, EI_MAG1, EI_MAG2, EI_MAG3, elf_load_segment(), elf_segments(), ELFCLASS, ELFMAG0, ELFMAG1, ELFMAG2, ELFMAG3, ENOEXEC, max, memcmp(), and rc.
Referenced by elfboot_exec(), and multiboot_load_elf().