Lines Matching refs:sym

400 	Elf_Sym  *sym;  in parse_elf()  local
532 for (sym = info->symtab_start; sym < info->symtab_stop; sym++) { in parse_elf()
533 sym->st_shndx = TO_NATIVE(sym->st_shndx); in parse_elf()
534 sym->st_name = TO_NATIVE(sym->st_name); in parse_elf()
535 sym->st_value = TO_NATIVE(sym->st_value); in parse_elf()
536 sym->st_size = TO_NATIVE(sym->st_size); in parse_elf()
587 Elf_Sym *sym, const char *symname) in handle_modversions() argument
594 export = export_from_secname(info, get_secindex(info, sym)); in handle_modversions()
596 export = export_from_sec(info, get_secindex(info, sym)); in handle_modversions()
598 switch (sym->st_shndx) { in handle_modversions()
605 crc = (unsigned int) sym->st_value; in handle_modversions()
612 if (ELF_ST_BIND(sym->st_info) != STB_GLOBAL && in handle_modversions()
613 ELF_ST_BIND(sym->st_info) != STB_WEAK) in handle_modversions()
626 if (ELF_ST_TYPE(sym->st_info) == STT_SPARC_REGISTER) in handle_modversions()
642 ELF_ST_BIND(sym->st_info) == STB_WEAK, in handle_modversions()
730 static const char *sym_name(struct elf_info *elf, Elf_Sym *sym) in sym_name() argument
732 if (sym) in sym_name()
733 return elf->strtab + sym->st_name; in sym_name()
757 static int number_prefix(const char *sym) in number_prefix() argument
759 if (*sym++ == '\0') in number_prefix()
761 if (*sym != '.') in number_prefix()
764 char c = *sym++; in number_prefix()
767 } while (*sym); in number_prefix()
780 static int match(const char *sym, const char * const pat[]) in match() argument
789 if (strrcmp(sym, p + 1) == 0) in match()
794 if (strncmp(sym, p, strlen(p) - 1) == 0) in match()
799 if (strncmp(sym, p, strlen(p) - 1) == 0) { in match()
800 if (number_prefix(sym + strlen(p) - 1)) in match()
806 if (strcmp(p, sym) == 0) in match()
1140 Elf_Sym *sym; in find_elf_symbol() local
1150 for (sym = elf->symtab_start; sym < elf->symtab_stop; sym++) { in find_elf_symbol()
1151 if (get_secindex(elf, sym) != relsym_secindex) in find_elf_symbol()
1153 if (ELF_ST_TYPE(sym->st_info) == STT_SECTION) in find_elf_symbol()
1155 if (sym->st_value == addr) in find_elf_symbol()
1156 return sym; in find_elf_symbol()
1158 d = sym->st_value - addr; in find_elf_symbol()
1160 d = addr - sym->st_value; in find_elf_symbol()
1163 near = sym; in find_elf_symbol()
1188 static inline int is_valid_name(struct elf_info *elf, Elf_Sym *sym) in is_valid_name() argument
1190 const char *name = elf->strtab + sym->st_name; in is_valid_name()
1206 Elf_Sym *sym; in find_elf_symbol2() local
1210 for (sym = elf->symtab_start; sym < elf->symtab_stop; sym++) { in find_elf_symbol2()
1213 if (is_shndx_special(sym->st_shndx)) in find_elf_symbol2()
1215 symsec = sec_name(elf, get_secindex(elf, sym)); in find_elf_symbol2()
1218 if (!is_valid_name(elf, sym)) in find_elf_symbol2()
1220 if (sym->st_value <= addr) { in find_elf_symbol2()
1221 if ((addr - sym->st_value) < distance) { in find_elf_symbol2()
1222 distance = addr - sym->st_value; in find_elf_symbol2()
1223 near = sym; in find_elf_symbol2()
1224 } else if ((addr - sym->st_value) == distance) { in find_elf_symbol2()
1225 near = sym; in find_elf_symbol2()
1269 static int is_function(Elf_Sym *sym) in is_function() argument
1271 if (sym) in is_function()
1272 return ELF_ST_TYPE(sym->st_info) == STT_FUNC; in is_function()
1442 Elf_Rela *r, Elf_Sym *sym, const char *fromsec) in check_section_mismatch() argument
1447 tosec = sec_name(elf, get_secindex(elf, sym)); in check_section_mismatch()
1457 to = find_elf_symbol(elf, r->r_addend, sym); in check_section_mismatch()
1548 Elf_Sym *sym; in section_rela() local
1581 sym = elf->symtab_start + r_sym; in section_rela()
1583 if (is_shndx_special(sym->st_shndx)) in section_rela()
1585 check_section_mismatch(modname, elf, &r, sym, fromsec); in section_rela()
1592 Elf_Sym *sym; in section_rel() local
1639 sym = elf->symtab_start + r_sym; in section_rel()
1641 if (is_shndx_special(sym->st_shndx)) in section_rel()
1643 check_section_mismatch(modname, elf, &r, sym, fromsec); in section_rel()
1683 Elf_Sym *sym; in read_symbols() local
1713 for (sym = info.symtab_start; sym < info.symtab_stop; sym++) { in read_symbols()
1714 symname = info.strtab + sym->st_name; in read_symbols()
1716 handle_modversions(mod, &info, sym, symname); in read_symbols()
1717 handle_moddevtable(mod, &info, sym, symname); in read_symbols()
2056 static int dump_sym(struct symbol *sym) in dump_sym() argument
2060 if (sym->vmlinux || sym->kernel) in dump_sym()