]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
Replace assert with error message
authorPetr Machata <pmachata@redhat.com>
Fri, 13 Feb 2009 14:33:46 +0000 (15:33 +0100)
committerPetr Machata <pmachata@redhat.com>
Fri, 13 Feb 2009 14:33:46 +0000 (15:33 +0100)
src/dwarflint.c

index 583568dd08eec97011bf14ea9d9fec6a3367b1b9..1c8f5622bf54dde2a52abe143603a9b54ccb5f8e 100644 (file)
@@ -2314,13 +2314,18 @@ relocate_one (struct relocation_data *reloc, GElf_Rela *rela,
              uint64_t *value, struct where *where,
              enum section_id offset_into)
 {
-  assert (offset_into != sec_invalid);
-
   struct where reloc_where = where_from_reloc (reloc, where);
   where_reset_2 (&reloc_where, rela->r_offset);
   struct where reloc_ref_where = reloc_where;
   reloc_ref_where.next = where;
 
+  if (offset_into == sec_invalid)
+    {
+      wr_message (mc_impact_3 | mc_reloc, &reloc_ref_where,
+                 ": relocates a datum that shouldn't be relocated.\n");
+      return;
+    }
+
   uint64_t addend;
   if (reloc->type == SHT_REL)
     addend = *value;