From 9da4db3e16599f3d4232264138b3f4fab93df37c Mon Sep 17 00:00:00 2001 From: Petr Machata Date: Tue, 1 Mar 2011 17:54:54 +0100 Subject: [PATCH] dwarflint: Check that the relocation is formed using a defined symbol --- dwarflint/reloc.cc | 8 ++++++++ 1 file changed, 8 insertions(+) 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; -- 2.47.2