Lines Matching refs:elf_info
203 struct kexec_elf_info *elf_info, in elf_read_phdr() argument
207 struct elf_phdr *phdr = (struct elf_phdr *) &elf_info->proghdrs[idx]; in elf_read_phdr()
208 const struct elfhdr *ehdr = elf_info->ehdr; in elf_read_phdr()
212 pbuf = buf + elf_info->ehdr->e_phoff + (idx * sizeof(*buf_phdr)); in elf_read_phdr()
215 phdr->p_type = elf32_to_cpu(elf_info->ehdr, buf_phdr->p_type); in elf_read_phdr()
216 phdr->p_flags = elf32_to_cpu(elf_info->ehdr, buf_phdr->p_flags); in elf_read_phdr()
252 struct kexec_elf_info *elf_info) in elf_read_phdrs() argument
255 const struct elfhdr *ehdr = elf_info->ehdr; in elf_read_phdrs()
263 elf_info->proghdrs = kzalloc(phdr_size, GFP_KERNEL); in elf_read_phdrs()
264 if (!elf_info->proghdrs) in elf_read_phdrs()
270 ret = elf_read_phdr(buf, len, elf_info, i); in elf_read_phdrs()
272 kfree(elf_info->proghdrs); in elf_read_phdrs()
273 elf_info->proghdrs = NULL; in elf_read_phdrs()
298 struct kexec_elf_info *elf_info) in elf_read_from_buffer() argument
306 elf_info->buffer = buf; in elf_read_from_buffer()
307 elf_info->ehdr = ehdr; in elf_read_from_buffer()
309 ret = elf_read_phdrs(buf, len, elf_info); in elf_read_from_buffer()
319 void kexec_free_elf_info(struct kexec_elf_info *elf_info) in kexec_free_elf_info() argument
321 kfree(elf_info->proghdrs); in kexec_free_elf_info()
322 memset(elf_info, 0, sizeof(*elf_info)); in kexec_free_elf_info()
328 struct kexec_elf_info *elf_info) in kexec_build_elf_info() argument
333 ret = elf_read_from_buffer(buf, len, ehdr, elf_info); in kexec_build_elf_info()
341 } else if (!elf_info->proghdrs) { in kexec_build_elf_info()
352 if (elf_info->proghdrs[i].p_type == PT_INTERP) { in kexec_build_elf_info()
360 kexec_free_elf_info(elf_info); in kexec_build_elf_info()
368 struct kexec_elf_info elf_info; in kexec_elf_probe() local
371 ret = kexec_build_elf_info(buf, len, &ehdr, &elf_info); in kexec_elf_probe()
375 kexec_free_elf_info(&elf_info); in kexec_elf_probe()
389 struct kexec_elf_info *elf_info, in kexec_elf_load() argument
403 phdr = &elf_info->proghdrs[i]; in kexec_elf_load()
411 kbuf->buffer = (void *) elf_info->buffer + phdr->p_offset; in kexec_elf_load()