[PATCH] D52777: [LLD] - Do not crash when reporting errors when .debug_line_str (DWARF5) is used.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 2 04:37:50 PDT 2018


grimar created this revision.
grimar added a reviewer: ruiu.
Herald added subscribers: JDevlieghere, arichardson, aprantl, emaste.
Herald added a reviewer: espindola.

Imagine we have the following code:

  int foo();
  int main() { return foo(); }

It will crash if you try to compile it with`clang -O0 -gdwarf-5 test.cpp -o test -g -fuse-ld=lld`

The crash happens inside the LLVM DWARF parser because LLD does not provide the `.debug_line_str` section.
At the same time for correct parsing and reporting, we anyways need to provide this section from our side.
The patch fixes the issue.


https://reviews.llvm.org/D52777

Files:
  ELF/DWARF.cpp
  ELF/DWARF.h
  test/ELF/debug-line-str.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D52777.167921.patch
Type: text/x-patch
Size: 6805 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181002/64be9342/attachment.bin>


More information about the llvm-commits mailing list