2008-07-20 Sergei Poselenov <sposelenov@emcraft.com>
authorChris Demetriou <cgd@google.com>
Mon, 21 Jul 2008 05:05:23 +0000 (05:05 +0000)
committerChris Demetriou <cgd@google.com>
Mon, 21 Jul 2008 05:05:23 +0000 (05:05 +0000)
            Chris Demetriou  <cgd@google.com>

        * elfread.c (elf_symfile_segments): Fix the check that each loadable
        section fits within an ELF segment to handle ELF segments that hit
        the end of the address space.

gdb/ChangeLog
gdb/elfread.c

index d3e5943c8c9ebb979842a2032aaf8cc4d48ad148..73c032ceec8127781938d5269259af9a4a1546d5 100644 (file)
@@ -1,3 +1,10 @@
+2008-07-20  Sergei Poselenov  <sposelenov@emcraft.com>
+            Chris Demetriou  <cgd@google.com>
+
+       * elfread.c (elf_symfile_segments): Fix the check that each loadable
+       section fits within an ELF segment to handle ELF segments that hit
+       the end of the address space.
+
 2008-07-20  Chris Demetriou  <cgd@google.com>
 
        * MAINTAINERS (Write After Approval): Add self.
index 363702a99fc369fc8457a74330347791cb95fd14..0b082472bb8711d489db33121b1adaf9d2e64db4 100644 (file)
@@ -108,7 +108,7 @@ elf_symfile_segments (bfd *abfd)
       for (j = 0; j < num_segments; j++)
        if (segments[j]->p_memsz > 0
            && vma >= segments[j]->p_vaddr
-           && vma < segments[j]->p_vaddr + segments[j]->p_memsz)
+           && (vma - segments[j]->p_vaddr) < segments[j]->p_memsz)
          {
            data->segment_info[i] = j + 1;
            break;