]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
dwarflint: Fix DW_FORM_ref_addr dwarf_64/addr_64 mixup
authorPetr Machata <pmachata@redhat.com>
Wed, 29 Jul 2009 13:24:37 +0000 (15:24 +0200)
committerPetr Machata <pmachata@redhat.com>
Tue, 4 Aug 2009 14:14:20 +0000 (16:14 +0200)
src/dwarflint.c

index 3325b4d4c7be53159e6bd9d0c0fda32a9783adc0..4c0bb29c062fc250181614843010f061330de459 100644 (file)
@@ -2999,8 +2999,9 @@ read_die_chain (struct elf_file *file,
            case DW_FORM_addr:
            case DW_FORM_ref_addr:
              {
+               bool ref_64 = form == DW_FORM_addr ? addr_64 : dwarf_64;
                uint64_t addr;
-               if (!read_ctx_read_offset (ctx, addr_64, &addr))
+               if (!read_ctx_read_offset (ctx, ref_64, &addr))
                  goto cant_read;
 
                uint64_t *addrp = NULL;
@@ -3024,7 +3025,7 @@ read_die_chain (struct elf_file *file,
                if ((rel = relocation_next (reloc, ctx_offset,
                                            &where, skip_mismatched)))
                  {
-                   relocate_one (file, reloc, rel, addr_64 ? 8 : 4, &addr,
+                   relocate_one (file, reloc, rel, ref_64 ? 8 : 4, &addr,
                                  &where, reloc_target (form, it), symbolp);
                    if (relocatedp != NULL)
                      *relocatedp = true;