函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\kexec_elf.c Create Date:2022-07-27 12:06:37
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:kexec_build_elf_info - read ELF executable and check that we can use it

函数原型:int kexec_build_elf_info(const char *buf, size_t len, struct elf64_hdr *ehdr, struct kexec_elf_info *elf_info)

返回类型:int

参数:

类型参数名称
const char *buf
size_tlen
struct elf64_hdr *ehdr
struct kexec_elf_info *elf_info
333  ret等于lf_read_from_buffer - read ELF file and sets up ELF header and ELF info*@buf: Buffer to read ELF file from
334  如果ret则返回:ret
338  如果e_type不等于ET_EXECe_type不等于ET_DYN
339  打印错误信息("Not an ELF executable.\n")
340  转到:error
341  否则如果非proghdrs
342  打印错误信息("No ELF program header.\n")
343  转到:error
346 i小于e_phnum循环
352  如果p_type恒等于PT_INTERP
353  打印错误信息("Requires an ELF interpreter.\n")
354  转到:error
358  返回:0
359  error :
360  kexec_free_elf_info - free memory allocated by elf_read_from_buffer
361  返回:负ENOEXEC
调用者
名称描述
kexec_elf_probe