Lines Matching refs:shdr
618 GElf_Shdr shdr; in handle_elf() local
655 if (gelf_getshdr(scn, &shdr) != NULL) in handle_elf()
656 berkeley_calc(&shdr); in handle_elf()
662 if (gelf_getshdr(scn, &shdr) != NULL) in handle_elf()
663 sysv_calc(elf, &elfhdr, &shdr); in handle_elf()
705 sysv_calc(Elf *elf, GElf_Ehdr *elfhdr, GElf_Shdr *shdr) in sysv_calc() argument
710 (size_t) shdr->sh_name); in sysv_calc()
711 if ((shdr->sh_type == SHT_SYMTAB || in sysv_calc()
712 shdr->sh_type == SHT_STRTAB || shdr->sh_type == SHT_RELA || in sysv_calc()
713 shdr->sh_type == SHT_REL) && shdr->sh_addr == 0) in sysv_calc()
717 tbl_print_num(shdr->sh_size, radix, 1); in sysv_calc()
718 tbl_print_num(shdr->sh_addr, radix, 2); in sysv_calc()
719 text_size_total += shdr->sh_size; in sysv_calc()
758 berkeley_calc(GElf_Shdr *shdr) in berkeley_calc() argument
760 if (shdr != NULL) { in berkeley_calc()
761 if (!(shdr->sh_flags & SHF_ALLOC)) in berkeley_calc()
763 if ((shdr->sh_flags & SHF_ALLOC) && in berkeley_calc()
764 ((shdr->sh_flags & SHF_EXECINSTR) || in berkeley_calc()
765 !(shdr->sh_flags & SHF_WRITE))) in berkeley_calc()
766 text_size += shdr->sh_size; in berkeley_calc()
767 else if ((shdr->sh_flags & SHF_ALLOC) && in berkeley_calc()
768 (shdr->sh_flags & SHF_WRITE) && in berkeley_calc()
769 (shdr->sh_type != SHT_NOBITS)) in berkeley_calc()
770 data_size += shdr->sh_size; in berkeley_calc()
772 bss_size += shdr->sh_size; in berkeley_calc()