]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
dwarflint: Fix SEGV
authorPetr Machata <pmachata@redhat.com>
Wed, 15 Jul 2009 14:29:08 +0000 (16:29 +0200)
committerPetr Machata <pmachata@redhat.com>
Wed, 15 Jul 2009 14:29:08 +0000 (16:29 +0200)
src/dwarflint.c

index c7fb6e83a4d4f5b6d76304dbd36dd834a3249f65..69383007310103f69bd4db59b102cf04b394b767 100644 (file)
@@ -3279,13 +3279,18 @@ read_die_chain (struct read_ctx *ctx,
                    if (relocatedp != NULL)
                      *relocatedp = true;
                  }
-               else if (type_is_rel && addr != 0)
-                 /* In non-rel files, neither addr, nor ref_addr
-                    /need/ a relocation.  We at least check that
-                    ref_addr points to sensible datum by recording
-                    the reference below.  */
-                 wr_message (mc_impact_2 | mc_die_rel | mc_reloc, &where,
-                             PRI_LACK_RELOCATION, dwarf_form_string (form));
+               else
+                 {
+                   if (symbolp != NULL)
+                     WIPE (*symbolp);
+                   if (type_is_rel && addr != 0)
+                     /* In non-rel files, neither addr, nor ref_addr
+                        /need/ a relocation.  We at least check that
+                        ref_addr points to sensible datum by recording
+                        the reference below.  */
+                     wr_message (mc_impact_2 | mc_die_rel | mc_reloc, &where,
+                                 PRI_LACK_RELOCATION, dwarf_form_string (form));
+                 }
                if (addrp != NULL)
                  *addrp = addr;