函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\binfmt_elf.c Create Date:2022-07-29 11:03:00
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:This is much more generalized than the library routine read function,so we keep this separate. Technically the library read functionis only provided so that we can read a.out libraries that havean ELF header

函数原型:static unsigned long load_elf_interp(struct elf64_hdr *interp_elf_ex, struct file *interpreter, unsigned long no_base, struct elf64_phdr *interp_elf_phdata)

返回类型:unsigned long

参数:

类型参数名称
struct elf64_hdr *interp_elf_ex
struct file *interpreter
unsigned longno_base
struct elf64_phdr *interp_elf_phdata
561  load_addr等于0
562  load_addr_set等于0
563  last_bss等于0, elf_bss等于0
564  bss_prot等于0
565  error等于0UL的反
570  如果e_type不等于ET_EXECe_type不等于ET_DYN则转到:out
573  如果非elf_check_arch(interp_elf_ex)或That's for binfmt_elf_fdpic to deal with (interp_elf_ex)则转到:out
576  如果非mmap则转到:out
579  total_size等于total_mapping_size(interp_elf_phdata, e_phnum)
581  如果非total_size
582  error等于负EINVAL
583  转到:out
586  eppnt等于interp_elf_phdata
587 i小于e_phnum循环
588  如果p_type恒等于PT_LOAD
590  elf_prot等于make_prot(p_flags)
591  vaddr等于0
597  否则如果no_basee_type恒等于ET_DYNload_addr等于负vaddr
602  total_size等于0
603  error等于map_addr
604  如果BAD_ADDR(map_addr)则转到:out
607  如果非load_addr_sete_type恒等于ET_DYN
610  load_addr_set等于1
623  error等于负ENOMEM
624  转到:out
632  如果k大于elf_bsself_bss等于k
640  如果k大于last_bss
641  last_bss等于k
642  bss_prot等于elf_prot
652  如果We need to explicitly zero any fractional pagesafter the data section (i.e. bss). This wouldcontain the junk from the file that should notbe in memory
653  error等于负EFAULT
654  转到:out
661  elf_bss等于ELF_PAGEALIGN(elf_bss)
662  last_bss等于ELF_PAGEALIGN(last_bss)
664  如果last_bss大于elf_bss
665  error等于vm_brk_flags(elf_bss, last_bss - elf_bss, bss_prot & page can be executed ? VM_EXEC : 0)
667  如果error则转到:out
671  error等于load_addr
672  out :
673  返回:error
调用者
名称描述
load_elf_binary