summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoland McGrath <[email protected]>2009-04-22 11:32:20 -0700
committerRoland McGrath <[email protected]>2009-04-22 11:32:20 -0700
commitcc480475458dabde78051d697ec38af6813f131b (patch)
treecebaaaf34697d13b00f95517d9b9f832294144a6
parent19a8e4dbd8268b8f0add9803d80d0266eac1aaa9 (diff)
Fix dwfl_module_build_id regression in last change.
-rw-r--r--libdwfl/ChangeLog5
-rw-r--r--libdwfl/dwfl_module_build_id.c10
2 files changed, 11 insertions, 4 deletions
diff --git a/libdwfl/ChangeLog b/libdwfl/ChangeLog
index bc4344c3..86a08e93 100644
--- a/libdwfl/ChangeLog
+++ b/libdwfl/ChangeLog
@@ -1,3 +1,8 @@
+2009-04-22 Roland McGrath <[email protected]>
+
+ * dwfl_module_build_id.c (__libdwfl_find_build_id): Fix last change to
+ adjust properly for non-ET_REL.
+
2009-04-21 Roland McGrath <[email protected]>
* 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 a3797a5a..e1256db7 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);
}