aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorChris Demetriou <cgd@google.com>2008-07-21 05:05:23 +0000
committerChris Demetriou <cgd@google.com>2008-07-21 05:05:23 +0000
commita366c65aeb84ae95691378b12690dea99ef94513 (patch)
tree89da727d03a26a0e4db2d037bb12d197a2e1a852 /gdb
parent1cad8cd3864d48834ad3ed87de35eb9f85905eed (diff)
downloadgdb-a366c65aeb84ae95691378b12690dea99ef94513.zip
gdb-a366c65aeb84ae95691378b12690dea99ef94513.tar.gz
gdb-a366c65aeb84ae95691378b12690dea99ef94513.tar.bz2
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.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog7
-rw-r--r--gdb/elfread.c2
2 files changed, 8 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index d3e5943..73c032c 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -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.
diff --git a/gdb/elfread.c b/gdb/elfread.c
index 363702a..0b08247 100644
--- a/gdb/elfread.c
+++ b/gdb/elfread.c
@@ -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;