From 8e5393c6799cdf07ab5f05bc8ab5d44929940e5f Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Tue, 2 Jul 2013 13:35:29 +0200 Subject: [PATCH] Don't assert on mod->e_type in __libdwfl_relocate_value. When setting up the module and searching for an ELF file with a correct build_id __libdwfl_relocate_value will be called for an ET_REL file in __libdwfl_find_elf_build_id but mod->e_type is not yet setup in that case because the Dwfl_Module isn't yet complete (the build-id could mismatch). This can happen when using the dwfl_linux_kernel_find_elf callback when it searches for the ELF file matching a kernel module. --- libdwfl/ChangeLog | 4 ++++ libdwfl/relocate.c | 2 -- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/libdwfl/ChangeLog b/libdwfl/ChangeLog index e0004130a..68406c932 100644 --- a/libdwfl/ChangeLog +++ b/libdwfl/ChangeLog @@ -1,3 +1,7 @@ +2013-07-02 Mark Wielaard + + * relocate.c (__libdwfl_relocate_value): Remove mod->e_type assert. + 2013-06-05 Mark Wielaard * link_map.c (report_r_debug): Always call release_buffer after diff --git a/libdwfl/relocate.c b/libdwfl/relocate.c index e06819d06..bd51ad6d5 100644 --- a/libdwfl/relocate.c +++ b/libdwfl/relocate.c @@ -38,8 +38,6 @@ internal_function __libdwfl_relocate_value (Dwfl_Module *mod, Elf *elf, size_t *shstrndx, Elf32_Word shndx, GElf_Addr *value) { - assert (mod->e_type == ET_REL); - Elf_Scn *refscn = elf_getscn (elf, shndx); GElf_Shdr refshdr_mem, *refshdr = gelf_getshdr (refscn, &refshdr_mem); if (refshdr == NULL) -- 2.47.2