[PATCH] D34814: [ELF] - Fail the link if something happens on DWARF parsing stage of -gdb-index building

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 12 01:05:48 PDT 2017


grimar added inline comments.


================
Comment at: lld/trunk/ELF/SyntheticSections.cpp:1817
+          toString(std::move(E)));
+    return ErrorPolicy::Continue;
+  });
----------------
ruiu wrote:
> What does this `ErrorPolicy::Continue` mean? If there's something like `Abort`, you want to abort, as if something is broken in a DWARF debug info, it is very likely that the following bytes are also garbage.
There are `ErrorPolicy::Continue` and `ErrorPolicy::Halt` currently imlemented. 
First one allows parsers to continue parsing object, second terminates parsing.

`Continue` used here intentionally because allows to report as many errors as possible and not `Abort` instantly.
(that is consistent with how compilers (and linkers) behave usually).

> it is very likely that the following bytes are also garbage.
Broken objects is only a one side, there are many examples where `Continue` behavior may be more desirable:

* For example currently we have case when one of X86_64 relocations is not supported (PR33173), we probably want to report all such cases and not fail after very first error.
* Another example - we currently have AVR target in LLD, and DWARF parsers do not support its relocations at all. With `Continue` we will list `ErrorLimit` amount of places where it faces unimplemented relocations, what can be useful for working on AVR and other possible new targets.
* If something wrong with compressed section, DWARF parsers would report a error currently ("failed to decompress .... "), it makes sence to continue parsing other sections to find more possible issues I think.


Repository:
  rL LLVM

https://reviews.llvm.org/D34814





More information about the llvm-commits mailing list