summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Wielaard <[email protected]>2013-07-02 13:35:29 +0200
committerMark Wielaard <[email protected]>2013-07-08 12:28:43 +0200
commit8e5393c6799cdf07ab5f05bc8ab5d44929940e5f (patch)
treed65bcac2f950066fd7891960465471383d0239b4
parent5704c8c4fa717b6e9c2d2e4304dfbc810ad42e4b (diff)
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.
-rw-r--r--libdwfl/ChangeLog4
-rw-r--r--libdwfl/relocate.c2
2 files changed, 4 insertions, 2 deletions
diff --git a/libdwfl/ChangeLog b/libdwfl/ChangeLog
index e0004130..68406c93 100644
--- a/libdwfl/ChangeLog
+++ b/libdwfl/ChangeLog
@@ -1,3 +1,7 @@
+2013-07-02 Mark Wielaard <[email protected]>
+
+ * relocate.c (__libdwfl_relocate_value): Remove mod->e_type assert.
+
2013-06-05 Mark Wielaard <[email protected]>
* link_map.c (report_r_debug): Always call release_buffer after
diff --git a/libdwfl/relocate.c b/libdwfl/relocate.c
index e06819d0..bd51ad6d 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)