From: Roland McGrath Date: Wed, 22 Apr 2009 18:32:20 +0000 (-0700) Subject: Fix dwfl_module_build_id regression in last change. X-Git-Tag: elfutils-0.141~7 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=cc480475458dabde78051d697ec38af6813f131b;p=thirdparty%2Felfutils.git Fix dwfl_module_build_id regression in last change. --- diff --git a/libdwfl/ChangeLog b/libdwfl/ChangeLog index bc4344c39..86a08e932 100644 --- a/libdwfl/ChangeLog +++ b/libdwfl/ChangeLog @@ -1,3 +1,8 @@ +2009-04-22 Roland McGrath + + * dwfl_module_build_id.c (__libdwfl_find_build_id): Fix last change to + adjust properly for non-ET_REL. + 2009-04-21 Roland McGrath * dwfl_module_getsym.c: Apply non-ET_REL bias only if SHF_ALLOC. diff --git a/libdwfl/dwfl_module_build_id.c b/libdwfl/dwfl_module_build_id.c index a3797a5ad..e1256db7c 100644 --- a/libdwfl/dwfl_module_build_id.c +++ b/libdwfl/dwfl_module_build_id.c @@ -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); }