From: Roland McGrath Date: Wed, 28 Jan 2009 00:41:54 +0000 (-0800) Subject: (__libdwfl_report_elf): Ignore trailing PT_LOAD with zero vaddr and memsz. X-Git-Tag: elfutils-0.140~13^2~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e738ad2e9f2b5a95dfd86f986ee3ebc0fc41f46c;p=thirdparty%2Felfutils.git (__libdwfl_report_elf): Ignore trailing PT_LOAD with zero vaddr and memsz. --- diff --git a/libdwfl/ChangeLog b/libdwfl/ChangeLog index 5490f5f0f..aafa1c929 100644 --- a/libdwfl/ChangeLog +++ b/libdwfl/ChangeLog @@ -1,3 +1,8 @@ +2009-01-27 Roland McGrath + + * dwfl_report_elf.c (__libdwfl_report_elf): Ignore trailing PT_LOAD + with zero vaddr and memsz. + 2009-01-22 Roland McGrath * open.c (decompress): Move BUFFER, SIZE decls outside #if. diff --git a/libdwfl/dwfl_report_elf.c b/libdwfl/dwfl_report_elf.c index 3482a2298..9fc156fe0 100644 --- a/libdwfl/dwfl_report_elf.c +++ b/libdwfl/dwfl_report_elf.c @@ -208,7 +208,8 @@ __libdwfl_report_elf (Dwfl *dwfl, const char *name, const char *file_name, GElf_Phdr phdr_mem, *ph = gelf_getphdr (elf, i, &phdr_mem); if (unlikely (ph == NULL)) goto elf_error; - if (ph->p_type == PT_LOAD) + if (ph->p_type == PT_LOAD + && ph->p_vaddr + ph->p_memsz > 0) { end = base + (ph->p_vaddr + ph->p_memsz); break;