Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Change all symbols so that st_value encodes the pointer directly.

Proto:static int simplify_symbols(struct module *mod, const struct load_info *info)

Type:int

Parameter:

TypeParameterName
struct module *mod
const struct load_info *info
2298  Elf_Shdr * symsec = sechdrs[sym]
2299  Elf_Sym * sym = sh_addr
2302  ret = 0
2305  When i < sh_size / size of Elf_Sym cycle
2306  name = strtab + st_name
2309  Case st_shndx == SHN_COMMON
2311  If Not strncmp(name, "__gnu_lto", 9) Then Break
2316  pr_debug("Common symbol: %s\n", name)
2317  pr_warn("%s: please compile with -fno-common\n", Unique handle for this module )
2319  ret = -ENOEXEC
2320  Break
2322  Case st_shndx == SHN_ABS
2324  pr_debug("Absolute symbol: 0x%08lx\n", (long)st_value)
2326  Break
2328  Case st_shndx == SHN_LIVEPATCH
2330  Break
2335  If ksym && Not IS_ERR(ksym) Then
2337  Break
2341  If Not ksym && ELF_ST_BIND(st_info) == STB_WEAK Then Break
2344  ret = If PTR_ERR(ksym) Else -ENOENT
2345  pr_warn("%s: Unknown symbol %s (err %d)\n", Unique handle for this module , name, ret)
2347  Break
2349  Default
2351  If st_shndx == pcpu Then secbase = mod_percpu(mod)
2353  Else secbase = sh_addr
2355  st_value += secbase
2356  Break
2360  Return ret
Caller
NameDescribe
load_moduleAllocate and load the module: note that size of section 0 is alwayszero, and we rely on this for optional sections.