diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2017-06-26 20:33:45 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2017-06-26 20:33:45 +0000 |
commit | 4ea16835ba66f2240d050ffcaee44cee6c97cab9 (patch) | |
tree | d2f3d66f3352a3ec22362de0b7a5c1366fc25df8 /COFF/InputFiles.cpp | |
parent | 15f7a1a3796209b21af2817fdf11ca9932165c70 (diff) |
Notes
Diffstat (limited to 'COFF/InputFiles.cpp')
-rw-r--r-- | COFF/InputFiles.cpp | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/COFF/InputFiles.cpp b/COFF/InputFiles.cpp index 58e8dd329f1f..c26483e3e368 100644 --- a/COFF/InputFiles.cpp +++ b/COFF/InputFiles.cpp @@ -132,17 +132,17 @@ void ObjectFile::initializeChunks() { if (!Config->Debug && Name.startswith(".debug")) continue; - // CodeView sections are stored to a different vector because they are - // not linked in the regular manner. - if (Name == ".debug" || Name.startswith(".debug$")) { - DebugChunks.push_back(make<SectionChunk>(this, Sec)); - continue; - } - if (Sec->Characteristics & llvm::COFF::IMAGE_SCN_LNK_REMOVE) continue; auto *C = make<SectionChunk>(this, Sec); - Chunks.push_back(C); + + // CodeView sections are stored to a different vector because they are not + // linked in the regular manner. + if (C->isCodeView()) + DebugChunks.push_back(C); + else + Chunks.push_back(C); + SparseChunks[I] = C; } } @@ -249,8 +249,12 @@ SymbolBody *ObjectFile::createDefined(COFFSymbolRef Sym, const void *AuxP, auto *Aux = reinterpret_cast<const coff_aux_section_definition *>(AuxP); if (Aux->Selection == IMAGE_COMDAT_SELECT_ASSOCIATIVE) if (auto *ParentSC = cast_or_null<SectionChunk>( - SparseChunks[Aux->getNumber(Sym.isBigObj())])) + SparseChunks[Aux->getNumber(Sym.isBigObj())])) { ParentSC->addAssociative(SC); + // If we already discarded the parent, discard the child. + if (ParentSC->isDiscarded()) + SC->markDiscarded(); + } SC->Checksum = Aux->CheckSum; } |