(__libdwfl_report_elf): Ignore trailing PT_LOAD with zero vaddr and memsz.
authorRoland McGrath <roland@redhat.com>
Wed, 28 Jan 2009 00:41:54 +0000 (16:41 -0800)
committerRoland McGrath <roland@redhat.com>
Wed, 28 Jan 2009 00:41:54 +0000 (16:41 -0800)
libdwfl/ChangeLog
libdwfl/dwfl_report_elf.c

index 5490f5f..aafa1c9 100644 (file)
@@ -1,3 +1,8 @@
+2009-01-27  Roland McGrath  <roland@redhat.com>
+
+       * dwfl_report_elf.c (__libdwfl_report_elf): Ignore trailing PT_LOAD
+       with zero vaddr and memsz.
+
 2009-01-22  Roland McGrath  <roland@redhat.com>
 
        * open.c (decompress): Move BUFFER, SIZE decls outside #if.
index 3482a22..9fc156f 100644 (file)
@@ -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;