aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2009-05-21 13:49:11 +0000
committerAlan Modra <amodra@gmail.com>2009-05-21 13:49:11 +0000
commit5ef11c0214f8a01a6bc0a5dd9c51383012c372c5 (patch)
treefaa4613138b95856a2e423ef9c513a274d095e14 /bfd
parentebf12fbedc251319fa94bf3dab35992f01f6a8b3 (diff)
downloadgdb-5ef11c0214f8a01a6bc0a5dd9c51383012c372c5.zip
gdb-5ef11c0214f8a01a6bc0a5dd9c51383012c372c5.tar.gz
gdb-5ef11c0214f8a01a6bc0a5dd9c51383012c372c5.tar.bz2
* elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Don't segfault on
out of range .opd symbols.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/elf64-ppc.c7
2 files changed, 12 insertions, 0 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 3b0e97b..50ef873 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,8 @@
+2009-05-21 Alan Modra <amodra@bigpond.net.au>
+
+ * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Don't segfault on
+ out of range .opd symbols.
+
2009-05-21 Dave Korn <dave.korn.cygwin@gmail.com>
* coffgen.c (coff_print_symbol): Use bfd_fprintf_vma, not
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c
index ce82e16..ae3c3b9 100644
--- a/bfd/elf64-ppc.c
+++ b/bfd/elf64-ppc.c
@@ -3033,6 +3033,10 @@ ppc64_elf_get_synthetic_symtab (bfd *abfd,
{
bfd_vma ent;
+ /* Ignore bogus symbols. */
+ if (syms[i]->value > opd->size - 8)
+ continue;
+
ent = bfd_get_64 (abfd, contents + syms[i]->value);
if (!sym_exists_at (syms, opdsymend, symcount, -1, ent))
{
@@ -3126,6 +3130,9 @@ ppc64_elf_get_synthetic_symtab (bfd *abfd,
{
bfd_vma ent;
+ if (syms[i]->value > opd->size - 8)
+ continue;
+
ent = bfd_get_64 (abfd, contents + syms[i]->value);
if (!sym_exists_at (syms, opdsymend, symcount, -1, ent))
{