From 099dd52727f2ce1a2c73cde82af8cd5e06368aec Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Mon, 13 Aug 2007 22:58:36 +0000 Subject: missed testdata files --- libdwfl/elf-from-memory.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'libdwfl/elf-from-memory.c') diff --git a/libdwfl/elf-from-memory.c b/libdwfl/elf-from-memory.c index a292210a..c0e7c46d 100644 --- a/libdwfl/elf-from-memory.c +++ b/libdwfl/elf-from-memory.c @@ -213,6 +213,7 @@ elf_from_remote_memory (GElf_Addr ehdr_vma, 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 @@ elf_from_remote_memory (GElf_Addr ehdr_vma, 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; } -- cgit v1.2.3