Lines Matching refs:ex

351 	struct _Elf_Extent *ex;  in _libelf_release_extents()  local
353 while ((ex = SLIST_FIRST(extents)) != NULL) { in _libelf_release_extents()
355 free(ex); in _libelf_release_extents()
411 struct _Elf_Extent *ex, *prevt; in _libelf_insert_extent() local
427 if ((ex = malloc(sizeof(struct _Elf_Extent))) == NULL) { in _libelf_insert_extent()
431 ex->ex_start = start; in _libelf_insert_extent()
432 ex->ex_size = size; in _libelf_insert_extent()
433 ex->ex_desc = desc; in _libelf_insert_extent()
434 ex->ex_type = type; in _libelf_insert_extent()
438 SLIST_INSERT_AFTER(prevt, ex, ex_next); in _libelf_insert_extent()
440 SLIST_INSERT_HEAD(extents, ex, ex_next); in _libelf_insert_extent()
719 _libelf_write_scn(Elf *e, unsigned char *nf, struct _Elf_Extent *ex) in _libelf_write_scn() argument
731 assert(ex->ex_type == ELF_EXTENT_SECTION); in _libelf_write_scn()
733 s = ex->ex_desc; in _libelf_write_scn()
734 rc = (off_t) ex->ex_start; in _libelf_write_scn()
848 _libelf_write_ehdr(Elf *e, unsigned char *nf, struct _Elf_Extent *ex) in _libelf_write_ehdr() argument
855 assert(ex->ex_type == ELF_EXTENT_EHDR); in _libelf_write_ehdr()
856 assert(ex->ex_start == 0); /* Ehdr always comes first. */ in _libelf_write_ehdr()
892 _libelf_write_phdr(Elf *e, unsigned char *nf, struct _Elf_Extent *ex) in _libelf_write_phdr() argument
902 assert(ex->ex_type == ELF_EXTENT_PHDR); in _libelf_write_phdr()
923 assert(ex->ex_start == phoff); in _libelf_write_phdr()
940 dst.d_buf = nf + ex->ex_start; in _libelf_write_phdr()
954 _libelf_write_shdr(Elf *e, unsigned char *nf, struct _Elf_Extent *ex) in _libelf_write_shdr() argument
965 assert(ex->ex_type == ELF_EXTENT_SHDR); in _libelf_write_shdr()
986 assert(ex->ex_start == shoff); in _libelf_write_shdr()
1007 dst.d_buf = nf + ex->ex_start + scn->s_ndx * fsz; in _libelf_write_shdr()
1014 return ((off_t) (ex->ex_start + nscn * fsz)); in _libelf_write_shdr()
1039 struct _Elf_Extent *ex; in _libelf_write_elf() local
1052 SLIST_FOREACH(ex, extents, ex_next) { in _libelf_write_elf()
1055 if (ex->ex_start > (size_t) rc) in _libelf_write_elf()
1057 (size_t) (ex->ex_start - (uint64_t) rc)); in _libelf_write_elf()
1059 switch (ex->ex_type) { in _libelf_write_elf()
1061 if ((nrc = _libelf_write_ehdr(e, newfile, ex)) < 0) in _libelf_write_elf()
1066 if ((nrc = _libelf_write_phdr(e, newfile, ex)) < 0) in _libelf_write_elf()
1071 if ((nrc = _libelf_write_scn(e, newfile, ex)) < 0) in _libelf_write_elf()
1076 if ((nrc = _libelf_write_shdr(e, newfile, ex)) < 0) in _libelf_write_elf()
1085 assert(ex->ex_start + ex->ex_size == (size_t) nrc); in _libelf_write_elf()