函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:elf_read_phdr

函数原型:static int elf_read_phdr(const char *buf, size_t len, struct kexec_elf_info *elf_info, int idx)

返回类型:int

参数:

类型参数名称
const char *buf
size_tlen
struct kexec_elf_info *elf_info
intidx
207  struct elf64_phdr * phdr = (struct elf_phdr * ) & proghdrs[idx]
208  ehdr等于ehdr
212  pbuf等于bufe_phoffidxbuf_phdr的长度
213  buf_phdr等于pbuf
215  p_type等于elf32_to_cpu(ehdr, p_type)
216  p_flags等于elf32_to_cpu(ehdr, p_flags)
219  : ELF "magic number" [EI_CLASS]恒等于ELFCLASS64
220  Segment file offset 等于elf64_to_cpu(ehdr, Segment file offset )
221  Segment physical address 等于elf64_to_cpu(ehdr, Segment physical address )
222  Segment virtual address 等于elf64_to_cpu(ehdr, Segment virtual address )
223  Segment size in file 等于elf64_to_cpu(ehdr, Segment size in file )
224  Segment size in memory 等于elf64_to_cpu(ehdr, Segment size in memory )
225  Segment alignment, file & memory 等于elf64_to_cpu(ehdr, Segment alignment, file & memory )
226  退出
228  : ELF "magic number" [EI_CLASS]恒等于ELFCLASS32
229  Segment file offset 等于elf32_to_cpu(ehdr, Segment file offset )
230  Segment physical address 等于elf32_to_cpu(ehdr, Segment physical address )
231  Segment virtual address 等于elf32_to_cpu(ehdr, Segment virtual address )
232  Segment size in file 等于elf32_to_cpu(ehdr, Segment size in file )
233  Segment size in memory 等于elf32_to_cpu(ehdr, Segment size in memory )
234  Segment alignment, file & memory 等于elf32_to_cpu(ehdr, Segment alignment, file & memory )
235  退出
237  默认
238  pr_debug("Unknown ELF class.\n")
239  返回:负EINVAL
242  返回:如果lf_is_phdr_sane - check that it is safe to use the program header*@buf_len: size of the buffer in which the ELF file is loaded.则0否则负ENOEXEC
调用者
名称描述
elf_read_phdrslf_read_phdrs - read the program headers from the buffer* This function assumes that the program header table was checked for sanity.* Use elf_is_ehdr_sane() if it wasn't.