]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
Fix dwfl_module_build_id regression in last change.
authorRoland McGrath <roland@redhat.com>
Wed, 22 Apr 2009 18:32:20 +0000 (11:32 -0700)
committerRoland McGrath <roland@redhat.com>
Wed, 22 Apr 2009 18:32:20 +0000 (11:32 -0700)
libdwfl/ChangeLog
libdwfl/dwfl_module_build_id.c

index bc4344c3999ca073a65a80898e540ba04b2ad959..86a08e9329d7b470335ffdea03122ddd0c79a6dc 100644 (file)
@@ -1,3 +1,8 @@
+2009-04-22  Roland McGrath  <roland@redhat.com>
+
+       * dwfl_module_build_id.c (__libdwfl_find_build_id): Fix last change to
+       adjust properly for non-ET_REL.
+
 2009-04-21  Roland McGrath  <roland@redhat.com>
 
        * dwfl_module_getsym.c: Apply non-ET_REL bias only if SHF_ALLOC.
index a3797a5ad716c869731cc65ea23a12d64181ec5b..e1256db7c9ca9b1f08bec819eb3f3fdf95af6d12 100644 (file)
@@ -134,10 +134,12 @@ __libdwfl_find_build_id (Dwfl_Module *mod, bool set, Elf *elf)
          {
            /* Determine the right sh_addr in this module.  */
            GElf_Addr vaddr = 0;
-           if (!(shdr->sh_flags & SHF_ALLOC)
-               || (mod->e_type == ET_REL
-                   && __libdwfl_relocate_value (mod, elf, &shstrndx,
-                                                elf_ndxscn (scn), &vaddr)))
+           if (!(shdr->sh_flags & SHF_ALLOC))
+             vaddr = NO_VADDR;
+           else if (mod->e_type != ET_REL)
+             vaddr = shdr->sh_addr + mod->main.bias;
+           else if (__libdwfl_relocate_value (mod, elf, &shstrndx,
+                                              elf_ndxscn (scn), &vaddr))
              vaddr = NO_VADDR;
            result = check_notes (mod, set, elf_getdata (scn, NULL), vaddr);
          }