函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Persist Elf information about a module. Copy the Elf header,* section header table, section string table, and symtab section* index from info to mod->klp_info.

函数原型:static int copy_module_elf(struct module *mod, struct load_info *info)

返回类型:int

参数:

类型参数名称
struct module *mod
struct load_info *info
2107  size等于 Elf information 的长度
2108  Elf information 等于开辟内存
2109  如果( Elf information == NULL)则返回:负ENOMEM
2113  size等于hdr的长度
2114  内存复制( & hdr, hdr, size)
2117  size等于sechdrs的长度乘e_shnum
2118  sechdrs等于kmemdup(sechdrs, size, GFP_KERNEL)
2119  如果(sechdrs == NULL)则
2120  ret等于负ENOMEM
2121  转到:free_info
2125  size等于sh_size
2126  secstrings等于kmemdup(secstrings, size, GFP_KERNEL)
2127  如果(secstrings == NULL)则
2128  ret等于负ENOMEM
2129  转到:free_sechdrs
2133  symndx等于sym
2134  symndx等于symndx
2143  sh_addr等于symtab
2145  返回:0
2147  free_sechdrs :
2148  kfree(sechdrs)
2149  free_info :
2150  kfree( Elf information )
2151  返回:ret
调用者
名称描述
load_moduleAllocate and load the module: note that size of section 0 is alwayszero, and we rely on this for optional sections.