Lines Matching defs:shp

897 	Shdr *shp;
919 shp = (Shdr *)(mp->shdrs + (i * mp->hdr.e_shentsize));
921 if (shp->sh_flags & SHF_ALLOC) {
922 if (shp->sh_flags & SHF_WRITE) {
924 mp->data = (char *)shp->sh_addr;
926 mp->text = (char *)shp->sh_addr;
929 if (shp->sh_type == SHT_SYMTAB) {
931 mp->symhdr = shp;
932 mp->symspace = mp->symtbl = (char *)shp->sh_addr;
1615 Shdr *shp;
1618 shp = (Shdr *)(omp->shdrs + shn * omp->hdr.e_shentsize);
1619 switch (shp->sh_type) {
1622 if (shp->sh_addr != 0) {
1623 kobj_free((void *)shp->sh_addr,
1624 shp->sh_size);
1753 Shdr *dshp, *dstrp, *shp;
1760 shp = (Shdr *)(mp->shdrs + shn * mp->hdr.e_shentsize);
1761 switch (shp->sh_type) {
1770 dshp = shp;
2219 Shdr *shp;
2222 shp = (Shdr *)(mp->shdrs + shn * mp->hdr.e_shentsize);
2223 switch (shp->sh_type) {
2226 if (shp->sh_addr != 0)
2227 kobj_free((void *)shp->sh_addr,
2228 shp->sh_size);
2277 Shdr *shp;
2393 shp = (Shdr *)(mp->shdrs + shn * mp->hdr.e_shentsize);
2394 if (!(shp->sh_flags & SHF_ALLOC))
2397 if ((shp->sh_flags & SHF_WRITE) == 0)
2402 bits_ptr = ALIGN(bits_ptr, shp->sh_addralign);
2404 if (shp->sh_type == SHT_NOBITS) {
2408 bzero((caddr_t)bits_ptr, shp->sh_size);
2409 shp->sh_type = SHT_PROGBITS;
2412 shp->sh_size, shp->sh_offset) < 0)
2416 if (shp->sh_flags & SHF_WRITE) {
2417 shp->sh_addr = bits_ptr;
2419 textptr = ALIGN(textptr, shp->sh_addralign);
2420 shp->sh_addr = textptr;
2421 textptr += shp->sh_size;
2424 bits_ptr += shp->sh_size;
2425 if ((shp->sh_flags & SHF_WRITE) == 0)
2476 Shdr *shp;
2486 shp = (Shdr *)(mp->shdrs + shn * mp->hdr.e_shentsize);
2487 switch (shp->sh_type) {
2490 mp->symhdr = shp;
2499 if (shp->sh_addr)
2503 shp->sh_addr = (Addr)
2504 kobj_alloc(shp->sh_size, KM_WAIT|KM_TMP);
2506 if (kobj_read_file(file, (char *)shp->sh_addr,
2507 shp->sh_size, shp->sh_offset) < 0) {
2576 shp = (Shdr *)
2580 sp->st_value += shp->sh_addr;
2630 Shdr *shp;
2644 shp = (Shdr *)(mp->shdrs + mp->hdr.e_shstrndx * mp->hdr.e_shentsize);
2645 shstrlen = shp->sh_size;
2648 if (kobj_read_file(file, shstrtab, shstrlen, shp->sh_offset) < 0) {
2658 shp = (Shdr *)(mp->shdrs + i * mp->hdr.e_shentsize);
2660 if (shp->sh_size != 0 && shp->sh_name < shstrlen &&
2661 strcmp(shstrtab + shp->sh_name, ".SUNW_ctf") == 0) {
2662 ctfdata = kobj_alloc(shp->sh_size, KM_WAIT|KM_SCRATCH);
2664 if (kobj_read_file(file, ctfdata, shp->sh_size,
2665 shp->sh_offset) < 0) {
2668 kobj_free(ctfdata, shp->sh_size);
2674 mp->ctfsize = shp->sh_size;
2695 Shdr *shp;
2701 shp = (Shdr *)(mp->shdrs + shn * mp->hdr.e_shentsize);
2702 if (!(shp->sh_flags & SHF_ALLOC) || shp->sh_size == 0)
2706 * The check should ideally be shp->sh_type == SHT_NOBITS.
2710 if (strcmp(shstrtab + shp->sh_name, ".bss") == 0)
2716 " %s data size=%d\n", shstrtab + shp->sh_name,
2717 shp->sh_size);
2719 ASSERT(shp->sh_addr != NULL);
2720 SHA1Update(&ctx, (const uint8_t *)shp->sh_addr, shp->sh_size);
2737 Shdr *shp;
2748 shp = (Shdr *)(mp->shdrs + mp->hdr.e_shstrndx * mp->hdr.e_shentsize);
2749 shstrlen = shp->sh_size;
2752 if (kobj_read_file(file, shstrtab, shstrlen, shp->sh_offset) < 0) {
2762 shp = (Shdr *)(mp->shdrs + i * mp->hdr.e_shentsize);
2763 if (shp->sh_size != 0 && shp->sh_name < shstrlen &&
2764 strcmp(shstrtab + shp->sh_name,
2767 size_t sigsize = shp->sh_size + SHA1_DIGEST_LENGTH;
2770 if (kobj_read_file(file, sigdata, shp->sh_size,
2771 shp->sh_offset) < 0) {
2796 crypto_es_hash(mp, sigdata + shp->sh_size, shstrtab);