Lines Matching refs:rc

75 _libelf_compute_section_extents(Elf *e, Elf_Scn *s, off_t *rc)
121 if ((size_t) *rc < sh_offset + sh_size)
122 *rc = sh_offset + sh_size;
205 sh_offset = roundup(*rc, sh_align);
220 if ((size_t) *rc < sh_offset + sh_size)
221 *rc = sh_offset + sh_size;
267 _libelf_resync_sections(Elf *e, off_t rc)
281 nrc = rc;
296 if (s->s_offset < (uint64_t) rc) {
297 if (s->s_offset + s->s_size < (uint64_t) rc) {
312 rc = s->s_offset + s->s_size;
315 assert(nrc == rc);
317 return (rc);
327 off_t rc, phoff, shoff;
332 rc = 0;
408 rc += _libelf_fsize(ELF_T_EHDR, ec, eh_version, (size_t) 1);
423 if (rc > phoff) {
434 phoff = roundup(rc, align);
436 rc = phoff + fsz;
445 if ((rc = _libelf_resync_sections(e, rc)) < 0)
457 if (rc > shoff) {
467 shoff = roundup(rc, align);
469 rc = shoff + fsz * shnum;
494 return (rc);
502 _libelf_write_scn(Elf *e, char *nf, Elf_Scn *s, off_t rc)
520 return (rc);
545 if ((uint64_t) rc < sh_off + d->d_off)
546 (void) memset(nf + rc,
548 d->d_off - rc);
549 rc = sh_off + d->d_off;
555 (void) memcpy(nf + rc,
558 rc += d->d_size;
561 return (rc);
574 if ((uint64_t) rc < sh_off + d->d_off)
575 (void) memset(nf + rc,
576 LIBELF_PRIVATE(fillchar), sh_off + d->d_off - rc);
578 rc = sh_off + d->d_off;
589 dst.d_buf = nf + rc;
596 rc += fsz;
599 return ((off_t) rc);
623 off_t rc;
674 rc = 0;
676 dst.d_buf = newfile + rc;
683 rc += fsz;
690 assert((unsigned) rc <= phoff);
710 if ((uint64_t) rc < phoff)
711 (void) memset(newfile + rc,
712 LIBELF_PRIVATE(fillchar), phoff - rc);
714 dst.d_buf = newfile + rc;
720 rc = phoff + fsz;
728 if ((rc = _libelf_write_scn(e, newfile, scn, rc)) < 0)
736 assert((unsigned) rc <= shoff);
738 if ((uint64_t) rc < shoff)
739 (void) memset(newfile + rc,
740 LIBELF_PRIVATE(fillchar), shoff - rc);
742 rc = shoff;
744 assert(rc % _libelf_falign(ELF_T_SHDR, ec) == 0);
759 dst.d_buf = newfile + rc;
765 rc += fsz;
772 assert(rc == newsize);
826 return (rc);
838 off_t rc;
840 rc = (off_t) -1;
845 return (rc);
850 return (rc);
858 return (rc);
861 if ((rc = _libelf_resync_elf(e)) < 0)
862 return (rc);
865 return (rc);
884 return (_libelf_write_elf(e, rc));