From e738ad2e9f2b5a95dfd86f986ee3ebc0fc41f46c Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Tue, 27 Jan 2009 16:41:54 -0800 Subject: [PATCH] (__libdwfl_report_elf): Ignore trailing PT_LOAD with zero vaddr and memsz. --- libdwfl/ChangeLog | 5 +++++ libdwfl/dwfl_report_elf.c | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) 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; -- 2.47.3