Lines Matching refs:osec
87 void addStartStopSymbols(OutputSection &osec);
298 if (osd->osec.name == name && osd->osec.partition == partition) in findSection()
299 return &osd->osec; in findSection()
503 OutputSection &osec = osd->osec; in addSectionSymbols() local
507 for (SectionCommand *cmd : osec.commands) { in addSectionSymbols()
534 /*value=*/0, /*size=*/0, &osec)); in addSectionSymbols()
647 unsigned elf::getSectionRank(OutputSection &osec) { in getSectionRank() argument
648 unsigned rank = osec.partition * RF_PARTITION; in getSectionRank()
652 if (config->sectionStartMap.count(osec.name)) in getSectionRank()
658 if (!(osec.flags & SHF_ALLOC)) in getSectionRank()
672 bool isExec = osec.flags & SHF_EXECINSTR; in getSectionRank()
673 bool isWrite = osec.flags & SHF_WRITE; in getSectionRank()
681 if (osec.flags & SHF_X86_64_LARGE && config->emachine == EM_X86_64) in getSectionRank()
686 if (osec.type == SHT_LLVM_PART_EHDR) in getSectionRank()
688 else if (osec.type == SHT_LLVM_PART_PHDR) in getSectionRank()
690 else if (osec.name == ".interp") in getSectionRank()
695 else if (osec.type == SHT_NOTE) in getSectionRank()
700 else if (osec.type != SHT_PROGBITS) in getSectionRank()
710 if (!(osec.flags & SHF_TLS)) in getSectionRank()
712 if (isRelroSection(&osec)) in getSectionRank()
713 osec.relro = true; in getSectionRank()
720 if (osec.flags & SHF_X86_64_LARGE && config->emachine == EM_X86_64) { in getSectionRank()
722 ? (osec.type == SHT_NOBITS ? 1 : RF_LARGE_ALT) in getSectionRank()
729 if (osec.type == SHT_NOBITS) in getSectionRank()
739 StringRef name = osec.name; in getSectionRank()
747 if (osec.name != ".got") in getSectionRank()
751 if (osec.flags & SHF_MIPS_GPREL) in getSectionRank()
758 StringRef name = osec.name; in getSectionRank()
759 if (name == ".sdata" || (osec.type == SHT_NOBITS && name != ".sbss")) in getSectionRank()
768 const OutputSection *a = &cast<OutputDesc>(aCmd)->osec; in compareSections()
769 const OutputSection *b = &cast<OutputDesc>(bCmd)->osec; in compareSections()
833 auto isLarge = [](OutputSection *osec) { in setReservedSymbolSections() argument
834 return config->emachine == EM_X86_64 && osec->flags & SHF_X86_64_LARGE; in setReservedSymbolSections()
906 return (osd && osd->osec.hasInputSections) in getRankProximity()
907 ? llvm::countl_zero(a->sortRank ^ osd->osec.sortRank) in getRankProximity()
939 OutputSection *sec = &cast<OutputDesc>(*e)->osec; in findOrphanPos()
966 (p == maxP && cast<OutputDesc>(*j)->osec.sortRank <= sec->sortRank)) { in findOrphanPos()
976 return osd && osd->osec.hasInputSections; in findOrphanPos()
988 if (cast<OutputDesc>(*i)->osec.sortRank <= sec->sortRank || mustAfter) { in findOrphanPos()
1187 static void sortSection(OutputSection &osec, in sortSection() argument
1189 StringRef name = osec.name; in sortSection()
1200 for (SectionCommand *b : osec.commands) in sortSection()
1202 sortISDBySectionOrder(isd, order, osec.flags & SHF_EXECINSTR); in sortSection()
1208 osec.sortInitFini(); in sortSection()
1210 osec.sortCtorsDtors(); in sortSection()
1217 assert(osec.commands.size() == 1); in sortSection()
1218 auto *isd = cast<InputSectionDescription>(osec.commands[0]); in sortSection()
1235 sortSection(osd->osec, order); in sortInputSections()
1252 osd->osec.sortRank = getSectionRank(osd->osec); in sortSections()
1317 return osd->osec.sectionIndex == UINT32_MAX; in sortOrphanSections()
1337 OutputSection *orphan = &cast<OutputDesc>(*nonScriptI)->osec; in sortOrphanSections()
1343 return cast<OutputDesc>(cmd)->osec.sortRank != rank; in sortOrphanSections()
1541 OutputSection *osec = &osd->osec; in finalizeAddressDependentContent() local
1542 if (osec->addr % osec->addralign != 0) in finalizeAddressDependentContent()
1543 warn("address (0x" + Twine::utohexstr(osec->addr) + ") of section " + in finalizeAddressDependentContent()
1544 osec->name + " is not a multiple of alignment (" + in finalizeAddressDependentContent()
1545 Twine(osec->addralign) + ")"); in finalizeAddressDependentContent()
1611 for (OutputSection *osec : outputSections) { in optimizeBasicBlockJumps()
1612 if (!(osec->flags & SHF_EXECINSTR)) in optimizeBasicBlockJumps()
1614 ArrayRef<InputSection *> sections = getInputSections(*osec, storage); in optimizeBasicBlockJumps()
1633 for (OutputSection *osec : outputSections) in optimizeBasicBlockJumps()
1634 for (InputSection *is : getInputSections(*osec, storage)) in optimizeBasicBlockJumps()
1682 if (OutputSection *osec = cast<SyntheticSection>(sec)->getParent()) in removeUnusedSyntheticSections() local
1683 for (SectionCommand *cmd : osec->commands) in removeUnusedSyntheticSections()
1706 addStartStopSymbols(osd->osec); in finalizeSections()
1890 OutputSection *osec = &osd->osec; in finalizeSections() local
1891 outputSections.push_back(osec); in finalizeSections()
1892 osec->sectionIndex = outputSections.size(); in finalizeSections()
1893 osec->shName = in.shStrTab->addString(osec->name); in finalizeSections()
2075 for (OutputSection *osec : outputSections) in checkExecuteOnly()
2076 if (osec->flags & SHF_EXECINSTR) in checkExecuteOnly()
2077 for (InputSection *isec : getInputSections(*osec, storage)) in checkExecuteOnly()
2080 toString(osec->name) + in checkExecuteOnly()
2121 void Writer<ELFT>::addStartStopSymbols(OutputSection &osec) { in addStartStopSymbols() argument
2122 StringRef s = osec.name; in addStartStopSymbols()
2125 Defined *startSym = addOptionalRegular(saver().save("__start_" + s), &osec, 0, in addStartStopSymbols()
2127 Defined *stopSym = addOptionalRegular(saver().save("__stop_" + s), &osec, -1, in addStartStopSymbols()
2130 osec.usedInExpression = true; in addStartStopSymbols()
2513 for (OutputSection *osec : outputSections) { in assignFileOffsets()
2514 if (osec->flags & SHF_ALLOC) in assignFileOffsets()
2516 osec->offset = alignToPowerOf2(off, osec->addralign); in assignFileOffsets()
2517 off = osec->offset + osec->size; in assignFileOffsets()