]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
dwarflint: Check that the relocation is formed using a defined symbol
authorPetr Machata <pmachata@redhat.com>
Tue, 1 Mar 2011 16:54:54 +0000 (17:54 +0100)
committerPetr Machata <pmachata@redhat.com>
Tue, 1 Mar 2011 16:55:48 +0000 (17:55 +0100)
dwarflint/reloc.cc

index 2de0ceca61194adb1b41e68ae6a947b95a6c2443..8edc78b2dcc821daa878aea2eb68d50320b6abed 100644 (file)
@@ -161,6 +161,14 @@ do_one_relocation (elf_file const *file,
      would be possible to use dwfl, which already does XINDEX
      translation.  */
 
+  if (section_index == 0)
+    {
+       wr_error (reloc_where)
+         << "relocation refers to an undefined symbol."
+         << std::endl;
+       return;
+    }
+
   // Valid in the sense that it can be used as an index to file->sec
   bool section_index_valid = section_index < file->size;