Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name: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.

Proto:static void layout_sections(struct module *mod, struct load_info *info)

Type:void

Parameter:

TypeParameterName
struct module *mod
struct load_info *info
2422  static unsigned long const masks[][2] = {{SHF_EXECINSTR | SHF_ALLOC, ARCH_SHF_SMALL}, {SHF_ALLOC, sh_flags | ARCH_SHF_SMALL}, {SHF_RO_AFTER_INIT | SHF_ALLOC, ARCH_SHF_SMALL}, {sh_flags | SHF_ALLOC, ARCH_SHF_SMALL}, {ARCH_SHF_SMALL | SHF_ALLOC, 0}}
2434  When i < e_shnum cycle sh_entsize = ~0UL
2437  pr_debug("Core section allocation order:\n")
2438  When m < ARRAY_SIZE - get the number of elements in array @arr*@arr: array to be sized(masks) cycle
2439  When i < e_shnum cycle
2440  Elf_Shdr * s = sechdrs[i]
2441  sname = secstrings + sh_name
2449  pr_debug("\t%s\n", sname)
2452  Case m == 0
2456  Case m == 1
2460  Case m == 2
2464  Case m == 4
2466  Break
2470  pr_debug("Init section allocation order:\n")
2472  When i < e_shnum cycle
Caller
NameDescribe
layout_and_allocate