Lines Matching +full:non +full:- +full:overlapping

1 //=--------- COFFLinkGraphBuilder.cpp - COFF LinkGraph builder ----------===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
11 //===----------------------------------------------------------------------===//
57 return std::min(Sec->VirtualSize, Sec->SizeOfRawData);
58 return Sec->SizeOfRawData;
64 return Section->VirtualAddress + Obj.getImageBase();
69 return Section->Characteristics & COFF::IMAGE_SCN_LNK_COMDAT;
74 CommonSection = &G->createSection(CommonSectionName,
113 // Non reserved regular section numbers
153 if ((*Sec)->Characteristics & COFF::IMAGE_SCN_MEM_EXECUTE)
155 if ((*Sec)->Characteristics & COFF::IMAGE_SCN_MEM_READ)
157 if ((*Sec)->Characteristics & COFF::IMAGE_SCN_MEM_WRITE)
161 auto *GraphSec = G->findSectionByName(SectionName);
163 GraphSec = &G->createSection(SectionName, Prot);
164 if ((*Sec)->Characteristics & COFF::IMAGE_SCN_LNK_REMOVE)
165 GraphSec->setMemLifetime(orc::MemLifetime::NoAlloc);
167 if (GraphSec->getMemProt() != Prot)
171 if ((*Sec)->Characteristics & COFF::IMAGE_SCN_CNT_UNINITIALIZED_DATA)
172 B = &G->createZeroFillBlock(
175 (*Sec)->getAlignment(), 0);
189 B = &G->createContentBlock(
191 (*Sec)->getAlignment(), 0);
218 COFFSectionIndex SectionIndex = Sym->getSectionNumber();
232 if (Sym->isFileRecord())
239 else if (Sym->isUndefined()) {
241 } else if (Sym->isWeakExternal()) {
242 auto *WeakExternal = Sym->getAux<object::coff_aux_weak_external>();
243 COFFSymbolIndex TagIndex = WeakExternal->TagIndex;
244 uint32_t Characteristics = WeakExternal->Characteristics;
268 SymIndex += Sym->getNumberOfAuxSymbols();
288 StringRef S = Arg->getValue();
289 switch (Arg->getOption().getID()) {
300 auto DataCopy = G->allocateContent(S);
302 ExternalSymbols[StrCopy] = &G->addExternalSymbol(StrCopy, 0, false);
303 ExternalSymbols[StrCopy]->setLive(true);
310 dbgs() << "Unknown coff directive: " << Arg->getSpelling() << "\n";
339 setGraphSymbol(AliasSymbol->getSectionNumber(), WeakExternal.Alias,
345 << AliasSymbol->getSectionNumber() << "\n";
362 G->makeDefined(*Alias, Target->getBlock(), Target->getOffset(),
363 Target->getSize(), Linkage::Weak, Scope::Local, false);
373 &G->addExternalSymbol(SymbolName, Symbol.getValue(), false);
393 return &G->addDefinedSymbol(Target.getBlock(), Target.getOffset(), SymbolName,
413 orc::ExecutorAddrDiff LastOffset = B->getSize();
414 orc::ExecutorAddrDiff LastDifferentOffset = B->getSize();
417 orc::ExecutorAddrDiff Offset = It->first;
418 jitlink::Symbol *Symbol = It->second;
421 if (Symbol->getOffset() == LastOffset)
424 CandSize = LastOffset - Offset;
427 if (Offset + Symbol->getSize() > LastDifferentOffset)
428 dbgs() << " Overlapping symbol range generated for the following "
438 if (Symbol->getSize()) {
439 // Non empty symbol can happen in COMDAT symbol.
440 // We don't consider the possibility of overlapping symbol range that
443 // used by jitlink-check where we have control to not make overlapping
456 Symbol->setSize(CandSize);
467 return &G->addDefinedSymbol(
468 G->createZeroFillBlock(getCommonSection(), Symbol.getValue(),
474 return &G->addAbsoluteSymbol(SymbolName,
498 auto GSym = &G->addDefinedSymbol(
518 return &G->addDefinedSymbol(
522 if (Definition->Selection == COFF::IMAGE_COMDAT_SELECT_ASSOCIATIVE) {
523 auto Target = Definition->getNumber(Symbol.isBigObj());
524 auto GSym = &G->addDefinedSymbol(
527 getGraphBlock(Target)->addEdge(Edge::KeepAlive, 0, *GSym, 0);
559 switch (Definition->Selection) {
582 << Symbol.getSectionNumber() << " (size: " << Definition->Length
595 formatv("{0:d}", Definition->Selection));
599 Definition->Length};
610 // NOTE: ComdatDef->Length is the size of "section" not size of symbol.
612 // offset is non-zero.
613 auto GSym = &G->addDefinedSymbol(
614 *B, Symbol.getValue(), SymbolName, 0, PendingComdatExport->Linkage,
623 setGraphSymbol(Symbol.getSectionNumber(), PendingComdatExport->SymbolIndex,