Lines Matching defs:chunks

181 // PartialSection represents a group of chunks that contribute to an
230 bool verifyRanges(const std::vector<Chunk *> chunks);
260 void sortCRTSectionChunks(std::vector<Chunk *> &chunks);
262 void sortBySectionOrder(std::vector<Chunk *> &chunks);
339 // the chunks that the linker creates. All .pdata chunks come from input
356 chunks.push_back(c);
360 chunks.insert(chunks.begin(), c);
369 chunks.insert(chunks.end(), other->chunks.begin(), other->chunks.end());
370 other->chunks.clear();
477 for (size_t i = 0; i != os->chunks.size(); ++i) {
478 SectionChunk *sc = dyn_cast<SectionChunk>(os->chunks[i]);
480 auto chunk = cast<NonSectionChunk>(os->chunks[i]);
524 os->chunks.insert(os->chunks.begin() + thunkInsertionSpot, thunkChunk);
593 for (Chunk *c : sec->chunks) {
594 // Skip empty section chunks. MS link.exe does not seem to do that and
617 bool Writer::verifyRanges(const std::vector<Chunk *> chunks) {
618 for (Chunk *c : chunks) {
653 sec->origChunks = sec->chunks;
654 origNumChunks += sec->chunks.size();
669 if (!verifyRanges(sec->chunks)) {
673 numChunks += sec->chunks.size();
692 sec->chunks = sec->origChunks;
832 void Writer::sortBySectionOrder(std::vector<Chunk *> &chunks) {
840 llvm::stable_sort(chunks, [=](const Chunk *a, const Chunk *b) {
857 destSec->chunks.insert(destSec->chunks.end(), pSec->chunks.begin(),
858 pSec->chunks.end());
859 pSec->chunks.clear();
863 // Sort concrete section chunks from GNU import libraries.
866 // libraries that consist of object files, with section chunks for the .idata$*
870 // be formed correctly, the section chunks within each .idata$* section need
876 // Make sure all .idata$* section chunks are mapped as RDATA in order to
877 // be sorted into the same sections as our own synthesized .idata chunks.
881 // Sort all .idata$* chunks, grouping chunks from the same library,
888 if (!pSec->chunks.empty())
890 llvm::stable_sort(pSec->chunks, [&](Chunk *s, Chunk *t) {
911 // Add generated idata chunks, for imported symbols and DLLs, and a
918 // chunks from other linked in object files to be grouped together.
922 pSec->chunks.insert(pSec->chunks.end(), v.begin(), v.end());
948 if (!rdataSec->chunks.empty())
949 rdataSec->chunks.front()->setAlignment(
950 std::max(0x1000u, rdataSec->chunks.front()->getAlignment()));
953 rdataSec->chunks.insert(rdataSec->chunks.begin(),
954 importAddresses->chunks.begin(),
955 importAddresses->chunks.end());
963 auxIat->chunks.front()->setAlignment(0x1000);
964 rdataSec->chunks.insert(rdataSec->chunks.end(), auxIat->chunks.begin(),
965 auxIat->chunks.end());
971 rdataSec->chunks.insert(rdataSec->chunks.end(),
983 if (!importDirs->chunks.empty())
984 importTableStart = importDirs->chunks.front();
985 for (Chunk *c : importDirs->chunks)
990 if (!importAddresses->chunks.empty())
991 iatStart = importAddresses->chunks.front();
992 for (Chunk *c : importAddresses->chunks)
1031 sortBySectionOrder(it.second->chunks);
1086 // Then bin chunks by name and output characteristics.
1103 pSec->chunks.push_back(c);
1140 sortCRTSectionChunks(pSec->chunks);
1144 // Delay adding its chunks until appendECImportTables.
1150 for (Chunk *c : pSec->chunks)
1183 llvm::TimeTraceScope timeScope("Misc chunks");
1252 // so we just let it create chunks and add them to the section.
1328 if (!edataSec->chunks.empty()) {
1332 ctx.symtab.edataStart = edataSec->chunks.front();
1333 ctx.symtab.edataEnd = edataSec->chunks.back();
1335 // On hybrid target, split EC and native chunks.
1336 llvm::stable_sort(edataSec->chunks, [=](const Chunk *a, const Chunk *b) {
1340 for (auto chunk : edataSec->chunks) {
1343 ctx.hybridSymtab->edataEnd = edataSec->chunks.back();
1382 return s->chunks.empty();
1402 for (Chunk *c : os->chunks)
1407 // Merge chunks are containers of chunks, so assign those an output section
1552 if (!pdataSec->chunks.empty()) {
1556 llvm::stable_sort(pdataSec->chunks, [=](const Chunk *a, const Chunk *b) {
1560 for (auto chunk : pdataSec->chunks) {
1563 hybridPdata.last = pdataSec->chunks.back();
1572 pdata.first = pdataSec->chunks.front();
1573 pdata.last = pdataSec->chunks.back();
1602 // EC targets may have chunks of various architectures mixed together at this
1603 // point. Group code chunks of the same architecture together by sorting chunks
1611 llvm::stable_sort(sec->chunks, [=](const Chunk *a, const Chunk *b) {
1626 // We do it here to make sure that we account for range extension chunks.
1643 sec->chunks.clear();
1658 for (Chunk *c : sec->chunks) {
2018 // We only care about live section chunks. Common chunks and other chunks
2210 // Create CHPE metadata chunks.
2441 // ADD instructions). Only fill the gaps between chunks. Most
2442 // chunks overwrite it anyway, but uninitialized data chunks
2447 for (Chunk *c : sec->chunks) {
2455 parallelForEach(sec->chunks, [&](Chunk *c) {
2576 // It is therefore critical to sort the chunks containing the function
2580 void Writer::sortCRTSectionChunks(std::vector<Chunk *> &chunks) {
2584 assert(sa && sb && "Non-section chunks in CRT section!");
2591 llvm::stable_sort(chunks, sectionChunkOrder);
2594 for (auto &c : chunks) {
2627 for (Chunk *c : sec->chunks)