Index: COFF/Chunks.cpp =================================================================== --- COFF/Chunks.cpp +++ COFF/Chunks.cpp @@ -33,7 +33,8 @@ : Chunk(SectionKind), File(F), Header(H), Relocs(File->getCOFFObj()->getRelocations(Header)), Repl(this) { // Initialize SectionName. - File->getCOFFObj()->getSectionName(Header, SectionName); + if (Expected E = File->getCOFFObj()->getSectionName(Header)) + SectionName = *E; Alignment = Header->getAlignment(); Index: COFF/InputFiles.cpp =================================================================== --- COFF/InputFiles.cpp +++ COFF/InputFiles.cpp @@ -168,9 +168,11 @@ const coff_section *Sec = getSection(SectionNumber); StringRef Name; - if (auto EC = COFFObj->getSectionName(Sec, Name)) + if (Expected E = COFFObj->getSectionName(Sec)) + Name = *E; + else fatal("getSectionName failed: #" + Twine(SectionNumber) + ": " + - EC.message()); + toString(E.takeError())); if (Name == ".drectve") { ArrayRef Data; @@ -242,7 +244,8 @@ COFFObj->getSymbolName(Sym, Name); const coff_section *ParentSec = getSection(ParentIndex); - COFFObj->getSectionName(ParentSec, ParentName); + if (Expected E = COFFObj->getSectionName(ParentSec)) + ParentName = *E; error(toString(this) + ": associative comdat " + Name + " (sec " + Twine(SectionNumber) + ") has invalid reference to section " + ParentName + " (sec " + Twine(ParentIndex) + ")");