Lines Matching refs:NSec
88 bool MachOLinkGraphBuilder::isDebugSection(const NormalizedSection &NSec) { in isDebugSection() argument
89 return (NSec.Flags & MachO::S_ATTR_DEBUG && in isDebugSection()
90 strcmp(NSec.SegName, "__DWARF") == 0); in isDebugSection()
93 bool MachOLinkGraphBuilder::isZeroFillSection(const NormalizedSection &NSec) { in isZeroFillSection() argument
94 switch (NSec.Flags & MachO::SECTION_TYPE) { in isZeroFillSection()
129 NormalizedSection NSec; in createNormalizedSections() local
138 memcpy(&NSec.SectName, &Sec64.sectname, 16); in createNormalizedSections()
139 NSec.SectName[16] = '\0'; in createNormalizedSections()
140 memcpy(&NSec.SegName, Sec64.segname, 16); in createNormalizedSections()
141 NSec.SegName[16] = '\0'; in createNormalizedSections()
143 NSec.Address = orc::ExecutorAddr(Sec64.addr); in createNormalizedSections()
144 NSec.Size = Sec64.size; in createNormalizedSections()
145 NSec.Alignment = 1ULL << Sec64.align; in createNormalizedSections()
146 NSec.Flags = Sec64.flags; in createNormalizedSections()
151 memcpy(&NSec.SectName, &Sec32.sectname, 16); in createNormalizedSections()
152 NSec.SectName[16] = '\0'; in createNormalizedSections()
153 memcpy(&NSec.SegName, Sec32.segname, 16); in createNormalizedSections()
154 NSec.SegName[16] = '\0'; in createNormalizedSections()
156 NSec.Address = orc::ExecutorAddr(Sec32.addr); in createNormalizedSections()
157 NSec.Size = Sec32.size; in createNormalizedSections()
158 NSec.Alignment = 1ULL << Sec32.align; in createNormalizedSections()
159 NSec.Flags = Sec32.flags; in createNormalizedSections()
164 dbgs() << " " << NSec.SegName << "," << NSec.SectName << ": " in createNormalizedSections()
165 << formatv("{0:x16}", NSec.Address) << " -- " in createNormalizedSections()
166 << formatv("{0:x16}", NSec.Address + NSec.Size) in createNormalizedSections()
167 << ", align: " << NSec.Alignment << ", index: " << SecIndex in createNormalizedSections()
172 if (!isZeroFillSection(NSec)) { in createNormalizedSections()
173 if (DataOffset + NSec.Size > Obj.getData().size()) in createNormalizedSections()
177 NSec.Data = Obj.getData().data() + DataOffset; in createNormalizedSections()
184 if (NSec.Flags & MachO::S_ATTR_PURE_INSTRUCTIONS) in createNormalizedSections()
190 G->allocateContent(StringRef(NSec.SegName) + "," + NSec.SectName); in createNormalizedSections()
191 NSec.GraphSection = &G->createSection( in createNormalizedSections()
195 if (NSec.Flags & MachO::S_ATTR_DEBUG) in createNormalizedSections()
196 NSec.GraphSection->setMemLifetime(orc::MemLifetime::NoAlloc); in createNormalizedSections()
198 IndexToSection.insert(std::make_pair(SecIndex, std::move(NSec))); in createNormalizedSections()
300 auto NSec = findSectionByIndex(Sect - 1); in createNormalizedSymbols() local
301 if (!NSec) in createNormalizedSymbols()
302 return NSec.takeError(); in createNormalizedSymbols()
304 if (orc::ExecutorAddr(Value) < NSec->Address || in createNormalizedSymbols()
305 orc::ExecutorAddr(Value) > NSec->Address + NSec->Size) in createNormalizedSymbols()
310 if (!NSec->GraphSection) { in createNormalizedSymbols()
312 dbgs() << " Skipping: Symbol is in section " << NSec->SegName << "/" in createNormalizedSymbols()
313 << NSec->SectName in createNormalizedSymbols()
339 auto &NSec = SecI->second; in addSectionStartSymAndBlock() local
340 assert(!NSec.CanonicalSymbols.count(Sym.getAddress()) && in addSectionStartSymAndBlock()
342 NSec.CanonicalSymbols[Sym.getAddress()] = &Sym; in addSectionStartSymAndBlock()
414 auto &NSec = KV.second; in graphifyRegularSymbols() local
416 if (!NSec.GraphSection) { in graphifyRegularSymbols()
418 dbgs() << " " << NSec.SegName << "/" << NSec.SectName in graphifyRegularSymbols()
425 if (CustomSectionParserFunctions.count(NSec.GraphSection->getName())) { in graphifyRegularSymbols()
427 dbgs() << " Skipping section " << NSec.GraphSection->getName() in graphifyRegularSymbols()
431 } else if ((NSec.Flags & MachO::SECTION_TYPE) == in graphifyRegularSymbols()
434 NSec, std::move(SecIndexToSymbols[SecIndex]))) in graphifyRegularSymbols()
440 << NSec.GraphSection->getName() << "...\n"; in graphifyRegularSymbols()
443 bool SectionIsNoDeadStrip = NSec.Flags & MachO::S_ATTR_NO_DEAD_STRIP; in graphifyRegularSymbols()
444 bool SectionIsText = NSec.Flags & MachO::S_ATTR_PURE_INSTRUCTIONS; in graphifyRegularSymbols()
451 if (NSec.Size > 0) { in graphifyRegularSymbols()
455 << formatv("{0:x16}", NSec.Address) << " -- " in graphifyRegularSymbols()
456 << formatv("{0:x16}", NSec.Address + NSec.Size) << "\n"; in graphifyRegularSymbols()
458 addSectionStartSymAndBlock(SecIndex, *NSec.GraphSection, NSec.Address, in graphifyRegularSymbols()
459 NSec.Data, NSec.Size, NSec.Alignment, in graphifyRegularSymbols()
485 "First symbol in " + NSec.GraphSection->getName() + " is alt-entry"); in graphifyRegularSymbols()
489 if (orc::ExecutorAddr(SecNSymStack.back()->Value) != NSec.Address) { in graphifyRegularSymbols()
491 orc::ExecutorAddr(SecNSymStack.back()->Value) - NSec.Address; in graphifyRegularSymbols()
494 << "Creating anonymous block to cover [ " << NSec.Address in graphifyRegularSymbols()
495 << " -- " << (NSec.Address + AnonBlockSize) << " ]\n"; in graphifyRegularSymbols()
497 addSectionStartSymAndBlock(SecIndex, *NSec.GraphSection, NSec.Address, in graphifyRegularSymbols()
498 NSec.Data, AnonBlockSize, NSec.Alignment, in graphifyRegularSymbols()
528 SecNSymStack.empty() ? NSec.Address + NSec.Size in graphifyRegularSymbols()
530 orc::ExecutorAddrDiff BlockOffset = BlockStart - NSec.Address; in graphifyRegularSymbols()
536 << NSec.GraphSection->getName() << " + " in graphifyRegularSymbols()
542 NSec.Data in graphifyRegularSymbols()
544 *NSec.GraphSection, in graphifyRegularSymbols()
545 ArrayRef<char>(NSec.Data + BlockOffset, BlockSize), in graphifyRegularSymbols()
546 BlockStart, NSec.Alignment, BlockStart % NSec.Alignment) in graphifyRegularSymbols()
547 : G->createZeroFillBlock(*NSec.GraphSection, BlockSize, in graphifyRegularSymbols()
548 BlockStart, NSec.Alignment, in graphifyRegularSymbols()
549 BlockStart % NSec.Alignment); in graphifyRegularSymbols()
615 auto &NSec = KV.second; in graphifySectionsWithCustomParsers() local
618 if (!NSec.GraphSection) in graphifySectionsWithCustomParsers()
621 auto HI = CustomSectionParserFunctions.find(NSec.GraphSection->getName()); in graphifySectionsWithCustomParsers()
624 if (auto Err = Parse(NSec)) in graphifySectionsWithCustomParsers()
633 NormalizedSection &NSec, std::vector<NormalizedSymbol *> NSyms) { in graphifyCStringSection() argument
634 assert(NSec.GraphSection && "C string literal section missing graph section"); in graphifyCStringSection()
635 assert(NSec.Data && "C string literal section has no data"); in graphifyCStringSection()
639 << NSec.GraphSection->getName() << "\n"; in graphifyCStringSection()
642 if (NSec.Data[NSec.Size - 1] != '\0') in graphifyCStringSection()
644 NSec.GraphSection->getName() + in graphifyCStringSection()
664 bool SectionIsNoDeadStrip = NSec.Flags & MachO::S_ATTR_NO_DEAD_STRIP; in graphifyCStringSection()
665 bool SectionIsText = NSec.Flags & MachO::S_ATTR_PURE_INSTRUCTIONS; in graphifyCStringSection()
669 for (size_t I = 0; I != NSec.Size; ++I) { in graphifyCStringSection()
670 if (NSec.Data[I] == '\0') { in graphifyCStringSection()
673 auto &B = G->createContentBlock(*NSec.GraphSection, in graphifyCStringSection()
674 {NSec.Data + BlockStart, BlockSize}, in graphifyCStringSection()
675 NSec.Address + BlockStart, NSec.Alignment, in graphifyCStringSection()
676 BlockStart % NSec.Alignment); in graphifyCStringSection()
698 setCanonicalSymbol(NSec, S); in graphifyCStringSection()
738 assert(llvm::all_of(NSec.GraphSection->blocks(), in graphifyCStringSection()