Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:layout_and_allocate

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

Type:struct module

Parameter:

TypeParameterName
struct load_info *info
intflags
3414  err = check_modinfo( pointer to module in temporary copy, freed at end of load_module() , info, flags)
3415  If err Then Return ERR_PTR(err)
3419  err = module_frob_arch_sections(hdr, sechdrs, secstrings, pointer to module in temporary copy, freed at end of load_module() )
3421  If err < 0 Then Return ERR_PTR(err)
3425  sh_flags &= ~SHF_ALLOC
3432  ndx = Find a module section: 0 means not found.
3433  If ndx Then sh_flags |= SHF_RO_AFTER_INIT
3441  ndx = Find a module section: 0 means not found.
3442  If ndx Then sh_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  If err Then Return ERR_PTR(err)
3457  mod = sh_addr
3458  kmemleak_load_module(mod, info)
3459  Return mod
Caller
NameDescribe
load_moduleAllocate and load the module: note that size of section 0 is alwayszero, and we rely on this for optional sections.