Lines Matching refs:sym

58 	GElf_Sym	*sym;  member
338 assert(l->sym != NULL); in cmp_size()
341 assert(r->sym != NULL); in cmp_size()
343 if (l->sym->st_size == r->sym->st_size) in cmp_size()
346 return (l->sym->st_size - r->sym->st_size); in cmp_size()
365 assert(l->sym != NULL); in cmp_value()
368 assert(r->sym != NULL); in cmp_value()
371 l_is_undef = IS_UNDEF_SYM_TYPE(get_sym_type(l->sym, ttable)) ? 1 : 0; in cmp_value()
372 r_is_undef = IS_UNDEF_SYM_TYPE(get_sym_type(r->sym, ttable)) ? 1 : 0; in cmp_value()
380 if (l->sym->st_value == r->sym->st_value) in cmp_value()
382 return (l->sym->st_value > r->sym->st_value ? 1 : -1); in cmp_value()
392 return (l->sym->st_value - r->sym->st_value); in cmp_value()
622 GElf_Sym sym; in get_sym() local
658 while (gelf_getsym(data, j++, &sym) != NULL) { in get_sym()
659 sym_name = get_sym_name(elf, &sym, ndx, in get_sym()
662 type = get_sym_type(&sym, type_table); in get_sym()
665 if (!fep->fn(type, &sym, sym_name)) { in get_sym()
672 &sym) == 0) in get_sym()
684 get_sym_name(Elf *elf, const GElf_Sym *sym, size_t ndx, const char **sec_table, in get_sym_name() argument
692 if (GELF_ST_TYPE(sym->st_info) == STT_SECTION) { in get_sym_name()
693 if (sec_table != NULL && sym->st_shndx < sec_table_size) in get_sym_name()
694 sym_name = sec_table[sym->st_shndx]; in get_sym_name()
696 sym_name = elf_strptr(elf, ndx, sym->st_name); in get_sym_name()
705 get_sym_type(const GElf_Sym *sym, const char *type_table) in get_sym_type() argument
709 if (sym == NULL || type_table == NULL) in get_sym_type()
712 is_local = sym->st_info >> 4 == STB_LOCAL; in get_sym_type()
714 if (sym->st_shndx == SHN_ABS) /* absolute */ in get_sym_type()
717 if (sym->st_shndx == SHN_COMMON) /* common */ in get_sym_type()
720 if ((sym->st_info) >> 4 == STB_WEAK) { /* weak */ in get_sym_type()
721 if ((sym->st_info & 0xf) == STT_OBJECT) in get_sym_type()
722 return (sym->st_shndx == SHN_UNDEF ? 'v' : 'V'); in get_sym_type()
724 return (sym->st_shndx == SHN_UNDEF ? 'w' : 'W'); in get_sym_type()
727 if (sym->st_shndx == SHN_UNDEF) /* undefined */ in get_sym_type()
730 return (is_local == true && type_table[sym->st_shndx] != 'N' ? in get_sym_type()
731 tolower((unsigned char) type_table[sym->st_shndx]) : in get_sym_type()
732 type_table[sym->st_shndx]); in get_sym_type()
1551 if ((ep->sym->st_info & 0xf) == STT_FUNC && func_info != NULL) { in print_lineno()
1555 ep->sym->st_value >= func->lowpc && in print_lineno()
1556 ep->sym->st_value < func->highpc) { in print_lineno()
1564 if ((ep->sym->st_info & 0xf) == STT_OBJECT && var_info != NULL) { in print_lineno()
1567 ep->sym->st_value == var->addr) { in print_lineno()
1577 if (ep->sym->st_value == lie->addr) { in print_lineno()
1611 sym_elem_print_all(char type, const char *sec, const GElf_Sym *sym, in sym_elem_print_all() argument
1615 if (sec == NULL || sym == NULL || name == NULL || in sym_elem_print_all()
1628 if (sym->st_size != 0) { in sym_elem_print_all()
1629 nm_opts.value_print_fn(sym); in sym_elem_print_all()
1631 nm_opts.size_print_fn(sym); in sym_elem_print_all()
1636 if (sym->st_size != 0) in sym_elem_print_all()
1637 nm_opts.size_print_fn(sym); in sym_elem_print_all()
1641 nm_opts.value_print_fn(sym); in sym_elem_print_all()
1642 if (sym->st_size != 0) { in sym_elem_print_all()
1644 nm_opts.size_print_fn(sym); in sym_elem_print_all()
1650 nm_opts.value_print_fn(sym); in sym_elem_print_all()
1659 sym_elem_print_all_portable(char type, const char *sec, const GElf_Sym *sym, in sym_elem_print_all_portable() argument
1663 if (sec == NULL || sym == NULL || name == NULL || in sym_elem_print_all_portable()
1670 nm_opts.value_print_fn(sym); in sym_elem_print_all_portable()
1672 if (sym->st_size != 0) in sym_elem_print_all_portable()
1673 nm_opts.size_print_fn(sym); in sym_elem_print_all_portable()
1679 sym_elem_print_all_sysv(char type, const char *sec, const GElf_Sym *sym, in sym_elem_print_all_sysv() argument
1683 if (sec == NULL || sym == NULL || name == NULL || in sym_elem_print_all_sysv()
1691 nm_opts.value_print_fn(sym); in sym_elem_print_all_sysv()
1695 switch (sym->st_info & 0xf) { in sym_elem_print_all_sysv()
1725 if (sym->st_size != 0) in sym_elem_print_all_sysv()
1726 nm_opts.size_print_fn(sym); in sym_elem_print_all_sysv()
1734 sym_elem_def(char type, const GElf_Sym *sym, const char *name) in sym_elem_def() argument
1739 UNUSED(sym); in sym_elem_def()
1746 sym_elem_global(char type, const GElf_Sym *sym, const char *name) in sym_elem_global() argument
1751 UNUSED(sym); in sym_elem_global()
1759 sym_elem_global_static(char type, const GElf_Sym *sym, const char *name) in sym_elem_global_static() argument
1763 assert(sym != NULL); in sym_elem_global_static()
1768 info = sym->st_info >> 4; in sym_elem_global_static()
1776 sym_elem_nondebug(char type, const GElf_Sym *sym, const char *name) in sym_elem_nondebug() argument
1779 assert(sym != NULL); in sym_elem_nondebug()
1784 if (sym->st_value == 0 && (sym->st_info & 0xf) == STT_FILE) in sym_elem_nondebug()
1786 if (sym->st_name == 0) in sym_elem_nondebug()
1793 sym_elem_nonzero_size(char type, const GElf_Sym *sym, const char *name) in sym_elem_nonzero_size() argument
1796 assert(sym != NULL); in sym_elem_nonzero_size()
1801 return (sym->st_size > 0); in sym_elem_nonzero_size()
1805 sym_elem_undef(char type, const GElf_Sym *sym, const char *name) in sym_elem_undef() argument
1810 UNUSED(sym); in sym_elem_undef()
1827 free(ep->sym); in sym_list_dest()
1835 sym_list_insert(struct sym_head *headp, const char *name, const GElf_Sym *sym) in sym_list_insert() argument
1839 if (headp == NULL || name == NULL || sym == NULL) in sym_list_insert()
1850 if ((e->sym = malloc(sizeof(GElf_Sym))) == NULL) { in sym_list_insert()
1857 memcpy(e->sym, sym, sizeof(GElf_Sym)); in sym_list_insert()
1860 if (sym->st_shndx == SHN_COMMON) in sym_list_insert()
1861 e->sym->st_value = sym->st_size; in sym_list_insert()
1906 assert(ep->sym != NULL); in sym_list_print_each()
1908 type = get_sym_type(ep->sym, p->t_table); in sym_list_print_each()
1923 switch (ep->sym->st_shndx) { in sym_list_print_each()
1948 if (ep->sym->st_shndx > p->sh_num) in sym_list_print_each()
1950 sec = p->s_table[ep->sym->st_shndx]; in sym_list_print_each()
1954 nm_opts.elem_print_fn(type, sec, ep->sym, ep->name); in sym_list_print_each()
1978 if (ep->name != NULL && ep->sym != NULL) { in sym_list_sort()
1980 e_v[idx].sym = ep->sym; in sym_list_sort()
1998 sym_size_oct_print(const GElf_Sym *sym) in sym_size_oct_print() argument
2001 assert(sym != NULL && "sym is null"); in sym_size_oct_print()
2002 printf("%016" PRIo64, sym->st_size); in sym_size_oct_print()
2006 sym_size_hex_print(const GElf_Sym *sym) in sym_size_hex_print() argument
2009 assert(sym != NULL && "sym is null"); in sym_size_hex_print()
2011 printf("%08" PRIx64, sym->st_size); in sym_size_hex_print()
2013 printf("%016" PRIx64, sym->st_size); in sym_size_hex_print()
2017 sym_size_dec_print(const GElf_Sym *sym) in sym_size_dec_print() argument
2020 assert(sym != NULL && "sym is null"); in sym_size_dec_print()
2021 printf("%016" PRId64, sym->st_size); in sym_size_dec_print()
2025 sym_value_oct_print(const GElf_Sym *sym) in sym_value_oct_print() argument
2028 assert(sym != NULL && "sym is null"); in sym_value_oct_print()
2029 printf("%016" PRIo64, sym->st_value); in sym_value_oct_print()
2033 sym_value_hex_print(const GElf_Sym *sym) in sym_value_hex_print() argument
2036 assert(sym != NULL && "sym is null"); in sym_value_hex_print()
2038 printf("%08" PRIx64, sym->st_value); in sym_value_hex_print()
2040 printf("%016" PRIx64, sym->st_value); in sym_value_hex_print()
2044 sym_value_dec_print(const GElf_Sym *sym) in sym_value_dec_print() argument
2047 assert(sym != NULL && "sym is null"); in sym_value_dec_print()
2048 printf("%016" PRId64, sym->st_value); in sym_value_dec_print()