Lines Matching refs:offset

288 	Off		offset;	/* File offset of data. Ignored unless */
390 * segment that contains it and return the offset within the ELF file
408 * to program header that contains offset.
411 * is non-NULL, it is updated. The file offset is returned.
415 * offset for a virtual address, and is therefore unambiguous as
422 Off offset;
436 * offset relative to the segment (not the file).
438 offset = addr - phdr->p_vaddr;
439 avail_file = phdr->p_filesz - offset;
459 /* Add segment file offset, giving overall offset */
460 return (phdr->p_offset + offset);
472 * it goes the other way, mapping from offset to virtual address.
475 * reverse offset and address.
479 map_offset_to_addr(FSTATE *fstate, Off offset, size_t size, size_t *zero_bytes,
482 Off end_offset = offset + size;
491 if ((offset >= phdr->p_offset) &&
494 * Subtract segment offset, leaving the
495 * offset relative to the segment (not the file).
497 offset -= phdr->p_offset;
498 avail_file = phdr->p_filesz - offset;
501 * The offset/size are in bounds for this segment.
519 return (phdr->p_vaddr + offset);
559 * Read nbytes of data into buf, starting at the specified offset
564 * offset - Offset within the file at which desired data resides.
580 read_data(FSTATE *fstate, Off offset, void *buf, size_t nbyte,
583 if (pread(fstate->fd, buf, nbyte, offset) != nbyte) {
613 Off offset;
616 offset = map_addr_to_offset(fstate, hash_sinfo->vaddr,
618 if (offset == 0)
621 if (read_data(fstate, offset, buf, sizeof (buf), ELF_T_WORD) == 0)
633 * Read a Verdef structure at the specified file offset and return
637 read_verdef(FSTATE *fstate, Off offset, Half *cnt, Word *aux, Word *next)
641 if (read_data(fstate, offset, &verdef, sizeof (verdef),
668 * Read a Verdaux structure at the specified file offset and return
672 read_verdaux(FSTATE *fstate, Off offset, Word *next)
676 if (read_data(fstate, offset, &verdaux, sizeof (verdaux),
693 * Read a Verneed structure at the specified file offset and return
697 read_verneed(FSTATE *fstate, Off offset, Half *cnt, Word *aux, Word *next)
701 if (read_data(fstate, offset, &verneed, sizeof (verneed),
728 * Read a Vernaux structure at the specified file offset and return
732 read_vernaux(FSTATE *fstate, Off offset, Word *next)
736 if (read_data(fstate, offset, &vernaux, sizeof (vernaux),
765 * aux field that gives the offset of the first auxiliary block, and
766 * an offset to the next main block. Each auxiliary block contains
767 * an offset to the next auxiliary block. By breaking the type specific
786 Off offset, aux_offset;
810 * Map starting address to file offset. Save the starting offset
811 * in the SINFO size field. Once we have the high water offset, we
818 offset = highwater = map_addr_to_offset(fstate, sec->vaddr,
820 if (offset == 0)
822 sec->size = offset;
824 for (; num_main-- > 0; offset += v_next) {
826 extent = offset + size_main;
830 if ((*read_main)(fstate, offset, &v_cnt, &v_aux, &v_next) == 0)
838 aux_offset = offset + v_aux;
902 * sh_name should be the offset of the name in the shstrtab
913 * 0) and offset through without inspection.
916 sec->shdr->sh_offset = sec->offset;
921 * real address by mapping the offset to it using the
924 sec->shdr->sh_addr = map_offset_to_addr(fstate, sec->offset,
926 sec->shdr->sh_offset = sec->offset;
930 * to derive the offset.
1204 sinfo->offset = fstate.phdr[ndx].p_offset;