Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:load_elf_phdrs() - load ELF program headers*@elf_ex: ELF header of the binary whose program headers should be loaded*@elf_file: the opened ELF binary file* Loads ELF program headers from the binary file elf_file, which has the ELF

Proto:static struct elf64_phdr *load_elf_phdrs(const struct elf64_hdr *elf_ex, struct file *elf_file)

Type:struct elf64_phdr

Parameter:

TypeParameterName
const struct elf64_hdr *elf_ex
struct file *elf_file
430  struct elf64_phdr * elf_phdata = NULL
431  err = -1
438  If e_phentsize != size of elf_phdr Then Go to out
443  size = size of elf_phdr * e_phnum
444  If size == 0 || size > 65536 || size > ELF_MIN_ALIGN Then Go to out
447  elf_phdata = Allocation memory
448  If Not elf_phdata Then Go to out
452  retval = elf_read(elf_file, elf_phdata, size, Program header table file offset )
453  If retval < 0 Then
454  err = retval
455  Go to out
459  err = 0
460  out :
461  If err Then
462  kfree(elf_phdata)
463  elf_phdata = NULL
465  Return elf_phdata
Caller
NameDescribe
load_elf_binary