Lines Matching refs:NSec

83 bool MachOLinkGraphBuilder::isDebugSection(const NormalizedSection &NSec) {  in isDebugSection()  argument
84 return (NSec.Flags & MachO::S_ATTR_DEBUG && in isDebugSection()
85 strcmp(NSec.SegName, "__DWARF") == 0); in isDebugSection()
88 bool MachOLinkGraphBuilder::isZeroFillSection(const NormalizedSection &NSec) { in isZeroFillSection() argument
89 switch (NSec.Flags & MachO::SECTION_TYPE) { in isZeroFillSection()
123 NormalizedSection NSec; in createNormalizedSections() local
132 memcpy(&NSec.SectName, &Sec64.sectname, 16); in createNormalizedSections()
133 NSec.SectName[16] = '\0'; in createNormalizedSections()
134 memcpy(&NSec.SegName, Sec64.segname, 16); in createNormalizedSections()
135 NSec.SegName[16] = '\0'; in createNormalizedSections()
137 NSec.Address = orc::ExecutorAddr(Sec64.addr); in createNormalizedSections()
138 NSec.Size = Sec64.size; in createNormalizedSections()
139 NSec.Alignment = 1ULL << Sec64.align; in createNormalizedSections()
140 NSec.Flags = Sec64.flags; in createNormalizedSections()
145 memcpy(&NSec.SectName, &Sec32.sectname, 16); in createNormalizedSections()
146 NSec.SectName[16] = '\0'; in createNormalizedSections()
147 memcpy(&NSec.SegName, Sec32.segname, 16); in createNormalizedSections()
148 NSec.SegName[16] = '\0'; in createNormalizedSections()
150 NSec.Address = orc::ExecutorAddr(Sec32.addr); in createNormalizedSections()
151 NSec.Size = Sec32.size; in createNormalizedSections()
152 NSec.Alignment = 1ULL << Sec32.align; in createNormalizedSections()
153 NSec.Flags = Sec32.flags; in createNormalizedSections()
158 dbgs() << " " << NSec.SegName << "," << NSec.SectName << ": " in createNormalizedSections()
159 << formatv("{0:x16}", NSec.Address) << " -- " in createNormalizedSections()
160 << formatv("{0:x16}", NSec.Address + NSec.Size) in createNormalizedSections()
161 << ", align: " << NSec.Alignment << ", index: " << SecIndex in createNormalizedSections()
166 if (!isZeroFillSection(NSec)) { in createNormalizedSections()
167 if (DataOffset + NSec.Size > Obj.getData().size()) in createNormalizedSections()
171 NSec.Data = Obj.getData().data() + DataOffset; in createNormalizedSections()
178 if (NSec.Flags & MachO::S_ATTR_PURE_INSTRUCTIONS) in createNormalizedSections()
184 G->allocateString(StringRef(NSec.SegName) + "," + NSec.SectName); in createNormalizedSections()
185 NSec.GraphSection = &G->createSection( in createNormalizedSections()
188 IndexToSection.insert(std::make_pair(SecIndex, std::move(NSec))); in createNormalizedSections()
286 auto NSec = findSectionByIndex(Sect - 1); in createNormalizedSymbols() local
287 if (!NSec) in createNormalizedSymbols()
288 return NSec.takeError(); in createNormalizedSymbols()
290 if (orc::ExecutorAddr(Value) < NSec->Address || in createNormalizedSymbols()
291 orc::ExecutorAddr(Value) > NSec->Address + NSec->Size) in createNormalizedSymbols()
296 if (!NSec->GraphSection) { in createNormalizedSymbols()
298 dbgs() << " Skipping: Symbol is in section " << NSec->SegName << "/" in createNormalizedSymbols()
299 << NSec->SectName in createNormalizedSymbols()
325 auto &NSec = SecI->second; in addSectionStartSymAndBlock() local
326 assert(!NSec.CanonicalSymbols.count(Sym.getAddress()) && in addSectionStartSymAndBlock()
328 NSec.CanonicalSymbols[Sym.getAddress()] = &Sym; in addSectionStartSymAndBlock()
399 auto &NSec = KV.second; in graphifyRegularSymbols() local
401 if (!NSec.GraphSection) { in graphifyRegularSymbols()
403 dbgs() << " " << NSec.SegName << "/" << NSec.SectName in graphifyRegularSymbols()
410 if (CustomSectionParserFunctions.count(NSec.GraphSection->getName())) { in graphifyRegularSymbols()
412 dbgs() << " Skipping section " << NSec.GraphSection->getName() in graphifyRegularSymbols()
416 } else if ((NSec.Flags & MachO::SECTION_TYPE) == in graphifyRegularSymbols()
419 NSec, std::move(SecIndexToSymbols[SecIndex]))) in graphifyRegularSymbols()
425 << NSec.GraphSection->getName() << "...\n"; in graphifyRegularSymbols()
428 bool SectionIsNoDeadStrip = NSec.Flags & MachO::S_ATTR_NO_DEAD_STRIP; in graphifyRegularSymbols()
429 bool SectionIsText = NSec.Flags & MachO::S_ATTR_PURE_INSTRUCTIONS; in graphifyRegularSymbols()
436 if (NSec.Size > 0) { in graphifyRegularSymbols()
440 << formatv("{0:x16}", NSec.Address) << " -- " in graphifyRegularSymbols()
441 << formatv("{0:x16}", NSec.Address + NSec.Size) << "\n"; in graphifyRegularSymbols()
443 addSectionStartSymAndBlock(SecIndex, *NSec.GraphSection, NSec.Address, in graphifyRegularSymbols()
444 NSec.Data, NSec.Size, NSec.Alignment, in graphifyRegularSymbols()
470 "First symbol in " + NSec.GraphSection->getName() + " is alt-entry"); in graphifyRegularSymbols()
474 if (orc::ExecutorAddr(SecNSymStack.back()->Value) != NSec.Address) { in graphifyRegularSymbols()
476 orc::ExecutorAddr(SecNSymStack.back()->Value) - NSec.Address; in graphifyRegularSymbols()
479 << "Creating anonymous block to cover [ " << NSec.Address in graphifyRegularSymbols()
480 << " -- " << (NSec.Address + AnonBlockSize) << " ]\n"; in graphifyRegularSymbols()
482 addSectionStartSymAndBlock(SecIndex, *NSec.GraphSection, NSec.Address, in graphifyRegularSymbols()
483 NSec.Data, AnonBlockSize, NSec.Alignment, in graphifyRegularSymbols()
504 SecNSymStack.empty() ? NSec.Address + NSec.Size in graphifyRegularSymbols()
506 orc::ExecutorAddrDiff BlockOffset = BlockStart - NSec.Address; in graphifyRegularSymbols()
512 << NSec.GraphSection->getName() << " + " in graphifyRegularSymbols()
518 NSec.Data in graphifyRegularSymbols()
520 *NSec.GraphSection, in graphifyRegularSymbols()
521 ArrayRef<char>(NSec.Data + BlockOffset, BlockSize), in graphifyRegularSymbols()
522 BlockStart, NSec.Alignment, BlockStart % NSec.Alignment) in graphifyRegularSymbols()
523 : G->createZeroFillBlock(*NSec.GraphSection, BlockSize, in graphifyRegularSymbols()
524 BlockStart, NSec.Alignment, in graphifyRegularSymbols()
525 BlockStart % NSec.Alignment); in graphifyRegularSymbols()
591 auto &NSec = KV.second; in graphifySectionsWithCustomParsers() local
594 if (!NSec.GraphSection) in graphifySectionsWithCustomParsers()
597 auto HI = CustomSectionParserFunctions.find(NSec.GraphSection->getName()); in graphifySectionsWithCustomParsers()
600 if (auto Err = Parse(NSec)) in graphifySectionsWithCustomParsers()
609 NormalizedSection &NSec, std::vector<NormalizedSymbol *> NSyms) { in graphifyCStringSection() argument
610 assert(NSec.GraphSection && "C string literal section missing graph section"); in graphifyCStringSection()
611 assert(NSec.Data && "C string literal section has no data"); in graphifyCStringSection()
615 << NSec.GraphSection->getName() << "\n"; in graphifyCStringSection()
618 if (NSec.Data[NSec.Size - 1] != '\0') in graphifyCStringSection()
620 NSec.GraphSection->getName() + in graphifyCStringSection()
640 bool SectionIsNoDeadStrip = NSec.Flags & MachO::S_ATTR_NO_DEAD_STRIP; in graphifyCStringSection()
641 bool SectionIsText = NSec.Flags & MachO::S_ATTR_PURE_INSTRUCTIONS; in graphifyCStringSection()
645 for (size_t I = 0; I != NSec.Size; ++I) in graphifyCStringSection()
646 if (NSec.Data[I] == '\0') { in graphifyCStringSection()
649 auto &B = G->createContentBlock(*NSec.GraphSection, in graphifyCStringSection()
650 {NSec.Data + BlockStart, BlockSize}, in graphifyCStringSection()
651 NSec.Address + BlockStart, NSec.Alignment, in graphifyCStringSection()
652 BlockStart % NSec.Alignment); in graphifyCStringSection()
674 setCanonicalSymbol(NSec, S); in graphifyCStringSection()