Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:klp_resolve_symbols

Proto:static int klp_resolve_symbols(Elf32_Shdr *relasec, struct module *pmod)

Type:int

Parameter:

TypeParameterName
Elf32_Shdr *relasec
struct module *pmod
199  strtab = strtab
200  Elf_Rela * relas
201  Elf_Sym * sym
214  BUILD_BUG_ON - break compile if a condition is true(MODULE_NAME_LEN < 56 || KSYM_NAME_LEN != 128)
216  relas = sh_addr
218  When i < sh_size / size of Elf_Rela cycle
219  sym = symtab + ELF_R_SYM(r_info)
220  If st_shndx != SHN_LIVEPATCH Then
221  pr_err("symbol %s is not marked as a livepatch symbol\n", strtab + st_name)
223  Return -EINVAL
227  cnt = sscanf - Unformat a buffer into a list of arguments*@buf: input buffer*@fmt: formatting of buffer*@...: resulting arguments
230  If cnt != 3 Then
231  pr_err("symbol %s has an incorrectly formatted name\n", strtab + st_name)
233  Return -EINVAL
237  vmlinux = Not strcmp(objname, "vmlinux")
238  ret = klp_find_object_symbol(vmlinux ? NULL : objname, symname, sympos, & addr)
240  If ret Then Return ret
243  st_value = addr
246  Return 0
Caller
NameDescribe
klp_write_object_relocations