Lines Matching full:segment
196 fprintf(stderr, "%s: the load command for segment '%s'" in SectionsMissing()
202 fprintf(stderr, "%s: the segment '%s' claims its contents lie beyond" in MisplacedSegmentData()
207 const string &segment) { in MisplacedSectionData() argument
208 fprintf(stderr, "%s: the section '%s' in segment '%s'" in MisplacedSectionData()
209 " claims its contents lie outside the segment's contents\n", in MisplacedSectionData()
210 filename_.c_str(), section.c_str(), segment.c_str()); in MisplacedSectionData()
337 Segment segment; in WalkLoadCommands() local
338 segment.bits_64 = (type == LC_SEGMENT_64); in WalkLoadCommands()
339 size_t word_size = segment.bits_64 ? 8 : 4; in WalkLoadCommands()
340 cursor.CString(&segment.name, 16); in WalkLoadCommands()
343 .Read(word_size, false, &segment.vmaddr) in WalkLoadCommands()
344 .Read(word_size, false, &segment.vmsize) in WalkLoadCommands()
347 cursor >> segment.maxprot in WalkLoadCommands()
348 >> segment.initprot in WalkLoadCommands()
349 >> segment.nsects in WalkLoadCommands()
350 >> segment.flags; in WalkLoadCommands()
357 reporter_->MisplacedSegmentData(segment.name); in WalkLoadCommands()
365 segment.contents.start = segment.contents.end = NULL; in WalkLoadCommands()
367 segment.contents.start = buffer_.start + file_offset; in WalkLoadCommands()
368 segment.contents.end = segment.contents.start + file_size; in WalkLoadCommands()
371 segment.section_list.start = cursor.here(); in WalkLoadCommands()
372 segment.section_list.end = command.end; in WalkLoadCommands()
374 if (!handler->SegmentCommand(segment)) in WalkLoadCommands()
417 // A load command handler that looks for a segment of a given name.
420 // Create a load command handler that looks for a segment named NAME,
421 // and sets SEGMENT to describe it if found.
422 SegmentFinder(const string &name, Segment *segment) in SegmentFinder() argument
423 : name_(name), segment_(segment), found_() { } in SegmentFinder()
425 // Return true if the traversal found the segment, false otherwise.
428 bool SegmentCommand(const Segment &segment) { in SegmentCommand() argument
429 if (segment.name == name_) { in SegmentCommand()
430 *segment_ = segment; in SegmentCommand()
438 // The name of the segment our creator is looking for.
441 // Where we should store the segment if found. (WEAK)
442 Segment *segment_;
444 // True if we found the segment.
448 bool Reader::FindSegment(const string &name, Segment *segment) const { in FindSegment()
449 SegmentFinder finder(name, segment); in FindSegment()
454 bool Reader::WalkSegmentSections(const Segment &segment, in WalkSegmentSections() argument
456 size_t word_size = segment.bits_64 ? 8 : 4; in WalkSegmentSections()
457 ByteCursor cursor(&segment.section_list, big_endian_); in WalkSegmentSections()
459 for (size_t i = 0; i < segment.nsects; i++) { in WalkSegmentSections()
461 section.bits_64 = segment.bits_64; in WalkSegmentSections()
479 reporter_->SectionsMissing(segment.name); in WalkSegmentSections()
485 } else if (segment.contents.start == NULL && in WalkSegmentSections()
486 segment.contents.end == NULL) { in WalkSegmentSections()
495 if (offset < size_t(segment.contents.start - buffer_.start) || in WalkSegmentSections()
496 offset > size_t(segment.contents.end - buffer_.start) || in WalkSegmentSections()
497 size > size_t(segment.contents.end - buffer_.start - offset)) { in WalkSegmentSections()
512 // given segment.
527 bool Reader::MapSegmentSections(const Segment &segment, in MapSegmentSections() argument
531 return WalkSegmentSections(segment, &mapper); in MapSegmentSections()