/titanic_50/usr/src/lib/libctf/common/ |
H A D | ctf_elfwrite.c | 49 GElf_Shdr shdr; in ctf_write_elf() local 133 GElf_Shdr shdr; in ctf_write_elf() local 136 if (gelf_getshdr(scn, &shdr) == NULL) { in ctf_write_elf() 140 sname = elf_strptr(src, strndx, shdr.sh_name); in ctf_write_elf() 160 if (gelf_getshdr(sscn, &shdr) == NULL) { in ctf_write_elf() 184 pad = new_offset % shdr.sh_addralign; in ctf_write_elf() 187 new_offset += shdr.sh_addralign - pad; in ctf_write_elf() 188 shdr.sh_offset = new_offset; in ctf_write_elf() 191 shdr.sh_link = secxlate[shdr.sh_link]; in ctf_write_elf() 193 if (shdr.sh_type == SHT_REL || shdr.sh_type == SHT_RELA) in ctf_write_elf() [all …]
|
/titanic_50/usr/src/cmd/sgs/liblddbg/common/ |
H A D | shdr.c | 33 Elf_shdr(Lm_list *lml, uchar_t osabi, Half mach, Shdr *shdr) in Elf_shdr() argument 38 dbg_print(lml, MSG_ORIG(MSG_SHD_ADDR), EC_ADDR(shdr->sh_addr), in Elf_shdr() 39 conv_sec_flags(osabi, mach, shdr->sh_flags, 0, &sec_flags_buf)); in Elf_shdr() 40 dbg_print(lml, MSG_ORIG(MSG_SHD_SIZE), EC_XWORD(shdr->sh_size), in Elf_shdr() 41 conv_sec_type(osabi, mach, shdr->sh_type, 0, &inv_buf1)); in Elf_shdr() 42 if (shdr->sh_entsize == 0) { in Elf_shdr() 44 EC_OFF(shdr->sh_offset), EC_XWORD(shdr->sh_entsize)); in Elf_shdr() 46 Xword nelts = shdr->sh_size / shdr->sh_entsize; in Elf_shdr() 51 EC_OFF(shdr->sh_offset), EC_XWORD(shdr->sh_entsize), in Elf_shdr() 55 conv_sec_linkinfo(shdr->sh_link, shdr->sh_flags, &inv_buf1), in Elf_shdr() [all …]
|
/titanic_50/usr/src/tools/ctf/cvt/ |
H A D | output.c | 334 GElf_Shdr shdr; in sort_iidescs() local 348 gelf_getshdr(scn, &shdr); in sort_iidescs() 349 nent = shdr.sh_size / shdr.sh_entsize; in sort_iidescs() 351 scn = elf_getscn(elf, shdr.sh_link); in sort_iidescs() 453 GElf_Shdr shdr; in write_file() local 496 GElf_Shdr shdr; in write_file() local 499 gelf_getshdr(scn, &shdr); in write_file() 500 sname = elf_strptr(src, sehdr.e_shstrndx, shdr.sh_name); in write_file() 503 shdr.sh_name); in write_file() 508 } else if (dynsym && shdr.sh_type == SHT_SYMTAB) { in write_file() [all …]
|
/titanic_50/usr/src/cmd/sgs/elfedit/modules/common/ |
H A D | shdr.c | 235 Shdr *shdr = sec->sec_shdr; in print_shdr() local 239 if (shdr->sh_type != ref_sec->sec_shdr->sh_type) in print_shdr() 266 EC_XWORD(shdr->sh_addr)); in print_shdr() 271 EC_XWORD(shdr->sh_addralign)); in print_shdr() 276 EC_XWORD(shdr->sh_entsize)); in print_shdr() 284 conv_sec_flags(osabi, mach, shdr->sh_flags, in print_shdr() 288 EC_XWORD(shdr->sh_flags)); in print_shdr() 294 EC_WORD(shdr->sh_info)); in print_shdr() 299 EC_WORD(shdr->sh_link)); in print_shdr() 312 EC_WORD(shdr->sh_name)); in print_shdr() [all …]
|
/titanic_50/usr/src/cmd/sgs/size/common/ |
H A D | process.c | 91 GElf_Shdr shdr; in process() local 145 if (gelf_getshdr(scn, &shdr) == 0) { in process() 152 } else if ((!(shdr.sh_flags & SHF_ALLOC)) && in process() 155 } else if ((!(shdr.sh_flags & SHF_ALLOC)) && !(nflag)) { in process() 157 } else if ((shdr.sh_flags & SHF_ALLOC) && in process() 158 (!(shdr.sh_flags & SHF_WRITE)) && in process() 159 (!(shdr.sh_type == SHT_NOBITS)) && in process() 161 first += shdr.sh_size; in process() 162 } else if ((shdr.sh_flags & SHF_ALLOC) && in process() 163 (shdr.sh_flags & SHF_WRITE) && in process() [all …]
|
/titanic_50/usr/src/lib/libelfsign/common/ |
H A D | elfsignlib.c | 487 GElf_Shdr shdr; in elfsign_signatures() local 510 if (gelf_getshdr(scn, &shdr) == NULL) { in elfsign_signatures() 516 (size_t)shdr.sh_name); in elfsign_signatures() 522 if (shdr.sh_type != SHT_NOBITS && in elfsign_signatures() 523 sig_offset < shdr.sh_offset + shdr.sh_size) { in elfsign_signatures() 524 sig_offset = shdr.sh_offset + shdr.sh_size; in elfsign_signatures() 548 if (gelf_getshdr(scn, &shdr) == NULL) { in elfsign_signatures() 559 if (old_size != shdr.sh_size) { in elfsign_signatures() 561 "and section size %lld", old_size, shdr.sh_size); in elfsign_signatures() 584 if (gelf_getshdr(sig_scn, &shdr) == 0) { in elfsign_signatures() [all …]
|
/titanic_50/usr/src/cmd/sgs/libelf/demo/ |
H A D | acom.c | 49 GElf_Shdr shdr; in update_comment() local 65 if (gelf_getshdr(scn, &shdr) == NULL) { in update_comment() 71 shdr.sh_name)) == 0) in update_comment() 113 if (gelf_getshdr(scn, &shdr) == NULL) { in update_comment() 118 shdr.sh_name = ndx; in update_comment() 119 shdr.sh_type = SHT_PROGBITS; in update_comment() 120 shdr.sh_flags = 0; in update_comment() 121 shdr.sh_addr = 0; in update_comment() 122 shdr.sh_link = 0; in update_comment() 123 shdr.sh_info = 0; in update_comment() [all …]
|
H A D | dispsyms.c | 73 GElf_Shdr shdr; in print_symtab() local 94 if (gelf_getshdr(scn, &shdr) == NULL) { in print_symtab() 100 if ((shdr.sh_type != SHT_SYMTAB) && in print_symtab() 101 (shdr.sh_type != SHT_DYNSYM) && in print_symtab() 102 (shdr.sh_type != SHT_SUNW_LDYNSYM)) in print_symtab() 120 elf_strptr(elf, shstrndx, shdr.sh_name)); in print_symtab() 130 symcnt = shdr.sh_size / shdr.sh_entsize; in print_symtab() 269 elf_strptr(elf, shdr.sh_link, sym.st_name)); in print_symtab()
|
/titanic_50/usr/src/cmd/sgs/librtld/common/ |
H A D | dldump.c | 156 Shdr *shdr; in rt_dldump() local 362 if ((_icache->c_shdr = shdr = elf_getshdr(scn)) == NULL) { in rt_dldump() 373 _icache->c_name = shstr + (size_t)(shdr->sh_name); in rt_dldump() 383 (shdr->sh_type == SHT_SUNW_syminfo)) { in rt_dldump() 399 if (shdr->sh_addr == 0) { in rt_dldump() 400 if ((shdr->sh_type == SHT_STRTAB) && in rt_dldump() 414 if ((shdr->sh_type == M_REL_SHT_TYPE) && shdr->sh_addr) in rt_dldump() 429 if (shdr->sh_addr && ((shdr->sh_addr + shdr->sh_size) == in rt_dldump() 456 if ((shdr = _icache->c_shdr) == 0) in rt_dldump() 464 if ((shdr->sh_type == M_REL_SHT_TYPE) && shdr->sh_addr) { in rt_dldump() [all …]
|
H A D | syms.c | 48 Shdr *shdr; in update_sym() local 54 shdr = _cache->c_shdr; in update_sym() 56 symn = shdr->sh_size / shdr->sh_entsize; in update_sym() 58 strs = (char *)cache[shdr->sh_link].c_data->d_buf; in update_sym() 87 Shdr *shdr; in syminfo() local 90 shdr = _cache->c_shdr; in syminfo() 92 num = (Word)(shdr->sh_size / shdr->sh_entsize); in syminfo()
|
H A D | relocate.c | 58 Shdr *shdr; in count_reloc() local 68 shdr = _cache->c_shdr; in count_reloc() 70 ent = shdr->sh_entsize; in count_reloc() 71 cnt = shdr->sh_size / ent; in count_reloc() 83 __cache = &cache[shdr->sh_link]; in count_reloc() 85 shdr = __cache->c_shdr; in count_reloc() 86 __cache = &cache[shdr->sh_link]; in count_reloc() 426 Shdr *shdr; local 436 shdr = _icache->c_shdr; 439 ent = shdr->sh_entsize; [all …]
|
/titanic_50/usr/src/cmd/sgs/libld/common/ |
H A D | sections.c | 359 Shdr *shdr; in ignore_section_processing() local 364 ((shdr = isc->is_shdr) == NULL) || in ignore_section_processing() 365 ((shdr->sh_flags & SHF_ALLOC) == 0)) in ignore_section_processing() 438 Shdr *shdr; in new_section() local 647 if ((shdr = libld_calloc(sizeof (Shdr), 1)) == NULL) in new_section() 649 shdr->sh_type = shtype; in new_section() 650 shdr->sh_size = size; in new_section() 651 shdr->sh_flags = sec_info->sh_flags; in new_section() 652 shdr->sh_addralign = sec_info->align; in new_section() 653 shdr->sh_entsize = sec_info->sh_entsize; in new_section() [all …]
|
H A D | place.c | 52 Shdr *shdr = isp->is_shdr; in set_addralign() local 62 if ((shdr->sh_size != 0) || in set_addralign() 71 ld_lcm(osp->os_sgdesc->sg_align, shdr->sh_addralign); in set_addralign() 664 Shdr *shdr; in isp_convert_type() local 666 if ((shdr = libld_malloc(sizeof (Shdr))) == NULL) in isp_convert_type() 668 *shdr = *isp->is_shdr; in isp_convert_type() 669 isp->is_shdr = shdr; in isp_convert_type() 670 shdr->sh_type = sh_type; in isp_convert_type() 671 return (shdr); in isp_convert_type() 740 Shdr *shdr = isp->is_shdr; in ld_place_section() local [all …]
|
H A D | files.c | 163 process_section(const char *name, Ifl_desc *ifl, Shdr *shdr, Elf_Scn *scn, in process_section() argument 175 isp->is_shdr = shdr; in process_section() 188 if ((shdr->sh_flags & SHF_EXCLUDE) && in process_section() 203 if (shdr->sh_flags & ALL_SHF_ORDER) { in process_section() 1167 Shdr *shdr = isp->is_shdr; in process_capinfo() local 1170 capinfonum = (Word)(shdr->sh_size / shdr->sh_entsize); in process_capinfo() 1280 process_input(const char *name, Ifl_desc *ifl, Shdr *shdr, Elf_Scn *scn, in process_input() argument 1283 return (process_section(name, ifl, shdr, scn, ndx, in process_input() 1295 process_reloc(const char *name, Ifl_desc *ifl, Shdr *shdr, Elf_Scn *scn, in process_reloc() argument 1299 shdr, scn, ndx, ld_targ.t_id.id_null, ofl) == S_ERROR) in process_reloc() [all …]
|
H A D | update.c | 1938 Shdr *shdr = ofl->ofl_ossymtab->os_shdr; in update_osym() local 1940 shdr->sh_info = symtab_gbl_bndx; in update_osym() 1942 shdr->sh_link = (Word)elf_ndxscn(ofl->ofl_osstrtab->os_scn); in update_osym() 1957 assert(shdr->sh_info == SYMTAB_LOC_CNT(ofl)); in update_osym() 1958 assert((shdr->sh_info + ofl->ofl_globcnt) == symtab_ndx); in update_osym() 1961 Shdr *shdr = ofl->ofl_osdynsym->os_shdr; in update_osym() local 1963 shdr->sh_info = DYNSYM_LOC_CNT(ofl); in update_osym() 1965 shdr->sh_link = (Word)elf_ndxscn(ofl->ofl_osdynstr->os_scn); in update_osym() 1971 shdr = ofl->ofl_osdynshndx->os_shdr; in update_osym() 1972 shdr->sh_link = in update_osym() [all …]
|
H A D | unwind.c | 323 Shdr *shdr; in ld_unwind_make_hdr() local 350 if ((shdr = libld_calloc(sizeof (Shdr), 1)) == NULL) in ld_unwind_make_hdr() 352 shdr->sh_type = ld_targ.t_m.m_sht_unwind; in ld_unwind_make_hdr() 353 shdr->sh_flags = SHF_ALLOC; in ld_unwind_make_hdr() 354 shdr->sh_addralign = ld_targ.t_m.m_word_align; in ld_unwind_make_hdr() 355 shdr->sh_entsize = 0; in ld_unwind_make_hdr() 363 isp->is_shdr = shdr; in ld_unwind_make_hdr() 447 shdr->sh_size = (Xword)size; in ld_unwind_make_hdr() 543 Shdr *shdr; in ld_unwind_populate_hdr() local 553 shdr = osp->os_shdr; in ld_unwind_populate_hdr() [all …]
|
/titanic_50/usr/src/cmd/file/ |
H A D | elf_read.c | 425 Elf_Shdr *shdr = &EI_Shdr; in process_shdr() local 439 if ((strtab = malloc(shdr->sh_size)) == NULL) in process_shdr() 442 if (pread64(EI->elffd, strtab, shdr->sh_size, shdr->sh_offset) in process_shdr() 443 != shdr->sh_size) in process_shdr() 446 strtab_sz = shdr->sh_size; in process_shdr() 455 if (shdr->sh_type == SHT_NULL) { in process_shdr() 460 cap_off = shdr->sh_offset; in process_shdr() 461 if (shdr->sh_type == SHT_SUNW_cap) { in process_shdr() 464 if (shdr->sh_size == 0 || shdr->sh_entsize == 0) { in process_shdr() 469 capn = (shdr->sh_size / shdr->sh_entsize); in process_shdr() [all …]
|
/titanic_50/usr/src/cmd/ctfmerge/ |
H A D | ctfmerge.c | 72 GElf_Shdr shdr; in ctfmerge_expect_ctf() local 80 if (gelf_getshdr(scn, &shdr) == NULL) { in ctfmerge_expect_ctf() 85 if (shdr.sh_type == SHT_SYMTAB) in ctfmerge_expect_ctf() 92 if ((strscn = elf_getscn(elf, shdr.sh_link)) == NULL) in ctfmerge_expect_ctf() 104 for (i = 0; i < shdr.sh_size / shdr.sh_entsize; i++) { in ctfmerge_expect_ctf() 136 GElf_Shdr shdr; in ctfmerge_elfopen() local 155 if (gelf_getshdr(scn, &shdr) == NULL) in ctfmerge_elfopen() 159 sname = elf_strptr(elf, ehdr.e_shstrndx, shdr.sh_name); in ctfmerge_elfopen() 160 if (shdr.sh_type == SHT_PROGBITS && in ctfmerge_elfopen() 163 ctfsect.cts_type = shdr.sh_type; in ctfmerge_elfopen() [all …]
|
/titanic_50/usr/src/cmd/boot/symdef/ |
H A D | symdef.c | 66 GElf_Shdr shdr; in main() local 94 if ((gelf_getshdr(scn, &shdr) == NULL) || in main() 95 ((shdr.sh_type != SHT_SYMTAB) && in main() 96 (shdr.sh_type != SHT_DYNSYM)) || in main() 99 symcnt = shdr.sh_size / shdr.sh_entsize; in main() 104 (strcmp(argv[2], elf_strptr(elfp, shdr.sh_link, in main()
|
/titanic_50/usr/src/cmd/sgs/prof/common/ |
H A D | rdelf.c | 162 GElf_Shdr shdr; in is_function() local 202 (void) gelf_getshdr(scn, &shdr); in is_function() 204 if (!(shdr.sh_flags & SHF_EXECINSTR)) in is_function() 232 GElf_Shdr shdr; in fetch_symtab() local 234 if (gelf_getshdr(scn, &shdr) == NULL) in fetch_symtab() 237 switch (shdr.sh_type) { in fetch_symtab() 239 nsyms_pri = shdr.sh_size / shdr.sh_entsize; in fetch_symtab() 240 strndx = shdr.sh_link; in fetch_symtab() 251 nsyms_pri = shdr.sh_size / shdr.sh_entsize; in fetch_symtab() 252 strndx = shdr.sh_link; in fetch_symtab() [all …]
|
/titanic_50/usr/src/cmd/sgs/libelf/common/ |
H A D | checksum.c | 105 Elf_Shdr * shdr; in elf_checksum() local 135 if ((shdr = getshdr(scn)) == 0) in elf_checksum() 139 if (!(shdr->sh_flags & SHF_ALLOC)) in elf_checksum() 152 if ((shdr->sh_type == SHT_DYNSYM) || in elf_checksum() 153 (shdr->sh_type == SHT_DYNAMIC) || in elf_checksum() 154 (shdr->sh_type == SHT_SUNW_dof)) in elf_checksum()
|
/titanic_50/usr/src/cmd/sgs/elfdump/common/ |
H A D | elfdump.c | 313 Shdr *shdr = cache[ndx].c_shdr; in stringtbl() local 319 if ((shdr->sh_link == 0) || (shdr->sh_link >= shnum)) { in stringtbl() 321 file, cache[ndx].c_name, EC_WORD(shdr->sh_link)); in stringtbl() 324 if ((shdr->sh_entsize == 0) || (shdr->sh_size == 0)) { in stringtbl() 343 ndx = shdr->sh_link; in stringtbl() 344 shdr = cache[ndx].c_shdr; in stringtbl() 350 *symnum = (shdr->sh_size / shdr->sh_entsize); in stringtbl() 358 if ((shdr->sh_link == 0) || (shdr->sh_link >= shnum)) { in stringtbl() 360 file, cache[ndx].c_name, EC_WORD(shdr->sh_link)); in stringtbl() 365 *strsec = &cache[shdr->sh_link]; in stringtbl() [all …]
|
H A D | fake_shdr.c | 292 Shdr *shdr; /* Constructed shdr */ member 327 if (sinfo->shdr) { in sinfo_free() 328 free(sinfo->shdr); in sinfo_free() 329 sinfo->shdr = NULL; in sinfo_free() 884 if ((sec->type == SINFO_T_NULL) || (sec->shdr != NULL)) in get_data() 887 if (((sec->shdr = malloc(sizeof (*sec->shdr))) == NULL) || in get_data() 907 sec->shdr->sh_name = 0; in get_data() 908 sec->shdr->sh_type = tinfo->sh_type; in get_data() 909 sec->shdr->sh_flags = tinfo->sh_flags; in get_data() 915 sec->shdr->sh_addr = sec->vaddr; in get_data() [all …]
|
/titanic_50/usr/src/lib/libproc/common/ |
H A D | Pgcore.c | 667 Elf32_Shdr shdr; in write_shdr() local 669 bzero(&shdr, sizeof (shdr)); in write_shdr() 670 shdr.sh_name = shstrtab_ndx(&pgc->pgc_shstrtab, name); in write_shdr() 671 shdr.sh_type = type; in write_shdr() 672 shdr.sh_flags = flags; in write_shdr() 673 shdr.sh_addr = (Elf32_Addr)addr; in write_shdr() 674 shdr.sh_offset = offset; in write_shdr() 675 shdr.sh_size = size; in write_shdr() 676 shdr.sh_link = link; in write_shdr() 677 shdr.sh_info = info; in write_shdr() [all …]
|
/titanic_50/usr/src/cmd/mdb/tools/findfp/common/ |
H A D | findsym.c | 41 GElf_Shdr shdr; in findelfsym() local 49 gelf_getshdr(scn, &shdr) == NULL || in findelfsym() 53 nent = shdr.sh_size / shdr.sh_entsize; in findelfsym() 68 if ((*symnamep = elf_strptr(elf, shdr.sh_link, in findelfsym()
|