Avoid overflow.
authorH.J. Lu <hjl.tools@gmail.com>
Wed, 17 Mar 2010 13:46:35 +0000 (13:46 +0000)
committerH.J. Lu <hjl.tools@gmail.com>
Wed, 17 Mar 2010 13:46:35 +0000 (13:46 +0000)
2010-03-17  Jie Zhang  <jie@codesourcery.com>

* elf.c (assign_file_positions_for_load_sections): Avoid
overflow.

bfd/ChangeLog
bfd/elf.c

index 1008a6619a14e64d3d2f21f648ed59810f95c2ba..bcfae55e8b108dffbf86f8e6ece276740fe8d72e 100644 (file)
@@ -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
index dbb13d4d76515fbc06e08f8567f7891168c854de..cee9b7a4455164f6f6af1f18762c3f926e88d817 100644 (file)
--- 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"),