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()
125 NormalizedSection NSec; in createNormalizedSections() local
134 memcpy(&NSec.SectName, &Sec64.sectname, 16); in createNormalizedSections()
135 NSec.SectName[16] = '\0'; in createNormalizedSections()
136 memcpy(&NSec.SegName, Sec64.segname, 16); in createNormalizedSections()
137 NSec.SegName[16] = '\0'; in createNormalizedSections()
139 NSec.Address = Sec64.addr; in createNormalizedSections()
140 NSec.Size = Sec64.size; in createNormalizedSections()
141 NSec.Alignment = 1ULL << Sec64.align; in createNormalizedSections()
142 NSec.Flags = Sec64.flags; in createNormalizedSections()
147 memcpy(&NSec.SectName, &Sec32.sectname, 16); in createNormalizedSections()
148 NSec.SectName[16] = '\0'; in createNormalizedSections()
149 memcpy(&NSec.SegName, Sec32.segname, 16); in createNormalizedSections()
150 NSec.SegName[16] = '\0'; in createNormalizedSections()
152 NSec.Address = Sec32.addr; in createNormalizedSections()
153 NSec.Size = Sec32.size; in createNormalizedSections()
154 NSec.Alignment = 1ULL << Sec32.align; in createNormalizedSections()
155 NSec.Flags = Sec32.flags; in createNormalizedSections()
160 dbgs() << " " << NSec.SegName << "," << NSec.SectName << ": " in createNormalizedSections()
161 << formatv("{0:x16}", NSec.Address) << " -- " in createNormalizedSections()
162 << formatv("{0:x16}", NSec.Address + NSec.Size) in createNormalizedSections()
163 << ", align: " << NSec.Alignment << ", index: " << SecIndex in createNormalizedSections()
168 if (!isZeroFillSection(NSec)) { in createNormalizedSections()
169 if (DataOffset + NSec.Size > Obj.getData().size()) in createNormalizedSections()
173 NSec.Data = Obj.getData().data() + DataOffset; in createNormalizedSections()
180 if (NSec.Flags & MachO::S_ATTR_PURE_INSTRUCTIONS) in createNormalizedSections()
187 if (!isDebugSection(NSec)) { in createNormalizedSections()
189 G->allocateString(StringRef(NSec.SegName) + "," + NSec.SectName); in createNormalizedSections()
190 NSec.GraphSection = &G->createSection( in createNormalizedSections()
195 dbgs() << " " << NSec.SegName << "," << NSec.SectName in createNormalizedSections()
199 IndexToSection.insert(std::make_pair(SecIndex, std::move(NSec))); in createNormalizedSections()
297 auto NSec = findSectionByIndex(Sect - 1); in createNormalizedSymbols() local
298 if (!NSec) in createNormalizedSymbols()
299 return NSec.takeError(); in createNormalizedSymbols()
301 if (Value < NSec->Address || Value > NSec->Address + NSec->Size) in createNormalizedSymbols()
305 if (!NSec->GraphSection) { in createNormalizedSymbols()
307 dbgs() << " Skipping: Symbol is in section " << NSec->SegName << "/" in createNormalizedSymbols()
308 << NSec->SectName in createNormalizedSymbols()
403 auto &NSec = KV.second; in graphifyRegularSymbols() local
405 if (!NSec.GraphSection) { in graphifyRegularSymbols()
407 dbgs() << " " << NSec.SegName << "/" << NSec.SectName in graphifyRegularSymbols()
414 if (CustomSectionParserFunctions.count(NSec.GraphSection->getName())) { in graphifyRegularSymbols()
416 dbgs() << " Skipping section " << NSec.GraphSection->getName() in graphifyRegularSymbols()
420 } else if ((NSec.Flags & MachO::SECTION_TYPE) == in graphifyRegularSymbols()
423 NSec, std::move(SecIndexToSymbols[SecIndex]))) in graphifyRegularSymbols()
429 << NSec.GraphSection->getName() << "...\n"; in graphifyRegularSymbols()
432 bool SectionIsNoDeadStrip = NSec.Flags & MachO::S_ATTR_NO_DEAD_STRIP; in graphifyRegularSymbols()
433 bool SectionIsText = NSec.Flags & MachO::S_ATTR_PURE_INSTRUCTIONS; in graphifyRegularSymbols()
440 if (NSec.Size > 0) { in graphifyRegularSymbols()
444 << formatv("{0:x16}", NSec.Address) << " -- " in graphifyRegularSymbols()
445 << formatv("{0:x16}", NSec.Address + NSec.Size) << "\n"; in graphifyRegularSymbols()
447 addSectionStartSymAndBlock(*NSec.GraphSection, NSec.Address, NSec.Data, in graphifyRegularSymbols()
448 NSec.Size, NSec.Alignment, in graphifyRegularSymbols()
474 "First symbol in " + NSec.GraphSection->getName() + " is alt-entry"); in graphifyRegularSymbols()
478 if (SecNSymStack.back()->Value != NSec.Address) { in graphifyRegularSymbols()
479 auto AnonBlockSize = SecNSymStack.back()->Value - NSec.Address; in graphifyRegularSymbols()
483 << formatv("{0:x16}", NSec.Address) << " -- " in graphifyRegularSymbols()
484 << formatv("{0:x16}", NSec.Address + AnonBlockSize) << " ]\n"; in graphifyRegularSymbols()
486 addSectionStartSymAndBlock(*NSec.GraphSection, NSec.Address, NSec.Data, in graphifyRegularSymbols()
487 AnonBlockSize, NSec.Alignment, in graphifyRegularSymbols()
508 ? NSec.Address + NSec.Size in graphifyRegularSymbols()
510 JITTargetAddress BlockOffset = BlockStart - NSec.Address; in graphifyRegularSymbols()
516 << NSec.GraphSection->getName() << " + " in graphifyRegularSymbols()
522 NSec.Data in graphifyRegularSymbols()
524 *NSec.GraphSection, in graphifyRegularSymbols()
525 ArrayRef<char>(NSec.Data + BlockOffset, BlockSize), in graphifyRegularSymbols()
526 BlockStart, NSec.Alignment, BlockStart % NSec.Alignment) in graphifyRegularSymbols()
527 : G->createZeroFillBlock(*NSec.GraphSection, BlockSize, in graphifyRegularSymbols()
528 BlockStart, NSec.Alignment, in graphifyRegularSymbols()
529 BlockStart % NSec.Alignment); in graphifyRegularSymbols()
594 auto &NSec = KV.second; in graphifySectionsWithCustomParsers() local
597 if (!NSec.GraphSection) in graphifySectionsWithCustomParsers()
600 auto HI = CustomSectionParserFunctions.find(NSec.GraphSection->getName()); in graphifySectionsWithCustomParsers()
603 if (auto Err = Parse(NSec)) in graphifySectionsWithCustomParsers()
612 NormalizedSection &NSec, std::vector<NormalizedSymbol *> NSyms) { in graphifyCStringSection() argument
614 assert(NSec.GraphSection && "C string literal section missing graph section"); in graphifyCStringSection()
615 assert(NSec.Data && "C string literal section has no data"); in graphifyCStringSection()
619 << NSec.GraphSection->getName() << "\n"; in graphifyCStringSection()
622 if (NSec.Data[NSec.Size - 1] != '\0') in graphifyCStringSection()
624 NSec.GraphSection->getName() + in graphifyCStringSection()
644 bool SectionIsNoDeadStrip = NSec.Flags & MachO::S_ATTR_NO_DEAD_STRIP; in graphifyCStringSection()
645 bool SectionIsText = NSec.Flags & MachO::S_ATTR_PURE_INSTRUCTIONS; in graphifyCStringSection()
649 for (size_t I = 0; I != NSec.Size; ++I) in graphifyCStringSection()
650 if (NSec.Data[I] == '\0') { in graphifyCStringSection()
654 auto &B = G->createContentBlock(*NSec.GraphSection, in graphifyCStringSection()
655 {NSec.Data + BlockStart, BlockSize}, in graphifyCStringSection()
656 NSec.Address + BlockStart, 1, 0); in graphifyCStringSection()