missed testdata files
diff --git a/libdwfl/elf-from-memory.c b/libdwfl/elf-from-memory.c
index a292210..c0e7c46 100644
--- a/libdwfl/elf-from-memory.c
+++ b/libdwfl/elf-from-memory.c
@@ -213,6 +213,7 @@
size_t contents_size = 0;
GElf_Off segments_end = 0;
GElf_Addr loadbase = ehdr_vma;
+ bool found_base = false;
switch (ehdr.e32.e_ident[EI_CLASS])
{
inline void handle_segment (GElf_Addr vaddr, GElf_Off offset,
@@ -223,8 +224,11 @@
if (segment_end > (GElf_Off) contents_size)
contents_size = segment_end;
- if ((offset & -align) == 0 && loadbase == ehdr_vma)
- loadbase = ehdr_vma - (vaddr & -align);
+ if (!found_base && (offset & -align) == 0)
+ {
+ loadbase = ehdr_vma - (vaddr & -align);
+ found_base = true;
+ }
segments_end = offset + filesz;
}