Lines Matching refs:sym
62 GElf_Sym *sym; member
345 assert(l->sym != NULL); in cmp_size()
348 assert(r->sym != NULL); in cmp_size()
350 if (l->sym->st_size == r->sym->st_size) in cmp_size()
353 return (l->sym->st_size - r->sym->st_size); in cmp_size()
372 assert(l->sym != NULL); in cmp_value()
375 assert(r->sym != NULL); in cmp_value()
378 l_is_undef = IS_UNDEF_SYM_TYPE(get_sym_type(l->sym, ttable)) ? 1 : 0; in cmp_value()
379 r_is_undef = IS_UNDEF_SYM_TYPE(get_sym_type(r->sym, ttable)) ? 1 : 0; in cmp_value()
387 if (l->sym->st_value == r->sym->st_value) in cmp_value()
389 return (l->sym->st_value > r->sym->st_value ? 1 : -1); in cmp_value()
399 return (l->sym->st_value - r->sym->st_value); in cmp_value()
661 GElf_Sym sym; in get_sym() local
697 while (gelf_getsym(data, j++, &sym) != NULL) { in get_sym()
698 sym_name = get_sym_name(elf, &sym, ndx, in get_sym()
701 type = get_sym_type(&sym, type_table); in get_sym()
704 if (!fep->fn(type, &sym, sym_name)) { in get_sym()
711 &sym) == 0) in get_sym()
723 get_sym_name(Elf *elf, const GElf_Sym *sym, size_t ndx, const char **sec_table, in get_sym_name() argument
731 if (GELF_ST_TYPE(sym->st_info) == STT_SECTION) { in get_sym_name()
732 if (sec_table != NULL && sym->st_shndx < sec_table_size) in get_sym_name()
733 sym_name = sec_table[sym->st_shndx]; in get_sym_name()
735 sym_name = elf_strptr(elf, ndx, sym->st_name); in get_sym_name()
744 get_sym_type(const GElf_Sym *sym, const char *type_table) in get_sym_type() argument
748 if (sym == NULL || type_table == NULL) in get_sym_type()
751 is_local = sym->st_info >> 4 == STB_LOCAL; in get_sym_type()
753 if (sym->st_shndx == SHN_ABS) /* absolute */ in get_sym_type()
756 if (sym->st_shndx == SHN_COMMON) /* common */ in get_sym_type()
759 if ((sym->st_info) >> 4 == STB_WEAK) { /* weak */ in get_sym_type()
760 if ((sym->st_info & 0xf) == STT_OBJECT) in get_sym_type()
761 return (sym->st_shndx == SHN_UNDEF ? 'v' : 'V'); in get_sym_type()
763 return (sym->st_shndx == SHN_UNDEF ? 'w' : 'W'); in get_sym_type()
766 if (sym->st_shndx == SHN_UNDEF) /* undefined */ in get_sym_type()
769 return (is_local == true && type_table[sym->st_shndx] != 'N' ? in get_sym_type()
770 tolower((unsigned char) type_table[sym->st_shndx]) : in get_sym_type()
771 type_table[sym->st_shndx]); in get_sym_type()
1590 if ((ep->sym->st_info & 0xf) == STT_FUNC && func_info != NULL) { in print_lineno()
1594 ep->sym->st_value >= func->lowpc && in print_lineno()
1595 ep->sym->st_value < func->highpc) { in print_lineno()
1603 if ((ep->sym->st_info & 0xf) == STT_OBJECT && var_info != NULL) { in print_lineno()
1606 ep->sym->st_value == var->addr) { in print_lineno()
1616 if (ep->sym->st_value == lie->addr) { in print_lineno()
1650 sym_elem_print_all(char type, const char *sec, const GElf_Sym *sym, in sym_elem_print_all() argument
1654 if (sec == NULL || sym == NULL || name == NULL || in sym_elem_print_all()
1667 if (sym->st_size != 0) { in sym_elem_print_all()
1668 nm_opts.value_print_fn(sym); in sym_elem_print_all()
1670 nm_opts.size_print_fn(sym); in sym_elem_print_all()
1675 if (sym->st_size != 0) in sym_elem_print_all()
1676 nm_opts.size_print_fn(sym); in sym_elem_print_all()
1680 nm_opts.value_print_fn(sym); in sym_elem_print_all()
1681 if (sym->st_size != 0) { in sym_elem_print_all()
1683 nm_opts.size_print_fn(sym); in sym_elem_print_all()
1689 nm_opts.value_print_fn(sym); in sym_elem_print_all()
1698 sym_elem_print_all_portable(char type, const char *sec, const GElf_Sym *sym, in sym_elem_print_all_portable() argument
1702 if (sec == NULL || sym == NULL || name == NULL || in sym_elem_print_all_portable()
1709 nm_opts.value_print_fn(sym); in sym_elem_print_all_portable()
1711 if (sym->st_size != 0) in sym_elem_print_all_portable()
1712 nm_opts.size_print_fn(sym); in sym_elem_print_all_portable()
1718 sym_elem_print_all_sysv(char type, const char *sec, const GElf_Sym *sym, in sym_elem_print_all_sysv() argument
1722 if (sec == NULL || sym == NULL || name == NULL || in sym_elem_print_all_sysv()
1730 nm_opts.value_print_fn(sym); in sym_elem_print_all_sysv()
1734 switch (sym->st_info & 0xf) { in sym_elem_print_all_sysv()
1764 if (sym->st_size != 0) in sym_elem_print_all_sysv()
1765 nm_opts.size_print_fn(sym); in sym_elem_print_all_sysv()
1773 sym_elem_def(char type, const GElf_Sym *sym, const char *name) in sym_elem_def() argument
1778 UNUSED(sym); in sym_elem_def()
1785 sym_elem_global(char type, const GElf_Sym *sym, const char *name) in sym_elem_global() argument
1790 UNUSED(sym); in sym_elem_global()
1798 sym_elem_global_static(char type, const GElf_Sym *sym, const char *name) in sym_elem_global_static() argument
1802 assert(sym != NULL); in sym_elem_global_static()
1807 info = sym->st_info >> 4; in sym_elem_global_static()
1815 sym_elem_nondebug(char type, const GElf_Sym *sym, const char *name) in sym_elem_nondebug() argument
1818 assert(sym != NULL); in sym_elem_nondebug()
1823 if (sym->st_value == 0 && (sym->st_info & 0xf) == STT_FILE) in sym_elem_nondebug()
1825 if (sym->st_name == 0) in sym_elem_nondebug()
1832 sym_elem_nonzero_size(char type, const GElf_Sym *sym, const char *name) in sym_elem_nonzero_size() argument
1835 assert(sym != NULL); in sym_elem_nonzero_size()
1840 return (sym->st_size > 0); in sym_elem_nonzero_size()
1844 sym_elem_undef(char type, const GElf_Sym *sym, const char *name) in sym_elem_undef() argument
1849 UNUSED(sym); in sym_elem_undef()
1866 free(ep->sym); in sym_list_dest()
1874 sym_list_insert(struct sym_head *headp, const char *name, const GElf_Sym *sym) in sym_list_insert() argument
1878 if (headp == NULL || name == NULL || sym == NULL) in sym_list_insert()
1889 if ((e->sym = malloc(sizeof(GElf_Sym))) == NULL) { in sym_list_insert()
1896 memcpy(e->sym, sym, sizeof(GElf_Sym)); in sym_list_insert()
1899 if (sym->st_shndx == SHN_COMMON) in sym_list_insert()
1900 e->sym->st_value = sym->st_size; in sym_list_insert()
1945 assert(ep->sym != NULL); in sym_list_print_each()
1947 type = get_sym_type(ep->sym, p->t_table); in sym_list_print_each()
1962 switch (ep->sym->st_shndx) { in sym_list_print_each()
1987 if (ep->sym->st_shndx > p->sh_num) in sym_list_print_each()
1989 sec = p->s_table[ep->sym->st_shndx]; in sym_list_print_each()
1993 nm_opts.elem_print_fn(type, sec, ep->sym, ep->name); in sym_list_print_each()
2017 if (ep->name != NULL && ep->sym != NULL) { in sym_list_sort()
2019 e_v[idx].sym = ep->sym; in sym_list_sort()
2037 sym_size_oct_print(const GElf_Sym *sym) in sym_size_oct_print() argument
2040 assert(sym != NULL && "sym is null"); in sym_size_oct_print()
2041 printf("%016" PRIo64, sym->st_size); in sym_size_oct_print()
2045 sym_size_hex_print(const GElf_Sym *sym) in sym_size_hex_print() argument
2048 assert(sym != NULL && "sym is null"); in sym_size_hex_print()
2050 printf("%08" PRIx64, sym->st_size); in sym_size_hex_print()
2052 printf("%016" PRIx64, sym->st_size); in sym_size_hex_print()
2056 sym_size_dec_print(const GElf_Sym *sym) in sym_size_dec_print() argument
2059 assert(sym != NULL && "sym is null"); in sym_size_dec_print()
2060 printf("%016" PRId64, sym->st_size); in sym_size_dec_print()
2064 sym_value_oct_print(const GElf_Sym *sym) in sym_value_oct_print() argument
2067 assert(sym != NULL && "sym is null"); in sym_value_oct_print()
2068 printf("%016" PRIo64, sym->st_value); in sym_value_oct_print()
2072 sym_value_hex_print(const GElf_Sym *sym) in sym_value_hex_print() argument
2075 assert(sym != NULL && "sym is null"); in sym_value_hex_print()
2077 printf("%08" PRIx64, sym->st_value); in sym_value_hex_print()
2079 printf("%016" PRIx64, sym->st_value); in sym_value_hex_print()
2083 sym_value_dec_print(const GElf_Sym *sym) in sym_value_dec_print() argument
2086 assert(sym != NULL && "sym is null"); in sym_value_dec_print()
2087 printf("%016" PRId64, sym->st_value); in sym_value_dec_print()