]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
Don't assert on mod->e_type in __libdwfl_relocate_value.
authorMark Wielaard <mjw@redhat.com>
Tue, 2 Jul 2013 11:35:29 +0000 (13:35 +0200)
committerMark Wielaard <mjw@redhat.com>
Mon, 8 Jul 2013 10:28:43 +0000 (12:28 +0200)
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
libdwfl/relocate.c

index e0004130ac10c78a615a3f3b441927677b3f81f1..68406c932dad255df17b13ffa4d3d30eedf7faf9 100644 (file)
@@ -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
index e06819d06b33840ab807a7df9ca440d01185090d..bd51ad6d5706fa423c3e9c92516369d9b71b1635 100644 (file)
@@ -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)