Lines Matching defs:offset_tbl

330 sort_offsettbl(int	segcnt, seg_info_t	*offset_tbl)
338 if (offset_tbl[cntx].offset >
339 offset_tbl[cnty].offset) {
340 (void) memcpy(&tmp, &offset_tbl[cnty],
342 (void) memcpy(&offset_tbl[cnty],
343 &offset_tbl[cntx], sizeof (seg_info_t));
345 (void) memcpy(&offset_tbl[cntx], &tmp,
391 seg_info_t *offset_tbl)
398 if (!offset_tbl[cnt - 1].fixed) {
399 if (offset_tbl[cnt].offset -
400 (offset_tbl[cnt -1 ].offset +
401 offset_tbl[cnt - 1].length) > 0) {
403 diff = offset_tbl[cnt].offset -
404 (offset_tbl[cnt - 1].offset +
405 offset_tbl[cnt - 1].length);
406 newoffset = offset_tbl[cnt - 1].offset + diff;
410 offset_tbl[cnt - 1].offset = newoffset;
412 sort_offsettbl(segcnt, offset_tbl);
427 seg_info_t *offset_tbl)
438 offset_tbl[cnt].segnum = cnt;
439 offset_tbl[cnt].offset = segment->offset;
440 offset_tbl[cnt].length = segment->length;
441 offset_tbl[cnt].fixed = segdesc.field.fixed;
445 offset_tbl[cnt].segnum = -1;
446 offset_tbl[cnt].offset = sizeof (section_layout_t) +
449 offset_tbl[cnt].length = 0;
450 offset_tbl[cnt].fixed = 1;
453 offset_tbl[cnt+1].segnum = -1;
454 offset_tbl[cnt+1].offset = secsize;
455 offset_tbl[cnt+1].length = 0;
456 offset_tbl[cnt+1].fixed = 1;
461 hole_discovery(int bytes, int segcnt, int *totsize, seg_info_t *offset_tbl)
467 if (bytes <= offset_tbl[cnt].offset -
468 (offset_tbl[cnt - 1].offset +
469 offset_tbl[cnt - 1].length)) {
470 return (offset_tbl[cnt].offset - bytes);
473 *totsize += offset_tbl[cnt].offset -
474 (offset_tbl[cnt - 1].offset + offset_tbl[cnt - 1].length);
486 segment_hdr_present(int segoffset, int size, seg_info_t *offset_tbl)
488 if ((segoffset + size) <= offset_tbl[0].offset)
506 seg_info_t *offset_tbl;
523 offset_tbl = malloc((segcnt + 2) * sizeof (seg_info_t));
524 if (offset_tbl == NULL) {
529 ret = build_offset_tbl(seghdr, segcnt, secsize, offset_tbl);
531 free(offset_tbl);
536 sort_offsettbl(segcnt, offset_tbl);
544 offset_tbl);
548 if (offset_tbl[0].fixed == SEGMENT_FIXED) { /* fixed segment */
549 free(offset_tbl);
553 newoffset = hole_discovery(offset_tbl[0].length, segcnt,
554 &totsize, offset_tbl);
557 offset_tbl[0].offset = newoffset;
562 sort_offsettbl(segcnt, offset_tbl);
565 if (totsize > offset_tbl[0].length) {
567 offset_tbl);
569 free(offset_tbl);
576 newoffset = hole_discovery(segsize, segcnt, &totsize, offset_tbl);
580 pack_segment_data(seghdr, segcnt, contfd, offset_tbl);
582 offset_tbl);
585 free(offset_tbl);
591 free(offset_tbl);
594 free(offset_tbl);