This is an archive of the discontinued LLVM Phabricator instance.

[ELF] - Produce fatal error if we not able to create DWARFContextInMemory object.
AbandonedPublic

Authored by grimar on Jun 18 2017, 8:33 AM.

Details

Reviewers
ruiu
rafael
Summary

We use DWARFContextInMemory for 2 purposes currently in LLD.

  1. To report error line number when reporting errors.

I noticed in AVR patch (at one of moments during reviews) that we had undefined error
and DWARF context reported multiple issues like "relocation is not supported" or something like
that. That happens because there is no support for AVR relocations on parsers side.
I guess result of working with such object in unexpected and since LLD looks at some point where
there is chance to see even more new targets probably, I think we should fatal().

  1. For .gdb_index building. Currently we have PR33173 and

"failed to compute relocation: R_X86_64_DTPOFF32 with --gdb-index". But also may have any other different errors,
like error of decompression of section or anything else because of broken object for example. That is true for
first case as well. And even now when looks that single relocation fail does not affect on index, it still wrong
not to fail in this case. That what was suggested in D33673 thread.

Also one benefit that we can fail early ar parsers side and do not wait for all section to be proccessed.
I'll post change for LLVM side shortly and update note with reference.

Diff Detail