Lines Matching defs:ex
359 struct _Elf_Extent *ex;
361 while ((ex = SLIST_FIRST(extents)) != NULL) {
363 free(ex);
419 struct _Elf_Extent *ex, *prevt;
435 if ((ex = malloc(sizeof(struct _Elf_Extent))) == NULL) {
439 ex->ex_start = start;
440 ex->ex_size = size;
441 ex->ex_desc = desc;
442 ex->ex_type = type;
446 SLIST_INSERT_AFTER(prevt, ex, ex_next);
448 SLIST_INSERT_HEAD(extents, ex, ex_next);
727 _libelf_write_scn(Elf *e, unsigned char *nf, struct _Elf_Extent *ex)
739 assert(ex->ex_type == ELF_EXTENT_SECTION);
741 s = ex->ex_desc;
742 rc = (off_t) ex->ex_start;
853 _libelf_write_ehdr(Elf *e, unsigned char *nf, struct _Elf_Extent *ex)
860 assert(ex->ex_type == ELF_EXTENT_EHDR);
861 assert(ex->ex_start == 0); /* Ehdr always comes first. */
897 _libelf_write_phdr(Elf *e, unsigned char *nf, struct _Elf_Extent *ex)
907 assert(ex->ex_type == ELF_EXTENT_PHDR);
928 assert(ex->ex_start == phoff);
945 dst.d_buf = nf + ex->ex_start;
959 _libelf_write_shdr(Elf *e, unsigned char *nf, struct _Elf_Extent *ex)
970 assert(ex->ex_type == ELF_EXTENT_SHDR);
991 assert(ex->ex_start == shoff);
1012 dst.d_buf = nf + ex->ex_start + scn->s_ndx * fsz;
1019 return ((off_t) (ex->ex_start + nscn * fsz));
1044 struct _Elf_Extent *ex;
1057 SLIST_FOREACH(ex, extents, ex_next) {
1060 if (ex->ex_start > (size_t) rc)
1062 (size_t) (ex->ex_start - (uint64_t) rc));
1064 switch (ex->ex_type) {
1066 if ((nrc = _libelf_write_ehdr(e, newfile, ex)) < 0)
1071 if ((nrc = _libelf_write_phdr(e, newfile, ex)) < 0)
1076 if ((nrc = _libelf_write_scn(e, newfile, ex)) < 0)
1081 if ((nrc = _libelf_write_shdr(e, newfile, ex)) < 0)
1090 assert(ex->ex_start + ex->ex_size == (size_t) nrc);