This is the mail archive of the
elfutils-devel@sourceware.org
mailing list for the elfutils project.
[PATCH] Don't assert on mod->e_type in __libdwfl_relocate_value.
- From: Mark Wielaard <mjw at redhat dot com>
- To: elfutils-devel at lists dot fedorahosted dot org
- Date: Tue, 02 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 e000413..68406c9 100644
--- a/libdwfl/ChangeLog
+++ b/libdwfl/ChangeLog
@@ -1,3 +1,7 @@
+2013-07-02 Mark Wielaard <mjw@redhat.com>
+
+ * relocate.c (__libdwfl_relocate_value): Remove mod->e_type assert.
+
2013-06-05 Mark Wielaard <mjw@redhat.com>
* link_map.c (report_r_debug): Always call release_buffer after
diff --git a/libdwfl/relocate.c b/libdwfl/relocate.c
index e06819d..bd51ad6 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)
--
1.7.1