Lines Matching refs:sp
251 Shdr *sp;
469 sp = (Shdr *)(elfdata + ep->e_shoff);
486 sp++;
491 sp->sh_name = SHSTR_NDX_shstrtab;
492 sp->sh_type = SHT_STRTAB;
493 sp->sh_flags = SHF_STRINGS;
494 sp->sh_addr = 0;
495 sp->sh_offset = off;
496 sp->sh_size = sizeof (shstr);
497 sp->sh_link = 0;
498 sp->sh_info = 0;
499 sp->sh_addralign = 1;
500 sp->sh_entsize = 0;
503 off += roundup(sp->sh_size, SH_ADDRALIGN);
504 sp++;
510 sp->sh_name = SHSTR_NDX_SUNW_ldynsym;
511 sp->sh_type = SHT_SUNW_LDYNSYM;
512 sp->sh_flags = SHF_ALLOC;
513 sp->sh_addr = d[DI_SUNW_SYMTAB]->d_un.d_ptr;
515 sp->sh_addr += addr;
516 sp->sh_offset = off;
517 sp->sh_size = ldynsym_size;
518 sp->sh_link = dynstr_shndx;
520 sp->sh_info = sp->sh_size / sizeof (Sym);
521 sp->sh_addralign = SH_ADDRALIGN;
522 sp->sh_entsize = sizeof (Sym);
524 if (Pread(P, &elfdata[off], sp->sh_size,
525 sp->sh_addr) != sp->sh_size) {
527 (long)sp->sh_addr);
530 off += sp->sh_size;
532 sp++;
538 sp->sh_name = SHSTR_NDX_dynsym;
539 sp->sh_type = SHT_DYNSYM;
540 sp->sh_flags = SHF_ALLOC;
541 sp->sh_addr = d[DI_SYMTAB]->d_un.d_ptr;
543 sp->sh_addr += addr;
544 sp->sh_offset = off;
545 sp->sh_size = dynsym_size;
546 sp->sh_link = dynstr_shndx;
547 sp->sh_info = 1; /* Index of 1st global in table */
548 sp->sh_addralign = SH_ADDRALIGN;
549 sp->sh_entsize = sizeof (Sym);
551 if (Pread(P, &elfdata[off], sp->sh_size,
552 sp->sh_addr) != sp->sh_size) {
554 (long)sp->sh_addr);
558 off += roundup(sp->sh_size, SH_ADDRALIGN);
559 sp++;
564 sp->sh_name = SHSTR_NDX_dynstr;
565 sp->sh_type = SHT_STRTAB;
566 sp->sh_flags = SHF_ALLOC | SHF_STRINGS;
567 sp->sh_addr = d[DI_STRTAB]->d_un.d_ptr;
569 sp->sh_addr += addr;
570 sp->sh_offset = off;
571 sp->sh_size = d[DI_STRSZ]->d_un.d_val;
572 sp->sh_link = 0;
573 sp->sh_info = 0;
574 sp->sh_addralign = 1;
575 sp->sh_entsize = 0;
577 if (Pread(P, &elfdata[off], sp->sh_size,
578 sp->sh_addr) != sp->sh_size) {
582 off += roundup(sp->sh_size, SH_ADDRALIGN);
583 sp++;
588 sp->sh_name = SHSTR_NDX_dynamic;
589 sp->sh_type = SHT_DYNAMIC;
590 sp->sh_flags = SHF_WRITE | SHF_ALLOC;
591 sp->sh_addr = phdr->p_vaddr;
593 sp->sh_addr -= addr;
594 sp->sh_offset = off;
595 sp->sh_size = phdr->p_filesz;
596 sp->sh_link = dynstr_shndx;
597 sp->sh_info = 0;
598 sp->sh_addralign = SH_ADDRALIGN;
599 sp->sh_entsize = sizeof (Dyn);
601 (void) memcpy(&elfdata[off], dp, sp->sh_size);
602 off += roundup(sp->sh_size, SH_ADDRALIGN);
603 sp++;
684 sp->sh_name = SHSTR_NDX_plt;
685 sp->sh_type = SHT_PROGBITS;
686 sp->sh_flags = SHF_WRITE | SHF_ALLOC | SHF_EXECINSTR;
687 sp->sh_addr = sym.st_value;
689 sp->sh_addr += addr;
690 sp->sh_offset = off;
691 sp->sh_size = pltsz;
692 sp->sh_link = 0;
693 sp->sh_info = 0;
694 sp->sh_addralign = SH_ADDRALIGN;
695 sp->sh_entsize = M_PLT_ENTSIZE;
697 if (Pread(P, &elfdata[off], sp->sh_size, sp->sh_addr) !=
698 sp->sh_size) {
700 (long)sp->sh_addr);
703 off += roundup(sp->sh_size, SH_ADDRALIGN);
704 sp++;
708 sp++;
709 assert(((uintptr_t)(sp) - 1) < ((uintptr_t)elfdata + size));