Lines Matching defs:osec
90 void addStartStopSymbols(OutputSection &osec);
313 if (osd->osec.name == name && osd->osec.partition == partition)
314 return &osd->osec;
521 OutputSection &osec = osd->osec;
525 for (SectionCommand *cmd : osec.commands) {
552 /*value=*/0, /*size=*/0, &osec));
665 unsigned elf::getSectionRank(Ctx &ctx, OutputSection &osec) {
666 unsigned rank = osec.partition * RF_PARTITION;
670 if (ctx.arg.sectionStartMap.count(osec.name))
676 if (!(osec.flags & SHF_ALLOC))
690 bool isExec = osec.flags & SHF_EXECINSTR;
691 bool isWrite = osec.flags & SHF_WRITE;
699 if (osec.flags & SHF_X86_64_LARGE && ctx.arg.emachine == EM_X86_64)
704 if (osec.type == SHT_LLVM_PART_EHDR)
706 else if (osec.type == SHT_LLVM_PART_PHDR)
708 else if (osec.name == ".interp")
713 else if (osec.type == SHT_NOTE)
718 else if (osec.type != SHT_PROGBITS)
728 if (!(osec.flags & SHF_TLS))
730 if (isRelroSection(ctx, &osec))
731 osec.relro = true;
738 if (osec.flags & SHF_X86_64_LARGE && ctx.arg.emachine == EM_X86_64) {
740 ? (osec.type == SHT_NOBITS ? 1 : RF_LARGE_ALT)
747 if (osec.type == SHT_NOBITS)
757 StringRef name = osec.name;
765 if (osec.name != ".got")
769 if (osec.flags & SHF_MIPS_GPREL)
776 StringRef name = osec.name;
777 if (name == ".sdata" || (osec.type == SHT_NOBITS && name != ".sbss"))
786 const OutputSection *a = &cast<OutputDesc>(aCmd)->osec;
787 const OutputSection *b = &cast<OutputDesc>(bCmd)->osec;
856 auto isLarge = [&ctx = ctx](OutputSection *osec) {
857 return ctx.arg.emachine == EM_X86_64 && osec->flags & SHF_X86_64_LARGE;
929 return (osd && osd->osec.hasInputSections)
930 ? llvm::countl_zero(a->sortRank ^ osd->osec.sortRank)
962 OutputSection *sec = &cast<OutputDesc>(*e)->osec;
989 (p == maxP && cast<OutputDesc>(*j)->osec.sortRank <= sec->sortRank)) {
999 return osd && osd->osec.hasInputSections;
1012 if (cast<OutputDesc>(*i)->osec.sortRank <= sec->sortRank || mustAfter) {
1215 static void sortSection(Ctx &ctx, OutputSection &osec,
1217 StringRef name = osec.name;
1228 for (SectionCommand *b : osec.commands)
1230 sortISDBySectionOrder(ctx, isd, order, osec.flags & SHF_EXECINSTR);
1236 osec.sortInitFini();
1238 osec.sortCtorsDtors();
1245 assert(osec.commands.size() == 1);
1246 auto *isd = cast<InputSectionDescription>(osec.commands[0]);
1263 sortSection(ctx, osd->osec, order);
1280 osd->osec.sortRank = getSectionRank(ctx, osd->osec);
1347 return osd->osec.sectionIndex == UINT32_MAX;
1369 OutputSection *orphan = &cast<OutputDesc>(*nonScriptI)->osec;
1375 return cast<OutputDesc>(cmd)->osec.sortRank != rank;
1610 OutputSection *osec = &osd->osec;
1611 if (osec->addr % osec->addralign != 0)
1612 Warn(ctx) << "address (0x" << Twine::utohexstr(osec->addr)
1613 << ") of section " << osec->name
1614 << " is not a multiple of alignment (" << osec->addralign
1681 for (OutputSection *osec : ctx.outputSections) {
1682 if (!(osec->flags & SHF_EXECINSTR))
1684 ArrayRef<InputSection *> sections = getInputSections(*osec, storage);
1703 for (OutputSection *osec : ctx.outputSections)
1704 for (InputSection *is : getInputSections(*osec, storage))
1751 if (OutputSection *osec = cast<SyntheticSection>(sec)->getParent())
1752 for (SectionCommand *cmd : osec->commands)
1775 addStartStopSymbols(osd->osec);
1970 OutputSection *osec = &osd->osec;
1971 if (!ctx.in.shStrTab && !(osec->flags & SHF_ALLOC))
1973 ctx.outputSections.push_back(osec);
1974 osec->sectionIndex = ctx.outputSections.size();
1976 osec->shName = ctx.in.shStrTab->addString(osec->name);
2160 for (OutputSection *osec : ctx.outputSections)
2161 if (osec->flags & SHF_EXECINSTR)
2162 for (InputSection *isec : getInputSections(*osec, storage))
2164 ErrAlways(ctx) << "cannot place " << isec << " into " << osec->name
2206 void Writer<ELFT>::addStartStopSymbols(OutputSection &osec) {
2207 StringRef s = osec.name;
2211 Defined *startSym = addOptionalRegular(ctx, ss.save("__start_" + s), &osec, 0,
2213 Defined *stopSym = addOptionalRegular(ctx, ss.save("__stop_" + s), &osec, -1,
2216 osec.usedInExpression = true;
2604 for (OutputSection *osec : ctx.outputSections) {
2605 if (osec->flags & SHF_ALLOC)
2607 osec->offset = alignToPowerOf2(off, osec->addralign);
2608 off = osec->offset + osec->size;