Lines Matching refs:info

318 static void *sym_get_data_by_offset(const struct elf_info *info,
321 Elf_Shdr *sechdr = &info->sechdrs[secindex];
323 if (info->hdr->e_type != ET_REL)
326 return (void *)info->hdr + sechdr->sh_offset + offset;
329 static void *sym_get_data(const struct elf_info *info, const Elf_Sym *sym)
331 return sym_get_data_by_offset(info, get_secindex(info, sym),
335 static const char *sech_name(const struct elf_info *info, Elf_Shdr *sechdr)
337 return sym_get_data_by_offset(info, info->secindex_strings,
341 static const char *sec_name(const struct elf_info *info, int secindex)
343 return sech_name(info, &info->sechdrs[secindex]);
382 static const char *namespace_from_kstrtabns(const struct elf_info *info,
385 const char *value = sym_get_data(info, sym);
474 static int parse_elf(struct elf_info *info, const char *filename)
483 hdr = grab_file(filename, &info->size);
493 info->hdr = hdr;
494 if (info->size < sizeof(*hdr)) {
521 info->sechdrs = sechdrs;
524 if (hdr->e_shoff > info->size) {
526 (unsigned long)hdr->e_shoff, filename, info->size);
535 info->num_sections = TO_NATIVE(sechdrs[0].sh_size);
538 info->num_sections = hdr->e_shnum;
541 info->secindex_strings = TO_NATIVE(sechdrs[0].sh_link);
544 info->secindex_strings = hdr->e_shstrndx;
548 for (i = 0; i < info->num_sections; i++) {
561 secstrings = (void *)hdr + sechdrs[info->secindex_strings].sh_offset;
562 for (i = 1; i < info->num_sections; i++) {
566 if (!nobits && sechdrs[i].sh_offset > info->size) {
577 info->modinfo = (void *)hdr + sechdrs[i].sh_offset;
578 info->modinfo_len = sechdrs[i].sh_size;
580 info->export_sec = i;
582 info->export_unused_sec = i;
584 info->export_gpl_sec = i;
586 info->export_unused_gpl_sec = i;
588 info->export_gpl_future_sec = i;
593 info->symtab_start = (void *)hdr +
595 info->symtab_stop = (void *)hdr +
598 info->strtab = (void *)hdr +
605 info->symtab_shndx_start = (void *)hdr +
607 info->symtab_shndx_stop = (void *)hdr +
611 if (!info->symtab_start)
615 for (sym = info->symtab_start; sym < info->symtab_stop; sym++) {
629 for (p = info->symtab_shndx_start; p < info->symtab_shndx_stop;
637 static void parse_elf_finish(struct elf_info *info)
639 release_file(info->hdr, info->size);
642 static int ignore_undef_symbol(struct elf_info *info, const char *symname)
650 if (info->hdr->e_machine == EM_PPC)
659 if (info->hdr->e_machine == EM_PPC64)
672 const struct elf_info *info,
689 crcp = sym_get_data(info, sym);
695 static void handle_symbol(struct module *mod, struct elf_info *info,
702 export = export_from_secname(info, get_secindex(info, sym));
704 export = export_from_sec(info, get_secindex(info, sym));
718 if (ignore_undef_symbol(info, symname))
720 if (info->hdr->e_machine == EM_SPARC ||
721 info->hdr->e_machine == EM_SPARCV9) {
772 static char *get_next_modinfo(struct elf_info *info, const char *tag,
777 char *modinfo = info->modinfo;
778 unsigned long size = info->modinfo_len;
792 static char *get_modinfo(struct elf_info *info, const char *tag)
795 return get_next_modinfo(info, tag, NULL);
1290 * Find symbol based on relocation record info.
2028 struct elf_info info = { };
2031 if (!parse_elf(&info, modname))
2048 license = get_modinfo(&info, "license");
2058 license = get_next_modinfo(&info, "license", license);
2061 namespace = get_modinfo(&info, "import_ns");
2064 namespace = get_next_modinfo(&info, "import_ns",
2069 for (sym = info.symtab_start; sym < info.symtab_stop; sym++) {
2070 symname = remove_dot(info.strtab + sym->st_name);
2072 handle_symbol(mod, &info, sym, symname);
2073 handle_moddevtable(mod, &info, sym, symname);
2076 for (sym = info.symtab_start; sym < info.symtab_stop; sym++) {
2077 symname = remove_dot(info.strtab + sym->st_name);
2082 namespace_from_kstrtabns(&info,
2086 handle_modversion(mod, &info, sym,
2091 for (sym = info.symtab_start; sym < info.symtab_stop; sym++) {
2096 find_symbol(remove_dot(info.strtab +
2104 check_sec_ref(mod, modname, &info);
2107 version = get_modinfo(&info, "version");
2113 parse_elf_finish(&info);
2645 warn("Symbol info of vmlinux is missing. Unresolved symbol check will be entirely skipped.\n");