From: Petr Machata Date: Tue, 1 Mar 2011 16:54:54 +0000 (+0100) Subject: dwarflint: Check that the relocation is formed using a defined symbol X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9da4db3e16599f3d4232264138b3f4fab93df37c;p=thirdparty%2Felfutils.git dwarflint: Check that the relocation is formed using a defined symbol --- diff --git a/dwarflint/reloc.cc b/dwarflint/reloc.cc index 2de0ceca6..8edc78b2d 100644 --- a/dwarflint/reloc.cc +++ b/dwarflint/reloc.cc @@ -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;