Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Set up our basic convenience variables (pointers to section headers,* search for module section index etc), and do some basic section* verification.* Set info->mod to the temporary copy of the module in info->hdr. The final one

Proto:static int setup_load_info(struct load_info *info, int flags)

Type:int

Parameter:

TypeParameterName
struct load_info *info
intflags
3056  sechdrs = hdr + e_shoff
3057  secstrings = hdr + sh_offset
3061  info = Find a module section: 0 means not found.
3062  If info Then name = get_modinfo(info, "name")
3066  When i < e_shnum cycle
3067  If sh_type == SHT_SYMTAB Then
3068  sym = i
3069  str = sh_link
3070  strtab = hdr + sh_offset
3072  Break
3076  If sym == 0 Then
3077  pr_warn("%s: module has no symbols (stripped?)\n", name ? : "(missing .modinfo section or name field)")
3079  Return -ENOEXEC
3082  mod = Find a module section: 0 means not found.
3083  If Not mod Then
3084  pr_warn("%s: No module found in object\n", name ? : "(missing .modinfo section or name field)")
3086  Return -ENOEXEC
3089  pointer to module in temporary copy, freed at end of load_module() = hdr + sh_offset
3095  If Not name Then name = Unique handle for this module
3098  If flags & Flags for sys_finit_module: Then vers = 0
3100  Else vers = Find a module section: 0 means not found.
3103  pcpu = find_pcpusec(info)
3105  Return 0
Caller
NameDescribe
load_moduleAllocate and load the module: note that size of section 0 is alwayszero, and we rely on this for optional sections.