• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /freebsd-12-stable/contrib/llvm-project/lld/lib/ReaderWriter/MachO/

Lines Matching refs:section

104 /// Figures out ContentType of a mach-o section.
105 DefinedAtom::ContentType atomTypeFromSection(const Section &section,
111 if (p->sectionType != section.type)
113 if (!p->segmentName.equals(section.segmentName) && !p->segmentName.empty())
115 if (!p->sectionName.equals(section.sectionName) && !p->sectionName.empty())
120 // Look for code denoted by section attributes
121 if (section.attributes & S_ATTR_PURE_INSTRUCTIONS)
138 /// Returns info on how to atomize a section of the specified ContentType.
239 void atomFromSymbol(DefinedAtom::ContentType atomType, const Section &section,
246 uint64_t offset = symbolAddr - section.address;
248 if (isZeroFillSection(section.type)) {
250 noDeadStrip, copyRefs, &section);
256 // Mach-O needs a segment and section name. Concatenate those two
258 // of just a section name.
259 std::string segSectName = section.segmentName.str()
260 + "/" + section.sectionName.str();
263 size, segSectName, true, &section);
270 offset, size, thumb, noDeadStrip, copyRefs, &section);
276 const Section &section,
280 // Find section's index.
283 if (&sect == &section)
288 // Find all symbols in this section.
324 // If section has no symbols and no content, there are no atoms.
325 if (symbols.empty() && section.content.empty())
330 atomFromSymbol(atomType, section, file, section.address, StringRef(),
332 section.address + section.content.size(),
335 else if (symbols.front()->value != section.address) {
337 atomFromSymbol(atomType, section, file, section.address, StringRef(),
345 // Ignore any assembler added "ltmpNNN" symbol at start of section
348 || lastSym->value != section.address
350 atomFromSymbol(atomType, section, file, lastSym->value, lastSym->name,
358 atomFromSymbol(atomType, section, file, lastSym->value, lastSym->name,
360 section.address + section.content.size(),
367 file.eachAtomInSection(section,
381 const Section &section,
389 // Get info on how to atomize section.
396 // Validate section size.
397 if ((section.content.size() % sizeMultiple) != 0)
399 + section.segmentName
400 + "/" + section.sectionName
402 + Twine(section.content.size())
407 // Break section up into atoms each with a fixed size.
408 return processSymboledSection(atomType, section, normalizedFile, file,
412 for (unsigned int offset = 0, e = section.content.size(); offset != e;) {
415 // Break section up into atoms each with a fixed size.
419 // Break section up into atoms each the size of a pointer.
423 // Break section up into zero terminated c-strings.
426 if (section.content[i] == 0) {
433 // Break section up into zero terminated UTF16 strings.
436 if ((section.content[i] == 0) && (section.content[i + 1] == 0)) {
443 // Break section up into dwarf unwind CFIs (FDE or CIE).
444 size = read32(&section.content[offset], isBig) + 4;
445 if (offset+size > section.content.size()) {
447 + section.segmentName
448 + "/" + section.sectionName
452 + ") is past end of section.");
456 // Break section up into compact unwind entries.
460 // Break section up into NS/CFString objects.
468 + section.segmentName
469 + "/" + section.sectionName
474 // Mach-O needs a segment and section name. Concatenate those two
476 // of just a section name.
477 std::string segSectName = section.segmentName.str()
478 + "/" + section.sectionName.str();
481 size, segSectName, true, &section);
484 false, false, copyRefs, &section);
519 // Walks all relocations for a section in a normalized .o file and
521 llvm::Error convertRelocs(const Section &section,
531 return llvm::make_error<GenericError>(Twine("out of range section "
538 + ") is not in any section"));
574 return llvm::make_error<GenericError>(Twine("symbol section index (")
600 for (auto it=section.relocations.begin(), e=section.relocations.end();
604 if (reloc.offset > section.content.size())
607 + ") is larger than section size ("
608 + Twine(section.content.size()) + ")");
610 MachODefinedAtom *inAtom = file.findAtomCoveringAddress(section,
614 uint64_t fixupAddress = section.address + reloc.offset;
630 + ") in section "
631 + section.segmentName + "/" + section.sectionName
666 + ") in section "
667 + section.segmentName + "/" + section.sectionName
689 bool isDebugInfoSection(const Section &section) {
690 if ((section.attributes & S_ATTR_DEBUG) == 0)
692 return section.segmentName.equals("__DWARF");
964 return llvm::make_error<GenericError>("Malformed __debug_info section in " +
968 return llvm::make_error<GenericError>("Missing __dwarf_abbrev section in " +
1259 // 32-bit byte offset backwards in the __eh_frame section).
1324 for (auto &section : normalizedFile.sections)
1325 if (section.segmentName == "__TEXT" &&
1326 section.sectionName == "__eh_frame") {
1327 ehFrameSection = &section;
1437 // Create atoms from each section.
1440 // If this is a debug-info section parse it specially.
1449 // We then skip adding atoms for this section as we use the ObjCPass to
1489 // Each __eh_frame section needs references to both __text (the function we're
1505 + ") is not in any section"));