函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:layout_and_allocate

函数原型:static struct module *layout_and_allocate(struct load_info *info, int flags)

返回类型:struct module

参数:

类型参数名称
struct load_info *info
intflags
3414  err等于check_modinfo( pointer to module in temporary copy, freed at end of load_module() , info, flags)
3415  如果err则返回:错误号
3419  err等于module_frob_arch_sections(hdr, sechdrs, secstrings, pointer to module in temporary copy, freed at end of load_module() )
3421  如果err小于0则返回:错误号
3425  sh_flags与等于SHF_ALLOC的反
3432  ndx等于Find a module section: 0 means not found.
3433  如果ndxsh_flags或等于SHF_RO_AFTER_INIT
3441  ndx等于Find a module section: 0 means not found.
3442  如果ndxsh_flags或等于SHF_RO_AFTER_INIT
3448  Lay out the SHF_ALLOC sections in a way not dissimilar to how ldmight -- code, read-only data, read-write data, small data. Tallysizes, and place the offsets into sh_entsize fields: high bit means itbelongs in init.
3449  layout_symtab( pointer to module in temporary copy, freed at end of load_module() , info)
3452  err等于move_module( pointer to module in temporary copy, freed at end of load_module() , info)
3453  如果err则返回:错误号
3457  mod等于sh_addr
3458  kmemleak_load_module(mod, info)
3459  返回:mod
调用者
名称描述
load_moduleAllocate and load the module: note that size of section 0 is alwayszero, and we rely on this for optional sections.