/freebsd/contrib/llvm-project/lld/MachO/ |
H A D | MarkLive.cpp | 27 InputSection *isec; member 31 WhyLiveEntry(InputSection *isec, const WhyLiveEntry *prev) in WhyLiveEntry() 32 : isec(isec), prev(prev) {} in WhyLiveEntry() 39 virtual void enqueue(InputSection *isec, uint64_t off) = 0; 54 void enqueue(InputSection *isec, uint64_t off) override { in enqueue() argument 55 enqueue(isec, off, nullptr); in enqueue() 61 void enqueue(InputSection *isec, uint64_t off, const WorklistEntry *prev); 76 InputSection *isec, uint64_t off, in enqueue() argument 78 if (isec->isLive(off)) in enqueue() 80 isec->markLive(off); in enqueue() [all …]
|
H A D | ConcatOutputSection.cpp | 128 for (ConcatInputSection *isec : inputs) in needsThunks() 129 isecAddr = alignToPowerOf2(isecAddr, isec->align) + isec->getSize(); in needsThunks() 134 for (ConcatInputSection *isec : inputs) { in needsThunks() 135 for (Reloc &r : isec->relocs) { in needsThunks() 148 isec->hasCallSites = true; in needsThunks() 174 InputSection *isec = inputs[i]; in estimateStubsInRangeVA() local 175 isecEnd = alignToPowerOf2(isecEnd, isec->align) + isec->getSize(); in estimateStubsInRangeVA() 196 void ConcatOutputSection::finalizeOne(ConcatInputSection *isec) { in finalizeOne() argument 197 size = alignToPowerOf2(size, isec->align); in finalizeOne() 198 fileSize = alignToPowerOf2(fileSize, isec->align); in finalizeOne() [all …]
|
H A D | InputSection.cpp | 46 if (auto *isec = dyn_cast<ConcatInputSection>(inputSection)) { in addInputSection() local 47 if (isec->isCoalescedWeak()) in addInputSection() 50 ObjCMethListSection::isMethodList(isec)) { in addInputSection() 53 in.objcMethList->addInput(isec); in addInputSection() 54 isec->parent = in.objcMethList; in addInputSection() 58 sectionType(isec->getFlags()) == S_MOD_INIT_FUNC_POINTERS) { in addInputSection() 59 in.initOffsets->addInput(isec); in addInputSection() 62 isec->outSecOff = inputSectionsOrder++; in addInputSection() 63 auto *osec = ConcatOutputSection::getOrCreateForInput(isec); in addInputSection() 64 isec->parent = osec; in addInputSection() [all …]
|
H A D | ICF.cpp | 136 if (!da->isec() || !db->isec()) { in equalsConstant() 140 isecA = da->isec(); in equalsConstant() 142 isecB = db->isec(); in equalsConstant() 194 isecA = dyn_cast<ConcatInputSection>(da->isec()); in equalsVariable() 197 isecB = cast<ConcatInputSection>(db->isec()); in equalsVariable() 287 parallelForEach(icfInputs, [&](ConcatInputSection *isec) { in run() argument 288 uint32_t hash = isec->icfEqClass[icfPass % 2]; in run() 289 for (const Reloc &r : isec->relocs) { in run() 292 if (defined->isec()) { in run() 294 dyn_cast<ConcatInputSection>(defined->isec())) in run() [all …]
|
H A D | SyntheticSections.cpp | 66 isec = makeSyntheticInputSection(segname, name); in SyntheticSection() 67 isec->parent = this; in SyntheticSection() 79 isec->isFinal = true; in MachHeaderSection() 228 loc.isec->parent->getSegmentOffset() + loc.isec->getOffset(loc.offset); in encodeRebases() 284 return a.isec->getVA(a.offset) < b.isec->getVA(b.offset); in finalizeContents() 288 const OutputSegment *seg = locations[i].isec->parent->parent; in finalizeContents() 290 while (j < count && locations[j].isec->parent->parent == seg) in finalizeContents() 309 const InputSection *isec, uint64_t offset, in addNonLazyBindingEntries() argument 313 in.chainedFixups->addBinding(sym, isec, offset, addend); in addNonLazyBindingEntries() 315 in.chainedFixups->addRebase(isec, offset); in addNonLazyBindingEntries() [all …]
|
H A D | ObjC.cpp | 148 const ConcatInputSection *isec; member 192 if (auto *isec = r.referent.dyn_cast<InputSection *>()) in getReferentString() local 193 return cast<CStringInputSection>(isec)->getStringRefAtOffset(r.addend); in getReferentString() 196 auto *symIsec = sym->isec(); in getReferentString() 247 nameReloc = mc.isec->getRelocAt(catLayout.nameOffset); in parseMethods() 250 const auto *roIsec = mc.isec->getRelocAt(classLayout.roDataOffset) in parseMethods() 279 formatObjAndSrcFileName(mc.isec)); in parseMethods() 322 const auto *classIsec = cast<ConcatInputSection>(classSym->isec()); in parseClass() 330 if (const auto *r = classSym->isec()->getRelocAt(classLayout.metaClassOffset)) in parseClass() 340 for (const InputSection *isec : inputSections) { in checkCategories() local [all …]
|
H A D | Relocations.cpp | 27 return d->isec(); in getReferentInputSection() 35 const InputSection *isec, const Reloc &r) { in validateSymbolRelocation() argument 40 return (isec->getLocation(r.offset) + ": " + relocAttrs.name + in validateSymbolRelocation() 83 const ConcatInputSection *isec = osec->inputs[isecIdx]; in offsetToInputSection() local 84 if (*off < isec->outSecOff) in offsetToInputSection() 88 ConcatInputSection *isec = osec->inputs[isecIdx - 1]; in offsetToInputSection() local 89 *off -= isec->outSecOff; in offsetToInputSection() 90 return isec; in offsetToInputSection() 99 const InputSection *isec = offsetToInputSection(&off); in reportRangeError() local 100 std::string locStr = isec ? isec->getLocation(off) : "(invalid location)"; in reportRangeError()
|
H A D | InputFiles.cpp | 368 auto *isec = make<ConcatInputSection>( in parseSections() local 370 subsections.push_back({off, isec}); in parseSections() 381 InputSection *isec = in parseSections() local 384 cast<CStringInputSection>(isec)->splitIntoPieces(); in parseSections() 385 section.subsections.push_back({0, isec}); in parseSections() 390 InputSection *isec = make<WordLiteralInputSection>(section, data, align); in parseSections() local 391 section.subsections.push_back({0, isec}); in parseSections() 413 auto *isec = make<ConcatInputSection>(section, data, align); in parseSections() local 414 if (isDebugSection(isec->getFlags()) && in parseSections() 415 isec->getSegName() == segment_names::dwarf) { in parseSections() [all …]
|
H A D | Symbols.cpp | 55 Defined::Defined(StringRefZ name, InputFile *file, InputSection *isec, in Defined() argument 66 weakDef(isWeakDef), external(isExternal), originalIsec(isec), in Defined() 68 if (isec) { in Defined() 69 isec->symbols.push_back(this); in Defined() 71 for (auto it = isec->symbols.rbegin(), rend = isec->symbols.rend(); in Defined() 94 if (!isec()->isFinal) { in getVA() 105 return isec()->getVA(value); in getVA() 120 InputSection *Defined::isec() const { in isec() function in Defined
|
H A D | SymbolTable.cpp | 97 InputSection *isec, uint64_t value, in addDefined() argument 105 assert(!file || !isa<BitcodeFile>(file) || !isec); in addDefined() 117 if (auto concatIsec = dyn_cast_or_null<ConcatInputSection>(isec)) { in addDefined() 124 if (defined->isec()) in addDefined() 125 transplantSymbolsAtOffset(concatIsec, defined->isec(), in addDefined() 133 dyn_cast_or_null<ConcatInputSection>(defined->isec())) { in addDefined() 135 if (isec) in addDefined() 136 transplantSymbolsAtOffset(concatIsec, isec, defined, defined->value, in addDefined() 141 std::string srcLoc2 = isec ? isec->getSourceLocation(value) : ""; in addDefined() 206 s, name, file, isec, value, size, isWeakDef, /*isExternal=*/true, in addDefined() [all …]
|
H A D | MapFile.cpp | 80 if (d->isec() && d->getFile() == file && in gatherMapInfo() 81 !isa<CStringInputSection>(d->isec())) { in gatherMapInfo() 93 if (auto isec = dyn_cast<CStringInputSection>(subsec.isec)) { in gatherMapInfo() local 94 auto &liveCStrings = info.liveCStringsForSection[isec->parent]; in gatherMapInfo() 95 for (const auto &[i, piece] : llvm::enumerate(isec->pieces)) { in gatherMapInfo() 97 liveCStrings.push_back({isec->parent->addr + piece.outSecOff, in gatherMapInfo() 98 {fileIndex, isec->getStringRef(i)}}); in gatherMapInfo() 100 info.deadCStrings.push_back({fileIndex, isec->getStringRef(i)}); in gatherMapInfo() 208 for (const ConcatInputSection *isec : arr) { in writeMapFile() local 209 for (Defined *sym : isec->symbols) { in writeMapFile()
|
H A D | SyntheticSections.h | 54 InputSection *isec; variable 145 const InputSection *isec; member 148 Location(const InputSection *isec, uint64_t offset) in Location() 149 : isec(isec), offset(offset) {} in Location() 150 uint64_t getVA() const { return isec->getVA(offset); } in getVA() 164 void addEntry(const InputSection *isec, uint64_t offset) { in addEntry() argument 166 locations.emplace_back(isec, offset); in addEntry() 193 void addEntry(const Symbol *dysym, const InputSection *isec, uint64_t offset, 195 bindingsMap[dysym].emplace_back(addend, Location(isec, offset)); 224 void addEntry(const Symbol *symbol, const InputSection *isec, uint64_t offset, [all …]
|
H A D | SectionPriorities.cpp | 85 auto getOrCreateCluster = [&](const InputSection *isec) -> int { in CallGraphSort() argument 86 auto res = secToCluster.try_emplace(isec, clusters.size()); in CallGraphSort() 88 sections.push_back(isec); in CallGraphSort() 89 clusters.emplace_back(clusters.size(), isec->getSize()); in CallGraphSort() 233 const InputSection *isec = sections[i]; in run() local 237 for (Symbol *sym : isec->getFile()->symbols) { in run() 239 if (d->isec() == isec) in run() 261 const InputFile *f = sym->isec()->getFile(); in getSymbolPriority() 290 callGraphProfile[{fromSym->isec(), toSym->isec()}] += entry.count; in extractCallGraphProfile() 373 size_t &priority = sectionPriorities[sym->isec()]; in buildInputSectionPriorities()
|
H A D | InputSection.h | 128 static bool classof(const InputSection *isec) { in classof() argument 129 return isec->kind() == ConcatKind; in classof() 161 inline bool shouldOmitFromOutput(InputSection *isec) { in shouldOmitFromOutput() argument 162 return isa<ConcatInputSection>(isec) && in shouldOmitFromOutput() 163 cast<ConcatInputSection>(isec)->shouldOmitFromOutput(); in shouldOmitFromOutput() 166 inline bool isCoalescedWeak(InputSection *isec) { in isCoalescedWeak() argument 167 return isa<ConcatInputSection>(isec) && in isCoalescedWeak() 168 cast<ConcatInputSection>(isec)->isCoalescedWeak(); in isCoalescedWeak() 236 static bool classof(const InputSection *isec) { in classof() argument 237 return isec->kind() == CStringLiteralKind; in classof() [all …]
|
H A D | EhFrame.h | 93 EhRelocator(InputSection *isec) : isec(isec) {} in EhRelocator() argument 108 InputSection *isec;
|
H A D | Dwarf.cpp | 28 for (const InputSection *isec : obj->debugSections) { in create() local 30 StringSwitch<StringRef *>(isec->getName()) in create() 37 *s = toStringRef(isec->data); in create()
|
/freebsd/contrib/llvm-project/lld/ELF/ |
H A D | Thunks.cpp | 72 void addSymbols(ThunkSection &isec) override; 82 void addSymbols(ThunkSection &isec) override; 103 bool isCompatibleWith(const InputSection &isec, 135 bool isCompatibleWith(const InputSection &isec, 157 void addSymbols(ThunkSection &isec) override; 166 void addSymbols(ThunkSection &isec) override; 176 void addSymbols(ThunkSection &isec) override; 185 void addSymbols(ThunkSection &isec) override; 196 void addSymbols(ThunkSection &isec) override; 206 void addSymbols(ThunkSection &isec) override; [all …]
|
H A D | ARMErrataFix.cpp | 206 static bool branchDestInFirstRegion(const InputSection *isec, uint64_t off, in branchDestInFirstRegion() argument 208 uint64_t sourceAddr = isec->getVA(0) + off; in branchDestInFirstRegion() 229 static bool patchInRange(const InputSection *isec, uint64_t off, in patchInRange() argument 237 isBcc(instr) ? R_ARM_THM_JUMP19 : R_ARM_THM_JUMP24, isec->getVA(off), in patchInRange() 238 isec->getVA() + isec->getSize() + 0x100); in patchInRange() 255 static ScanResult scanCortexA8Errata657417(InputSection *isec, uint64_t &off, in scanCortexA8Errata657417() argument 257 uint64_t isecAddr = isec->getVA(0); in scanCortexA8Errata657417() 269 const uint8_t *buf = isec->content().begin(); in scanCortexA8Errata657417() 284 auto relIt = llvm::find_if(isec->relocs(), [=](const Relocation &r) { in scanCortexA8Errata657417() 289 if (relIt != isec->relocs().end()) in scanCortexA8Errata657417() [all …]
|
H A D | Target.cpp | 102 auto *isec = dyn_cast<InputSection>(d); in getErrorPlace() local 103 if (!isec || !isec->getParent() || (isec->type & SHT_NOBITS)) in getErrorPlace() 108 ? (Out::bufferStart + isec->getParent()->offset + isec->outSecOff) in getErrorPlace() 109 : isec->contentMaybeDecompress().data(); in getErrorPlace() 111 assert(isa<SyntheticSection>(isec) && "No data but not synthetic?"); in getErrorPlace() 114 if (isecLoc <= loc && loc < isecLoc + isec->getSize()) { in getErrorPlace() 115 std::string objLoc = isec->getLocation(loc - isecLoc); in getErrorPlace() 119 return {isec, objLoc + ": ", in getErrorPlace() 120 isec->file ? isec->getSrcMsg(dummy, loc - isecLoc) : ""}; in getErrorPlace()
|
H A D | AArch64ErrataFix.cpp | 337 static uint64_t scanCortexA53Errata843419(InputSection *isec, uint64_t &off, in scanCortexA53Errata843419() argument 339 uint64_t isecAddr = isec->getVA(0); in scanCortexA53Errata843419() 354 const uint8_t *buf = isec->content().begin(); in scanCortexA53Errata843419() 494 for (const InputSection *isec : isd.sections) { in insertPatches() local 495 isecLimit = isec->outSecOff + isec->getSize(); in insertPatches() 532 InputSection *isec, in implementPatch() argument 548 auto relIt = llvm::find_if(isec->relocs(), [=](const Relocation &r) { in implementPatch() 551 if (relIt != isec->relocs().end() && in implementPatch() 558 auto *ps = make<Patch843419Section>(isec, patcheeOffset); in implementPatch() 565 if (relIt != isec->relocs().end()) { in implementPatch() [all …]
|
H A D | OutputSections.cpp | 105 void OutputSection::recordSection(InputSectionBase *isec) { in recordSection() argument 106 partition = isec->partition; in recordSection() 107 isec->parent = this; in recordSection() 111 isd->sectionBases.push_back(isec); in recordSection() 117 void OutputSection::commitSection(InputSection *isec) { in commitSection() argument 118 if (LLVM_UNLIKELY(type != isec->type)) { in commitSection() 120 type = isec->type; in commitSection() 121 } else if (isStaticRelSecType(type) && isStaticRelSecType(isec->type) && in commitSection() 122 (type == SHT_CREL) != (isec->type == SHT_CREL)) { in commitSection() 133 !canMergeToProgbits(isec->type)) { in commitSection() [all …]
|
H A D | LinkerScript.cpp | 57 if (auto *isec = dyn_cast<InputSection>(s)) { in getOutputSectionName() local 58 if (InputSectionBase *rel = isec->getRelocatedSection()) { in getOutputSectionName() 767 static OutputDesc *createSection(InputSectionBase *isec, StringRef outsecName) { in createSection() argument 769 osd->osec.recordSection(isec); in createSection() 774 InputSectionBase *isec, StringRef outsecName) { in addInputSec() argument 782 if (isec->type == SHT_GROUP || (isec->flags & SHF_GROUP)) in addInputSec() 783 return createSection(isec, outsecName); in addInputSec() 791 if (!isa<SyntheticSection>(isec) && isStaticRelSecType(isec->type)) { in addInputSec() 792 auto *sec = cast<InputSection>(isec); in addInputSec() 800 OutputDesc *osd = createSection(isec, outsecName); in addInputSec() [all …]
|
H A D | Relocations.cpp | 121 if (errPlace.isec && errPlace.isec->name.starts_with(".debug")) in reportRangeError() 872 static void addRelativeReloc(InputSectionBase &isec, uint64_t offsetInSec, in addRelativeReloc() argument 875 Partition &part = isec.getPartition(); in addRelativeReloc() 879 part.relaDyn->addRelativeReloc(target->relativeRel, isec, offsetInSec, sym, in addRelativeReloc() 890 isec.relocations.push_back({expr, type, offsetInSec, addend, &sym}); in addRelativeReloc() 900 if (part.relrDyn && isec.addralign >= 2 && offsetInSec % 2 == 0) { in addRelativeReloc() 901 isec.addReloc({expr, type, offsetInSec, addend, &sym}); in addRelativeReloc() 904 {&isec, isec.relocs().size() - 1}); in addRelativeReloc() 906 part.relrDyn->relocs.push_back({&isec, isec.relocs().size() - 1}); in addRelativeReloc() 909 part.relaDyn->addRelativeReloc<shard>(target->relativeRel, isec, offsetInSec, in addRelativeReloc() [all …]
|
H A D | MapFile.cpp | 178 for (InputSection *isec : isd->sections) { in writeMapFile() 179 if (auto *ehSec = dyn_cast<EhFrameSection>(isec)) { in writeMapFile() 184 writeHeader(os, isec->getVA(), osec->getLMA() + isec->outSecOff, in writeMapFile() 185 isec->getSize(), isec->addralign); in writeMapFile() 186 os << indent8 << toString(isec) << '\n'; in writeMapFile() 187 for (Symbol *sym : llvm::make_first_range(sectionSyms[isec])) in writeMapFile()
|
/freebsd/contrib/llvm-project/lld/MachO/Arch/ |
H A D | ARM64.cpp | 363 static void applyAdrpAdd(uint8_t *buf, const ConcatInputSection *isec, in applyAdrpAdd() argument 374 uint64_t addr1 = isec->getVA() + offset1; in applyAdrpAdd() 392 static void applyAdrpAdrp(uint8_t *buf, const ConcatInputSection *isec, in applyAdrpAdrp() argument 402 uint64_t page1 = pageBits(offset1 + isec->getVA()) + adrp1.addend; in applyAdrpAdrp() 403 uint64_t page2 = pageBits(offset2 + isec->getVA()) + adrp2.addend; in applyAdrpAdrp() 419 static void applyAdrpLdr(uint8_t *buf, const ConcatInputSection *isec, in applyAdrpLdr() argument 430 uint64_t addr1 = isec->getVA() + offset1; in applyAdrpLdr() 431 uint64_t addr2 = isec->getVA() + offset2; in applyAdrpLdr() 444 static void applyAdrpLdrGot(uint8_t *buf, const ConcatInputSection *isec, in applyAdrpLdrGot() argument 450 applyAdrpAdd(buf, isec, offset1, offset2); in applyAdrpLdrGot() [all …]
|