Lines Matching defs:BinarySection

300 bool refersToReorderedSection(ErrorOr<BinarySection &> Section) {
471 BinarySection *BinarySection = BC->getSectionForSectionRef(SecRef);
474 if (!BinarySection || !BinarySection->isAllocatable())
483 << "overlap with section " << BinarySection->getName()
490 << "with section " << BinarySection->getName() << '\n';
495 BinarySection->setRelro();
497 BC->outs() << "BOLT-INFO: marking " << BinarySection->getName()
798 BinarySection Section(*BC, *cantFail(Sym.getSection()));
937 ErrorOr<BinarySection &> BSection =
1173 ErrorOr<BinarySection &> Section =
1245 ErrorOr<BinarySection &> Section = BC->getSectionForAddress(Address);
1285 for (const BinarySection &Section : BC->allocatableSections()) {
1359 ErrorOr<BinarySection &> FiniArraySection =
1390 ErrorOr<BinarySection &> FiniArraySection =
1593 ErrorOr<BinarySection &> Section = BC->getSectionForAddress(EntryAddress);
1604 void RewriteInstance::disassemblePLTInstruction(const BinarySection &Section,
1625 void RewriteInstance::disassemblePLTSectionAArch64(BinarySection &Section) {
1669 void RewriteInstance::disassemblePLTSectionRISCV(BinarySection &Section) {
1714 void RewriteInstance::disassemblePLTSectionX86(BinarySection &Section,
1754 auto analyzeOnePLTSection = [&](BinarySection &Section, uint64_t EntrySize) {
1764 for (BinarySection &Section : BC->allocatableSections()) {
1868 BinarySection *RelocatedEHFrameSection =
1954 if (ErrorOr<BinarySection &> BATSec =
2252 ErrorOr<BinarySection &> Section = BC->getSectionForAddress(SymbolAddress);
2321 ErrorOr<BinarySection &> DynamicRelrSectionOrErr =
2334 ErrorOr<BinarySection &> PLTRelSectionOrErr =
2349 ErrorOr<BinarySection &> DynamicRelSectionOrErr =
2361 ErrorOr<BinarySection &> DynamicRelSectionOrErr =
2386 if (BinarySection(*BC, Section).isAllocatable())
2399 assert(BinarySection(*BC, Section).isAllocatable() && "allocatable expected");
2446 void RewriteInstance::readDynamicRelrRelocations(BinarySection &Section) {
2460 ErrorOr<BinarySection &> Section = BC->getSectionForAddress(Address);
2509 ErrorOr<BinarySection &> Section = BC->getSectionForAddress(SymbolAddress);
2530 if (BinarySection(*BC, Section).isAllocatable()) {
2542 if (!BinarySection(*BC, RelocatedSection).isAllocatable()) {
2655 ErrorOr<BinarySection &> ReferencedSection{std::errc::bad_address};
2823 BinarySection(*BC, RelocatedSection).isWritable())
3393 ErrorOr<BinarySection &> LSDASection =
3497 const unsigned ROFlags = BinarySection::getFlags(/*IsReadOnly*/ true,
3500 if (BinarySection *EHFrameSection = getSection(getEHFrameSectionName())) {
3559 ErrorOr<BinarySection &> TextSection =
3599 ErrorOr<BinarySection &> Section = Function->getCodeSection();
3612 if (ErrorOr<BinarySection &> ColdSection =
3651 BinarySection *RelocatedEHFrameSection =
3654 BinarySection *NewEHFrameSection =
3683 std::vector<BinarySection *> RewriteInstance::getCodeSections() {
3684 std::vector<BinarySection *> CodeSections;
3685 for (BinarySection &Section : BC->textSections())
3689 auto compareSections = [&](const BinarySection *A, const BinarySection *B) {
3742 ErrorOr<BinarySection &> FunctionSection =
3752 std::vector<BinarySection *> CodeSections = getCodeSections();
3755 llvm::erase_if(CodeSections, [](BinarySection *Section) {
3759 for (const BinarySection *Section : CodeSections)
3770 for (BinarySection *Section : CodeSections) {
3783 ErrorOr<BinarySection &> TextSection =
3821 for (BinarySection *Section : CodeSections) {
3848 ErrorOr<BinarySection &> FuncSection = Function.getCodeSection();
3870 ErrorOr<BinarySection &> ColdSection =
3896 const unsigned Flags = BinarySection::getFlags(/*IsReadOnly=*/true,
3899 BinarySection &Section =
3916 auto tryRewriteSection = [&](BinarySection &OldSection,
3917 BinarySection &NewSection) {
3937 BinarySection *NewEHFrameSection =
3942 BinarySection *EHSection = getSection(".gcc_except_table");
3943 BinarySection *NewEHSection =
3961 for (BinarySection &Section : BC->allocatableSections()) {
4133 ErrorOr<BinarySection &> EHFrameHdrSec = BC->getUniqueSectionByName(
4212 BinarySection *BSec = BC->getSectionForSectionRef(SecRef);
4214 "Matching non-allocatable BinarySection should exist.");
4275 for (BinarySection &Section : BC->nonAllocatableSections()) {
4297 for (const BinarySection &Section : BC->sections())
4325 BinarySection::encodeELFNote("GNU", DescStr, 4 /*NT_GNU_GOLD_VERSION*/);
4346 BinarySection::encodeELFNote("BOLT", DescStr, BinarySection::NT_BOLT_BAT);
4382 std::vector<std::pair<BinarySection *, ELFShdrTy>> OutputSections;
4383 auto addSection = [&](const ELFShdrTy &Section, BinarySection &BinSec) {
4401 BinarySection *BinSec = BC->getSectionForSectionRef(SecRef);
4402 assert(BinSec && "Matching BinarySection should exist.");
4411 for (BinarySection &Section : BC->allocatableSections()) {
4445 BinarySection *PrevBinSec = nullptr;
4484 BinarySection *BinSec = BC->getSectionForSectionRef(SecRef);
4485 assert(BinSec && "Matching BinarySection should exist.");
4500 for (BinarySection &Section : BC->nonAllocatableSections()) {
4537 BinarySection *BinSec = BC->getSectionForSectionRef(SecRef);
4538 assert(BinSec && "BinarySection should exist for an input section.");
4913 BinarySection &OutputSection = BD->getOutputSection();
4962 BinarySection *OriginSection = Function->getOriginSection();
5149 auto FixAddend = [&](const BinarySection &Section, const Relocation &Rel,
5167 for (const BinarySection &Section : BC->allocatableSections()) {
5187 ErrorOr<BinarySection &> Section =
5243 ErrorOr<BinarySection &> Section = BC->getSectionForAddress(Address);
5268 for (BinarySection &Section : BC->allocatableSections()) {
5730 for (BinarySection &Section : BC->allocatableSections()) {
5746 for (BinarySection &Section : BC->allocatableSections())
5802 BinarySection *NewEHFrameSection =
5818 BinarySection *RelocatedEHFrameSection =
5838 BinarySection *OldEHFrameHdrSection = getSection(getEHFrameHdrSectionName());
5874 const unsigned Flags = BinarySection::getFlags(/*IsReadOnly=*/true,
5877 BinarySection &EHFrameHdrSec = BC->registerOrUpdateSection(
5946 ErrorOr<BinarySection &> Section = BC->getUniqueSectionByName(SectionName);