Lines Matching refs:sym
493 const struct kernel_symbol *sym; member
526 fsa->sym = &syms->start[symnum]; in check_exported_symbol()
530 static unsigned long kernel_symbol_value(const struct kernel_symbol *sym) in kernel_symbol_value() argument
533 return (unsigned long)offset_to_ptr(&sym->value_offset); in kernel_symbol_value()
535 return sym->value; in kernel_symbol_value()
539 static const char *kernel_symbol_name(const struct kernel_symbol *sym) in kernel_symbol_name() argument
542 return offset_to_ptr(&sym->name_offset); in kernel_symbol_name()
544 return sym->name; in kernel_symbol_name()
548 static const char *kernel_symbol_namespace(const struct kernel_symbol *sym) in kernel_symbol_namespace() argument
551 if (!sym->namespace_offset) in kernel_symbol_namespace()
553 return offset_to_ptr(&sym->namespace_offset); in kernel_symbol_namespace()
555 return sym->namespace; in kernel_symbol_namespace()
559 static int cmp_name(const void *name, const void *sym) in cmp_name() argument
561 return strcmp(name, kernel_symbol_name(sym)); in cmp_name()
569 struct kernel_symbol *sym; in find_exported_symbol_in_section() local
571 sym = bsearch(fsa->name, syms->start, syms->stop - syms->start, in find_exported_symbol_in_section()
574 if (sym != NULL && check_exported_symbol(syms, owner, in find_exported_symbol_in_section()
575 sym - syms->start, data)) in find_exported_symbol_in_section()
600 return fsa.sym; in find_symbol()
1398 const struct kernel_symbol *sym, in verify_namespace_is_imported() argument
1404 namespace = kernel_symbol_namespace(sym); in verify_namespace_is_imported()
1419 mod->name, kernel_symbol_name(sym), namespace); in verify_namespace_is_imported()
1435 const struct kernel_symbol *sym; in resolve_symbol() local
1446 sym = find_symbol(name, &owner, &crc, in resolve_symbol()
1448 if (!sym) in resolve_symbol()
1452 sym = ERR_PTR(-EINVAL); in resolve_symbol()
1456 err = verify_namespace_is_imported(info, sym, mod); in resolve_symbol()
1458 sym = ERR_PTR(err); in resolve_symbol()
1464 sym = ERR_PTR(err); in resolve_symbol()
1473 return sym; in resolve_symbol()
2128 symndx = info->index.sym; in copy_module_elf()
2244 const struct kernel_symbol *sym; in __symbol_get() local
2247 sym = find_symbol(symbol, &owner, NULL, true, true); in __symbol_get()
2248 if (sym && strong_try_module_get(owner)) in __symbol_get()
2249 sym = NULL; in __symbol_get()
2252 return sym ? (void *)kernel_symbol_value(sym) : NULL; in __symbol_get()
2268 const struct kernel_symbol *sym; in verify_exported_symbols() member
2281 for (s = arr[i].sym; s < arr[i].sym + arr[i].num; s++) { in verify_exported_symbols()
2298 Elf_Shdr *symsec = &info->sechdrs[info->index.sym]; in simplify_symbols()
2299 Elf_Sym *sym = (void *)symsec->sh_addr; in simplify_symbols() local
2306 const char *name = info->strtab + sym[i].st_name; in simplify_symbols()
2308 switch (sym[i].st_shndx) { in simplify_symbols()
2325 (long)sym[i].st_value); in simplify_symbols()
2336 sym[i].st_value = kernel_symbol_value(ksym); in simplify_symbols()
2341 if (!ksym && ELF_ST_BIND(sym[i].st_info) == STB_WEAK) in simplify_symbols()
2351 if (sym[i].st_shndx == info->index.pcpu) in simplify_symbols()
2354 secbase = info->sechdrs[sym[i].st_shndx].sh_addr; in simplify_symbols()
2355 sym[i].st_value += secbase; in simplify_symbols()
2386 info->index.sym, i, mod); in apply_relocations()
2389 info->index.sym, i, mod); in apply_relocations()
2618 static char elf_type(const Elf_Sym *sym, const struct load_info *info) in elf_type() argument
2622 if (ELF_ST_BIND(sym->st_info) == STB_WEAK) { in elf_type()
2623 if (ELF_ST_TYPE(sym->st_info) == STT_OBJECT) in elf_type()
2628 if (sym->st_shndx == SHN_UNDEF) in elf_type()
2630 if (sym->st_shndx == SHN_ABS || sym->st_shndx == info->index.pcpu) in elf_type()
2632 if (sym->st_shndx >= SHN_LORESERVE) in elf_type()
2634 if (sechdrs[sym->st_shndx].sh_flags & SHF_EXECINSTR) in elf_type()
2636 if (sechdrs[sym->st_shndx].sh_flags & SHF_ALLOC in elf_type()
2637 && sechdrs[sym->st_shndx].sh_type != SHT_NOBITS) { in elf_type()
2638 if (!(sechdrs[sym->st_shndx].sh_flags & SHF_WRITE)) in elf_type()
2640 else if (sechdrs[sym->st_shndx].sh_flags & ARCH_SHF_SMALL) in elf_type()
2645 if (sechdrs[sym->st_shndx].sh_type == SHT_NOBITS) { in elf_type()
2646 if (sechdrs[sym->st_shndx].sh_flags & ARCH_SHF_SMALL) in elf_type()
2651 if (strstarts(info->secstrings + sechdrs[sym->st_shndx].sh_name, in elf_type()
2693 Elf_Shdr *symsect = info->sechdrs + info->index.sym; in layout_symtab()
2701 info->index.sym) | INIT_OFFSET_MASK; in layout_symtab()
2752 Elf_Shdr *symsec = &info->sechdrs[info->index.sym]; in add_kallsyms()
3070 info->index.sym = i; in setup_load_info()
3078 if (info->index.sym == 0) { in setup_load_info()
4079 const Elf_Sym *sym = &kallsyms->symtab[i]; in find_kallsyms_symbol() local
4080 unsigned long thisval = kallsyms_symbol_value(sym); in find_kallsyms_symbol()
4082 if (sym->st_shndx == SHN_UNDEF) in find_kallsyms_symbol()
4154 const char *sym; in lookup_module_symbol_name() local
4156 sym = find_kallsyms_symbol(mod, addr, NULL, NULL); in lookup_module_symbol_name()
4157 if (!sym) in lookup_module_symbol_name()
4160 strlcpy(symname, sym, KSYM_NAME_LEN); in lookup_module_symbol_name()
4180 const char *sym; in lookup_module_symbol_attrs() local
4182 sym = find_kallsyms_symbol(mod, addr, size, offset); in lookup_module_symbol_attrs()
4183 if (!sym) in lookup_module_symbol_attrs()
4188 strlcpy(name, sym, KSYM_NAME_LEN); in lookup_module_symbol_attrs()
4211 const Elf_Sym *sym = &kallsyms->symtab[symnum]; in module_get_kallsym() local
4213 *value = kallsyms_symbol_value(sym); in module_get_kallsym()
4234 const Elf_Sym *sym = &kallsyms->symtab[i]; in find_kallsyms_symbol_value() local
4237 sym->st_shndx != SHN_UNDEF) in find_kallsyms_symbol_value()
4238 return kallsyms_symbol_value(sym); in find_kallsyms_symbol_value()
4284 const Elf_Sym *sym = &kallsyms->symtab[i]; in module_kallsyms_on_each_symbol() local
4286 if (sym->st_shndx == SHN_UNDEF) in module_kallsyms_on_each_symbol()
4290 mod, kallsyms_symbol_value(sym)); in module_kallsyms_on_each_symbol()