aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2010-03-17 13:46:35 +0000
committerH.J. Lu <hjl.tools@gmail.com>2010-03-17 13:46:35 +0000
commit4b0f07110e55b09f44ef95a36e4d7ca4612de33c (patch)
treec35fe6b6cab658081aafda29dfd254499a7b8b53 /bfd
parentd8c09fb595c4ad7ea517ec2bed1458bd18782b37 (diff)
downloadgdb-4b0f07110e55b09f44ef95a36e4d7ca4612de33c.zip
gdb-4b0f07110e55b09f44ef95a36e4d7ca4612de33c.tar.gz
gdb-4b0f07110e55b09f44ef95a36e4d7ca4612de33c.tar.bz2
Avoid overflow.
2010-03-17 Jie Zhang <jie@codesourcery.com> * elf.c (assign_file_positions_for_load_sections): Avoid overflow.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/elf.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 1008a66..bcfae55 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,8 @@
+2010-03-17 Jie Zhang <jie@codesourcery.com>
+
+ * elf.c (assign_file_positions_for_load_sections): Avoid
+ overflow.
+
2010-03-17 Alan Modra <amodra@gmail.com>
* plugin.c (bfd_plugin_object_p): Pass iostream to fileno using
diff --git a/bfd/elf.c b/bfd/elf.c
index dbb13d4..cee9b7a 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -4452,7 +4452,7 @@ assign_file_positions_for_load_sections (bfd *abfd,
{
bfd_signed_vma adjust = sec->vma - (p->p_vaddr + p->p_memsz);
- if (adjust < 0)
+ if (sec->vma < p->p_vaddr + p->p_memsz)
{
(*_bfd_error_handler)
(_("%B: section %A vma 0x%lx overlaps previous sections"),