函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称: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.

函数原型:static void layout_sections(struct module *mod, struct load_info *info)

返回类型:void

参数:

类型参数名称
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 i小于e_shnum循环sh_entsize等于0UL的反
2437  pr_debug("Core section allocation order:\n")
2438 m小于ARRAY_SIZE - get the number of elements in array @arr*@arr: array to be sized(masks)循环
2439 i小于e_shnum循环
2440  Elf_Shdrs等于sechdrs[i]
2441  sname等于secstringssh_name
2443  如果sh_flags按位与masks[m][0]的值不等于masks[m][0]或sh_flags按位与masks[m][1]或sh_entsize不等于0UL的反或strstarts - does @str start with @prefix?*@str: string to examine*@prefix: prefix to look for.则继续下一循环
2449  pr_debug("\t%s\n", sname)
2452  :m恒等于0
2456  :m恒等于1
2460  :m恒等于2
2464  :m恒等于4
2470  pr_debug("Init section allocation order:\n")
2472 i小于e_shnum循环
调用者
名称描述
layout_and_allocate