diff options
author | Alan Modra <amodra@gmail.com> | 2015-02-13 10:16:16 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2015-02-13 11:46:19 +1030 |
commit | 451dfd384383160be5bc60f50a7920975e66f593 (patch) | |
tree | 7b6155eee8d9a3dbd7f31fe1314488d671446ce8 /bfd/elf64-ppc.c | |
parent | fc4c425de70c3a4f7826010c0d65bfe6fbf00fb8 (diff) | |
download | gdb-451dfd384383160be5bc60f50a7920975e66f593.zip gdb-451dfd384383160be5bc60f50a7920975e66f593.tar.gz gdb-451dfd384383160be5bc60f50a7920975e66f593.tar.bz2 |
PowerPC64 offset check should test entire 64-bit value is in section
PR binutils/17512
* elf64-ppc.c (opd_entry_value): Tighten offset check. Remove
now redundant assert.
Diffstat (limited to 'bfd/elf64-ppc.c')
-rw-r--r-- | bfd/elf64-ppc.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c index 542ed1c..38bc3fb 100644 --- a/bfd/elf64-ppc.c +++ b/bfd/elf64-ppc.c @@ -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) |