ELF bootable image.
Definition in file elfboot.c.
| static int elfboot_probe |
( |
struct image * |
image | ) |
|
|
static |
Probe ELF image.
- Parameters
-
- Return values
-
Definition at line 111 of file elfboot.c.
113 static const uint8_t e_ident[] = {
127 if (
image->
len < sizeof ( *ehdr ) ) {
128 DBGC (
image,
"ELF %s too short for ELF header\n",
133 if (
memcmp ( ehdr->
e_ident, e_ident, sizeof ( e_ident ) ) != 0 ) {
140 &entry, &
max ) ) != 0 ) {
141 DBGC (
image,
"ELF %s is not loadable: %s\n",
static int elfboot_check_segment(struct image *image, const Elf_Phdr *phdr, physaddr_t dest)
Check that ELF segment uses flat physical addressing.
struct arbelprm_rc_send_wqe rc
const void * data
Read-only data.
#define ENOEXEC
Exec format error.
int elf_segments(struct image *image, const Elf_Ehdr *ehdr, int(*process)(struct image *image, const Elf_Phdr *phdr, physaddr_t dest), physaddr_t *entry, physaddr_t *max)
Process ELF segments.
unsigned char e_ident[EI_NIDENT]
char * strerror(int errno)
Retrieve string representation of error number.
size_t len
Length of raw file image.
int memcmp(const void *first, const void *second, size_t len)
Compare memory regions.
References image::data, DBGC, Elf32_Ehdr::e_ident, EI_CLASS, EI_DATA, EI_MAG0, EI_MAG1, EI_MAG2, EI_MAG3, EI_VERSION, elf_segments(), elfboot_check_segment(), ELFCLASS32, ELFDATA2LSB, ELFMAG0, ELFMAG1, ELFMAG2, ELFMAG3, ENOEXEC, EV_CURRENT, image::len, max, memcmp(), image::name, rc, and strerror().