Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\kexec_elf.c Create Date:2022-07-28 11:05:01
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:lf_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.

Proto:static int elf_read_phdrs(const char *buf, size_t len, struct kexec_elf_info *elf_info)

Type:int

Parameter:

TypeParameterName
const char *buf
size_tlen
struct kexec_elf_info *elf_info
255  ehdr = ehdr
261  phdr_size = size of elf_phdr * e_phnum
263  proghdrs = kzalloc - allocate memory. The memory is set to zero.*@size: how many bytes of memory are required.*@flags: the type of memory to allocate (see kmalloc).
264  If Not proghdrs Then Return -ENOMEM
267  When i < e_phnum cycle
270  ret = elf_read_phdr(buf, len, elf_info, i)
271  If ret Then
272  kfree(proghdrs)
273  proghdrs = NULL
274  Return ret
278  Return 0
Caller
NameDescribe
elf_read_from_bufferlf_read_from_buffer - read ELF file and sets up ELF header and ELF info*@buf: Buffer to read ELF file from