Lines Matching refs:ex
350 struct _Elf_Extent *ex; in _libelf_release_extents() local
352 while ((ex = SLIST_FIRST(extents)) != NULL) { in _libelf_release_extents()
354 free(ex); in _libelf_release_extents()
410 struct _Elf_Extent *ex, *prevt; in _libelf_insert_extent() local
426 if ((ex = malloc(sizeof(struct _Elf_Extent))) == NULL) { in _libelf_insert_extent()
430 ex->ex_start = start; in _libelf_insert_extent()
431 ex->ex_size = size; in _libelf_insert_extent()
432 ex->ex_desc = desc; in _libelf_insert_extent()
433 ex->ex_type = type; in _libelf_insert_extent()
437 SLIST_INSERT_AFTER(prevt, ex, ex_next); in _libelf_insert_extent()
439 SLIST_INSERT_HEAD(extents, ex, ex_next); in _libelf_insert_extent()
718 _libelf_write_scn(Elf *e, unsigned char *nf, struct _Elf_Extent *ex) in _libelf_write_scn() argument
730 assert(ex->ex_type == ELF_EXTENT_SECTION); in _libelf_write_scn()
732 s = ex->ex_desc; in _libelf_write_scn()
733 rc = (off_t) ex->ex_start; in _libelf_write_scn()
845 _libelf_write_ehdr(Elf *e, unsigned char *nf, struct _Elf_Extent *ex) in _libelf_write_ehdr() argument
852 assert(ex->ex_type == ELF_EXTENT_EHDR); in _libelf_write_ehdr()
853 assert(ex->ex_start == 0); /* Ehdr always comes first. */ in _libelf_write_ehdr()
889 _libelf_write_phdr(Elf *e, unsigned char *nf, struct _Elf_Extent *ex) in _libelf_write_phdr() argument
899 assert(ex->ex_type == ELF_EXTENT_PHDR); in _libelf_write_phdr()
920 assert(ex->ex_start == phoff); in _libelf_write_phdr()
937 dst.d_buf = nf + ex->ex_start; in _libelf_write_phdr()
951 _libelf_write_shdr(Elf *e, unsigned char *nf, struct _Elf_Extent *ex) in _libelf_write_shdr() argument
962 assert(ex->ex_type == ELF_EXTENT_SHDR); in _libelf_write_shdr()
983 assert(ex->ex_start == shoff); in _libelf_write_shdr()
1004 dst.d_buf = nf + ex->ex_start + scn->s_ndx * fsz; in _libelf_write_shdr()
1011 return ((off_t) (ex->ex_start + nscn * fsz)); in _libelf_write_shdr()
1036 struct _Elf_Extent *ex; in _libelf_write_elf() local
1049 SLIST_FOREACH(ex, extents, ex_next) { in _libelf_write_elf()
1052 if (ex->ex_start > (size_t) rc) in _libelf_write_elf()
1054 (size_t) (ex->ex_start - (uint64_t) rc)); in _libelf_write_elf()
1056 switch (ex->ex_type) { in _libelf_write_elf()
1058 if ((nrc = _libelf_write_ehdr(e, newfile, ex)) < 0) in _libelf_write_elf()
1063 if ((nrc = _libelf_write_phdr(e, newfile, ex)) < 0) in _libelf_write_elf()
1068 if ((nrc = _libelf_write_scn(e, newfile, ex)) < 0) in _libelf_write_elf()
1073 if ((nrc = _libelf_write_shdr(e, newfile, ex)) < 0) in _libelf_write_elf()
1082 assert(ex->ex_start + ex->ex_size == (size_t) nrc); in _libelf_write_elf()