[lld] r319401 - Error instead of ignoring broken debug info.

Rafael Espindola via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 29 21:37:35 PST 2017


Author: rafael
Date: Wed Nov 29 21:37:35 2017
New Revision: 319401

URL: http://llvm.org/viewvc/llvm-project?rev=319401&view=rev
Log:
Error instead of ignoring broken debug info.

Thanks to Davide for noticing.

Modified:
    lld/trunk/ELF/GdbIndex.cpp
    lld/trunk/test/ELF/undef-broken-debug.test

Modified: lld/trunk/ELF/GdbIndex.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/GdbIndex.cpp?rev=319401&r1=319400&r2=319401&view=diff
==============================================================================
--- lld/trunk/ELF/GdbIndex.cpp (original)
+++ lld/trunk/ELF/GdbIndex.cpp Wed Nov 29 21:37:35 2017
@@ -69,10 +69,12 @@ LLDDwarfObj<ELFT>::findAux(const InputSe
   const typename ELFT::Sym &Sym = File->getELFSyms()[SymIndex];
   uint32_t SecIndex = File->getSectionIndex(Sym);
 
-  // Broken debug info can point to a non-Defined symbol, just ignore it.
+  // Broken debug info can point to a non-Defined symbol.
   auto *DR = dyn_cast<Defined>(&File->getRelocTargetSym(Rel));
-  if (!DR)
+  if (!DR) {
+    error("unsupported relocation target while parsing debug info");
     return None;
+  }
   uint64_t Val = DR->Value + getAddend<ELFT>(Rel);
 
   // FIXME: We should be consistent about always adding the file

Modified: lld/trunk/test/ELF/undef-broken-debug.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/undef-broken-debug.test?rev=319401&r1=319400&r2=319401&view=diff
==============================================================================
--- lld/trunk/test/ELF/undef-broken-debug.test (original)
+++ lld/trunk/test/ELF/undef-broken-debug.test Wed Nov 29 21:37:35 2017
@@ -5,6 +5,7 @@
 # The debug info has a broken relocation. Check that we don't crash
 # and still report the undefined symbol.
 
+# CHECK: error: unsupported relocation target while parsing debug info
 # CHECK: error: undefined symbol: bar
 
 --- !ELF




More information about the llvm-commits mailing list