函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:elf_map

函数原型:static unsigned long elf_map(struct file *filep, unsigned long addr, const struct elf64_phdr *eppnt, int prot, int type, unsigned long total_size)

返回类型:unsigned long

参数:

类型参数名称
struct file *filep
unsigned longaddr
const struct elf64_phdr *eppnt
intprot
inttype
unsigned longtotal_size
353  size等于 Segment size in file ELF_PAGEOFFSET( Segment virtual address )
354  off等于 Segment file offset ELF_PAGEOFFSET( Segment virtual address )
355  addr等于ELF_PAGESTART(addr)
356  size等于ELF_PAGEALIGN(size)
360  如果非size则返回:addr
371  如果total_size
372  total_size等于ELF_PAGEALIGN(total_size)
373  map_addr等于vm_mmap(filep, addr, total_size, prot, type, off)
374  如果非BAD_ADDR(map_addr)则vm_munmap(map_addr + size, total_size - size)
376  否则map_addr等于vm_mmap(filep, addr, size, prot, type, off)
379  如果type按位与MAP_FIXED which doesn't unmap underlying mapping 错误恒等于负EEXIST打印信息("%d (%s): Uhuuh, elf segment at %px requested but the memory is mapped already\n", task_pid_nr(当前进程), comm, (void * )addr)
384  返回:map_addr
调用者
名称描述
load_elf_interpThis 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
load_elf_binary