elf_info
struct elfhdr *ehdr, struct kexec_elf_info *elf_info,
phdr = &elf_info->proghdrs[i];
kbuf->buffer = (void *)elf_info->buffer + phdr->p_offset;
struct kexec_elf_info elf_info;
ret = kexec_build_elf_info(kernel, kernel_len, &ehdr, &elf_info);
ret = _elf_kexec_load(image, &ehdr, &elf_info, &kbuf, &text_offset);
kexec_free_elf_info(&elf_info);
struct kexec_elf_info elf_info;
ret = kexec_build_elf_info(kernel_buf, kernel_len, &ehdr, &elf_info);
ret = kexec_elf_load(image, &ehdr, &elf_info, &kbuf, &kernel_load_addr);
image->start = __pa(elf_info.ehdr->e_entry);
int parse_elf64(void *hdr, struct elf_info *info);
int parse_elf32(void *hdr, struct elf_info *info);
int parse_elf64(void *hdr, struct elf_info *info)
int parse_elf32(void *hdr, struct elf_info *info)
struct elf_info ei;
slave_code = elf_info.buffer + elf_info.proghdrs[0].p_offset;
kexec_free_elf_info(&elf_info);
struct kexec_elf_info elf_info;
ret = kexec_build_elf_info(kernel_buf, kernel_len, &ehdr, &elf_info);
ret = kexec_elf_load(image, &ehdr, &elf_info, &kbuf, &kernel_load_addr);
struct kexec_elf_info elf_info;
ret = kexec_build_elf_info(kernel_buf, kernel_len, &ehdr, &elf_info);
ret = elf_find_pbase(image, kernel_len, &ehdr, &elf_info,
ret = riscv_kexec_elf_load(image, &ehdr, &elf_info,
kexec_free_elf_info(&elf_info);
struct kexec_elf_info *elf_info, unsigned long old_pbase,
phdr = &elf_info->proghdrs[i];
kbuf.buffer = (void *) elf_info->buffer + phdr->p_offset;
struct elfhdr *ehdr, struct kexec_elf_info *elf_info,
phdr = &elf_info->proghdrs[i];
elf_addr_t *elf_info;
elf_info = (elf_addr_t *)mm->saved_auxv;
*elf_info++ = id; \
*elf_info++ = val; \
memset(elf_info, 0, (char *)mm->saved_auxv +
sizeof(mm->saved_auxv) - (char *)elf_info);
elf_info += 2;
ei_index = elf_info - (elf_addr_t *)mm->saved_auxv;
elf_addr_t *elf_info;
elf_info = (elf_addr_t *)mm->saved_auxv;
*elf_info++ = id; \
*elf_info++ = val; \
memset(elf_info, 0, (char *)mm->saved_auxv +
sizeof(mm->saved_auxv) - (char *)elf_info);
elf_info += 2;
ei_index = elf_info - (elf_addr_t *)mm->saved_auxv;
struct kexec_elf_info *elf_info);
struct kexec_elf_info *elf_info,
void kexec_free_elf_info(struct kexec_elf_info *elf_info);
struct kexec_elf_info *elf_info,
struct elf_phdr *phdr = (struct elf_phdr *) &elf_info->proghdrs[idx];
const struct elfhdr *ehdr = elf_info->ehdr;
pbuf = buf + elf_info->ehdr->e_phoff + (idx * sizeof(*buf_phdr));
phdr->p_type = elf32_to_cpu(elf_info->ehdr, buf_phdr->p_type);
phdr->p_flags = elf32_to_cpu(elf_info->ehdr, buf_phdr->p_flags);
struct kexec_elf_info *elf_info)
const struct elfhdr *ehdr = elf_info->ehdr;
elf_info->proghdrs = kzalloc(phdr_size, GFP_KERNEL);
if (!elf_info->proghdrs)
ret = elf_read_phdr(buf, len, elf_info, i);
kfree(elf_info->proghdrs);
elf_info->proghdrs = NULL;
struct kexec_elf_info *elf_info)
elf_info->buffer = buf;
elf_info->ehdr = ehdr;
ret = elf_read_phdrs(buf, len, elf_info);
void kexec_free_elf_info(struct kexec_elf_info *elf_info)
kfree(elf_info->proghdrs);
memset(elf_info, 0, sizeof(*elf_info));
struct kexec_elf_info *elf_info)
ret = elf_read_from_buffer(buf, len, ehdr, elf_info);
} else if (!elf_info->proghdrs) {
if (elf_info->proghdrs[i].p_type == PT_INTERP) {
kexec_free_elf_info(elf_info);
struct kexec_elf_info elf_info;
ret = kexec_build_elf_info(buf, len, &ehdr, &elf_info);
kexec_free_elf_info(&elf_info);
struct kexec_elf_info *elf_info,
phdr = &elf_info->proghdrs[i];
kbuf->buffer = (void *) elf_info->buffer + phdr->p_offset;
void handle_moddevtable(struct module *mod, struct elf_info *info,
static bool is_executable_section(struct elf_info *elf, unsigned int secndx)
static void default_mismatch_handler(const char *modname, struct elf_info *elf,
static void check_export_symbol(struct module *mod, struct elf_info *elf,
static void check_section_mismatch(struct module *mod, struct elf_info *elf,
static void get_rel_type_and_sym(struct elf_info *elf, uint64_t r_info,
static void section_rela(struct module *mod, struct elf_info *elf,
static void section_rel(struct module *mod, struct elf_info *elf,
static void check_sec_ref(struct module *mod, struct elf_info *elf)
struct elf_info info = { };
static void *sym_get_data_by_offset(const struct elf_info *info,
void *sym_get_data(const struct elf_info *info, const Elf_Sym *sym)
static const char *sech_name(const struct elf_info *info, Elf_Shdr *sechdr)
static const char *sec_name(const struct elf_info *info, unsigned int secindex)
static int parse_elf(struct elf_info *info, const char *filename)
static void parse_elf_finish(struct elf_info *info)
static int ignore_undef_symbol(struct elf_info *info, const char *symname)
static void handle_symbol(struct module *mod, struct elf_info *info,
static char *get_next_modinfo(struct elf_info *info, const char *tag,
static char *get_modinfo(struct elf_info *info, const char *tag)
static const char *sym_name(struct elf_info *elf, Elf_Sym *sym)
static void check_section(const char *modname, struct elf_info *elf,
static Elf_Sym *find_fromsym(struct elf_info *elf, Elf_Addr addr,
static Elf_Sym *find_tosym(struct elf_info *elf, Elf_Addr addr, Elf_Sym *sym)
static inline unsigned int get_secindex(const struct elf_info *info,
static inline bool is_valid_name(struct elf_info *elf, Elf_Sym *sym)
void symsearch_init(struct elf_info *elf);
void symsearch_finish(struct elf_info *elf);
Elf_Sym *symsearch_find_nearest(struct elf_info *elf, Elf_Addr addr,
void handle_moddevtable(struct module *mod, struct elf_info *info,
void *sym_get_data(const struct elf_info *info, const Elf_Sym *sym);
void symsearch_init(struct elf_info *elf)
void symsearch_finish(struct elf_info *elf)
Elf_Sym *symsearch_find_nearest(struct elf_info *elf, Elf_Addr addr,
static unsigned int symbol_count(struct elf_info *elf)
static void symsearch_populate(struct elf_info *elf,