Lines Matching refs:NSec

80 bool MachOLinkGraphBuilder::isDebugSection(const NormalizedSection &NSec) {  in isDebugSection()  argument
81 return (NSec.Flags & MachO::S_ATTR_DEBUG && in isDebugSection()
82 strcmp(NSec.SegName, "__DWARF") == 0); in isDebugSection()
111 NormalizedSection NSec; in createNormalizedSections() local
124 memcpy(&NSec.SectName, &Sec64.sectname, 16); in createNormalizedSections()
125 NSec.SectName[16] = '\0'; in createNormalizedSections()
126 memcpy(&NSec.SegName, Sec64.segname, 16); in createNormalizedSections()
127 NSec.SegName[16] = '\0'; in createNormalizedSections()
129 NSec.Address = Sec64.addr; in createNormalizedSections()
130 NSec.Size = Sec64.size; in createNormalizedSections()
131 NSec.Alignment = 1ULL << Sec64.align; in createNormalizedSections()
132 NSec.Flags = Sec64.flags; in createNormalizedSections()
137 memcpy(&NSec.SectName, &Sec32.sectname, 16); in createNormalizedSections()
138 NSec.SectName[16] = '\0'; in createNormalizedSections()
139 memcpy(&NSec.SegName, Sec32.segname, 16); in createNormalizedSections()
140 NSec.SegName[16] = '\0'; in createNormalizedSections()
142 NSec.Address = Sec32.addr; in createNormalizedSections()
143 NSec.Size = Sec32.size; in createNormalizedSections()
144 NSec.Alignment = 1ULL << Sec32.align; in createNormalizedSections()
145 NSec.Flags = Sec32.flags; in createNormalizedSections()
150 dbgs() << " " << *Name << ": " << formatv("{0:x16}", NSec.Address) in createNormalizedSections()
151 << " -- " << formatv("{0:x16}", NSec.Address + NSec.Size) in createNormalizedSections()
152 << ", align: " << NSec.Alignment << ", index: " << SecIndex in createNormalizedSections()
158 unsigned SectionType = NSec.Flags & MachO::SECTION_TYPE; in createNormalizedSections()
162 if (DataOffset + NSec.Size > Obj.getData().size()) in createNormalizedSections()
166 NSec.Data = Obj.getData().data() + DataOffset; in createNormalizedSections()
174 if (NSec.Flags & MachO::S_ATTR_PURE_INSTRUCTIONS) in createNormalizedSections()
181 if (!isDebugSection(NSec)) in createNormalizedSections()
182 NSec.GraphSection = &G->createSection(*Name, Prot); in createNormalizedSections()
189 IndexToSection.insert(std::make_pair(SecIndex, std::move(NSec))); in createNormalizedSections()
287 auto NSec = findSectionByIndex(Sect - 1); in createNormalizedSymbols() local
288 if (!NSec) in createNormalizedSymbols()
289 return NSec.takeError(); in createNormalizedSymbols()
291 if (Value < NSec->Address || Value > NSec->Address + NSec->Size) in createNormalizedSymbols()
295 if (!NSec->GraphSection) { in createNormalizedSymbols()
297 dbgs() << " Skipping: Symbol is in section " << NSec->SegName << "/" in createNormalizedSymbols()
298 << NSec->SectName in createNormalizedSymbols()
393 auto &NSec = KV.second; in graphifyRegularSymbols() local
395 if (!NSec.GraphSection) { in graphifyRegularSymbols()
397 dbgs() << " " << NSec.SegName << "/" << NSec.SectName in graphifyRegularSymbols()
404 if (CustomSectionParserFunctions.count(NSec.GraphSection->getName())) { in graphifyRegularSymbols()
406 dbgs() << " Skipping section " << NSec.GraphSection->getName() in graphifyRegularSymbols()
412 dbgs() << " Processing section " << NSec.GraphSection->getName() in graphifyRegularSymbols()
416 bool SectionIsNoDeadStrip = NSec.Flags & MachO::S_ATTR_NO_DEAD_STRIP; in graphifyRegularSymbols()
417 bool SectionIsText = NSec.Flags & MachO::S_ATTR_PURE_INSTRUCTIONS; in graphifyRegularSymbols()
424 if (NSec.Size > 0) { in graphifyRegularSymbols()
428 << formatv("{0:x16}", NSec.Address) << " -- " in graphifyRegularSymbols()
429 << formatv("{0:x16}", NSec.Address + NSec.Size) << "\n"; in graphifyRegularSymbols()
431 addSectionStartSymAndBlock(*NSec.GraphSection, NSec.Address, NSec.Data, in graphifyRegularSymbols()
432 NSec.Size, NSec.Alignment, in graphifyRegularSymbols()
458 "First symbol in " + NSec.GraphSection->getName() + " is alt-entry"); in graphifyRegularSymbols()
462 if (SecNSymStack.back()->Value != NSec.Address) { in graphifyRegularSymbols()
463 auto AnonBlockSize = SecNSymStack.back()->Value - NSec.Address; in graphifyRegularSymbols()
467 << formatv("{0:x16}", NSec.Address) << " -- " in graphifyRegularSymbols()
468 << formatv("{0:x16}", NSec.Address + AnonBlockSize) << " ]\n"; in graphifyRegularSymbols()
470 addSectionStartSymAndBlock(*NSec.GraphSection, NSec.Address, NSec.Data, in graphifyRegularSymbols()
471 AnonBlockSize, NSec.Alignment, in graphifyRegularSymbols()
492 ? NSec.Address + NSec.Size in graphifyRegularSymbols()
494 JITTargetAddress BlockOffset = BlockStart - NSec.Address; in graphifyRegularSymbols()
500 << NSec.GraphSection->getName() << " + " in graphifyRegularSymbols()
506 NSec.Data in graphifyRegularSymbols()
508 *NSec.GraphSection, in graphifyRegularSymbols()
509 StringRef(NSec.Data + BlockOffset, BlockSize), BlockStart, in graphifyRegularSymbols()
510 NSec.Alignment, BlockStart % NSec.Alignment) in graphifyRegularSymbols()
511 : G->createZeroFillBlock(*NSec.GraphSection, BlockSize, in graphifyRegularSymbols()
512 BlockStart, NSec.Alignment, in graphifyRegularSymbols()
513 BlockStart % NSec.Alignment); in graphifyRegularSymbols()
563 auto &NSec = KV.second; in graphifySectionsWithCustomParsers() local
566 if (!NSec.GraphSection) in graphifySectionsWithCustomParsers()
569 auto HI = CustomSectionParserFunctions.find(NSec.GraphSection->getName()); in graphifySectionsWithCustomParsers()
572 if (auto Err = Parse(NSec)) in graphifySectionsWithCustomParsers()