PowerPC64 offset check should test entire 64-bit value is in section
authorAlan Modra <amodra@gmail.com>
Thu, 12 Feb 2015 23:46:16 +0000 (10:16 +1030)
committerAlan Modra <amodra@gmail.com>
Fri, 13 Feb 2015 01:16:19 +0000 (11:46 +1030)
PR binutils/17512
* elf64-ppc.c (opd_entry_value): Tighten offset check.  Remove
now redundant assert.

bfd/ChangeLog
bfd/elf64-ppc.c

index 1dd74d0d4a7f6ae1d218dd4ba95d45b016dd6f29..cb08b7738f3ce94b5ce8559e183ad0cff888f432 100644 (file)
@@ -1,3 +1,9 @@
+2015-02-13  Alan Modra  <amodra@gmail.com>
+
+       PR binutils/17512
+       * elf64-ppc.c (opd_entry_value): Tighten offset check.  Remove
+       now redundant assert.
+
 2015-02-12  Nick Clifton  <nickc@redhat.com>
 
        PR binutils/17512
index 542ed1ca31f5eee7bff5ae1c2ed6ce9052502e57..38bc3fb392a3f73509a89c5582e2f450d5956f17 100644 (file)
@@ -5952,7 +5952,7 @@ opd_entry_value (asection *opd_sec,
        }
 
       /* PR 17512: file: 64b9dfbb.  */
-      if (offset > bfd_section_size (opd_bfd, opd_sec))
+      if (offset + 7 >= opd_sec->size || offset + 7 < offset)
        return (bfd_vma) -1;
 
       val = bfd_get_64 (opd_bfd, contents + offset);
@@ -5996,7 +5996,6 @@ opd_entry_value (asection *opd_sec,
 
   /* Go find the opd reloc at the sym address.  */
   lo = relocs;
-  BFD_ASSERT (lo != NULL);
   hi = lo + opd_sec->reloc_count - 1; /* ignore last reloc */
   val = (bfd_vma) -1;
   while (lo < hi)
This page took 0.042926 seconds and 4 git commands to generate.