[ELF] - Fail the link if something happens on DWARF parsing stage of -gdb-index building
This is relative to PR33173, Previously if something wrong happened on DWARF parsers side during parsing object for building gdb index (like was in PR: unsupported relocation) then LLD continued and finished the link. DWARF parsers sure showed error message on their side, but that is all. Patch changes behavior to fail the link in this case and show more detailed message. Differential revision: https://reviews.llvm.org/D34814 llvm-svn: 307370
This commit is contained in:
@@ -1811,7 +1811,11 @@ GdbIndexChunk GdbIndexSection::readDwarf(InputSection *Sec) {
|
||||
return {};
|
||||
}
|
||||
|
||||
DWARFContextInMemory Dwarf(*Obj.get());
|
||||
DWARFContextInMemory Dwarf(*Obj.get(), nullptr, [&](Error E) {
|
||||
error(toString(Sec->File) + ": error parsing DWARF data:\n>>> " +
|
||||
toString(std::move(E)));
|
||||
return ErrorPolicy::Continue;
|
||||
});
|
||||
|
||||
GdbIndexChunk Ret;
|
||||
Ret.CompilationUnits = readCuList(Dwarf, Sec);
|
||||
|
||||
Reference in New Issue
Block a user