Lines Matching refs:ws

1161 	struct writesegs_state ws;
1165 ws.p = p;
1166 ws.iocookie = cookie;
1167 ws.psections = NULL;
1174 coredump_walk_elf, &ws);
1178 error = coredump_write(cookie, UIO_SYSSPACE, ws.psections,
1179 ws.psectionslen, 0);
1189 if (notesize != ws.notesize)
1191 ws.notesize, notesize);
1192 offset = ws.notestart + notesize;
1193 if (offset != ws.secstart)
1195 (long long) offset, (long long) ws.secstart);
1199 for (i = 0; i < ws.npsections - 1; i++) {
1200 Elf_Phdr *pent = &ws.psections[i];
1231 offset += ws.psections[i].p_filesz;
1236 free(ws.psections, M_TEMP, ws.psectionslen);
1276 struct writesegs_state *ws = cookie;
1281 ws->npsections = segment_count + 1;
1284 error = coredump_notes_elf(ws->p, NULL, &ws->notesize);
1306 if (ws->npsections < PN_XNUM) {
1309 ehdr.e_phnum = ws->npsections;
1324 error = coredump_write(ws->iocookie, UIO_SYSSPACE, &ehdr, sizeof(ehdr), 0);
1333 Elf_Shdr shdr = { .sh_info = ws->npsections };
1334 error = coredump_write(ws->iocookie, UIO_SYSSPACE, &shdr,
1338 error = coredump_write(ws->iocookie, UIO_SYSSPACE, &shstrtab,
1348 ws->psections = mallocarray(ws->npsections, sizeof(Elf_Phdr),
1350 if (ws->psections == NULL)
1352 ws->psectionslen = ws->npsections * sizeof(Elf_Phdr);
1354 ws->notestart = ehdr.e_phoff + ws->psectionslen;
1355 ws->secstart = ws->notestart + ws->notesize;
1356 ws->secoff = ws->secstart;
1359 note = &ws->psections[ws->npsections - 1];
1361 note->p_offset = ws->notestart;
1364 note->p_filesz = ws->notesize;
1376 struct writesegs_state *ws = cookie;
1384 phdr.p_offset = ws->secoff;
1400 ws->secoff += phdr.p_filesz;
1401 ws->psections[nsegment] = phdr;