]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
dwarflint: Handle NONE relocations
authorPetr Machata <pmachata@redhat.com>
Tue, 7 Apr 2009 15:55:57 +0000 (17:55 +0200)
committerPetr Machata <pmachata@redhat.com>
Fri, 10 Apr 2009 13:43:26 +0000 (15:43 +0200)
src/dwarflint.c

index 1d58e63115036b3426ce09ecd1b92f6c4953c875..e5f7bbec8815262aff21847eddd46c4e3b0ba2de 100644 (file)
@@ -4618,9 +4618,17 @@ read_rel (struct section_data *secdata, Elf_Data *reldata, bool elf_64)
          continue;
        }
 
+      int cur_type = GELF_R_TYPE (rela->r_info);
+      if (cur_type == 0) /* No relocation.  */
+       {
+         wr_message (mc_impact_3 | mc_reloc | mc_acc_bloat, &where,
+                     ": NONE relocation is superfluous.\n");
+         goto skip;
+       }
+
       cur->offset = rela->r_offset;
       cur->symndx = GELF_R_SYM (rela->r_info);
-      cur->type = GELF_R_TYPE (rela->r_info);
+      cur->type = cur_type;
 
       where_reset_2 (&where, cur->offset);