aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf64-ppc.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2008-01-19 10:07:25 +0000
committerAlan Modra <amodra@gmail.com>2008-01-19 10:07:25 +0000
commit85f7a9cbe2b487f2e27a126161bdee27e77a05cf (patch)
treeed6d838e99ae5fbb27962df87828cdce5af5f6af /bfd/elf64-ppc.c
parent145f4ab500b18cd0d31e7bff54983ded2e45b0cf (diff)
downloadgdb-85f7a9cbe2b487f2e27a126161bdee27e77a05cf.zip
gdb-85f7a9cbe2b487f2e27a126161bdee27e77a05cf.tar.gz
gdb-85f7a9cbe2b487f2e27a126161bdee27e77a05cf.tar.bz2
PR 5646
* elf64-ppc.c (ppc64_elf_tls_optimize): Ensure htab->tls_get_addr non-NULL before dereferencing.
Diffstat (limited to 'bfd/elf64-ppc.c')
-rw-r--r--bfd/elf64-ppc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c
index a41269c..026c52e 100644
--- a/bfd/elf64-ppc.c
+++ b/bfd/elf64-ppc.c
@@ -7074,7 +7074,7 @@ ppc64_elf_tls_optimize (bfd *obfd ATTRIBUTE_UNUSED, struct bfd_link_info *info)
break;
}
- if (expecting_tls_get_addr)
+ if (expecting_tls_get_addr && htab->tls_get_addr != NULL)
{
struct plt_entry *ent;
for (ent = htab->tls_get_addr->elf.plt.plist;
@@ -7091,7 +7091,7 @@ ppc64_elf_tls_optimize (bfd *obfd ATTRIBUTE_UNUSED, struct bfd_link_info *info)
}
}
- if (expecting_tls_get_addr)
+ if (expecting_tls_get_addr && htab->tls_get_addr_fd != NULL)
{
struct plt_entry *ent;
for (ent = htab->tls_get_addr_fd->elf.plt.plist;