aboutsummaryrefslogtreecommitdiff
path: root/bfd/elfxx-x86.h
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2017-09-03 22:04:09 +0930
committerAlan Modra <amodra@gmail.com>2017-09-03 22:09:38 +0930
commit1cf58434bf9d90ea0669f97514c63dc1ccf38f7c (patch)
treebca699596adddfe129b352d5dcb880c7a2081f9b /bfd/elfxx-x86.h
parent23fdd69e42180578b3e15ba8f053fadde965bfe8 (diff)
downloadgdb-1cf58434bf9d90ea0669f97514c63dc1ccf38f7c.zip
gdb-1cf58434bf9d90ea0669f97514c63dc1ccf38f7c.tar.gz
gdb-1cf58434bf9d90ea0669f97514c63dc1ccf38f7c.tar.bz2
PR22067, x86 check_relocs invalid read
PR 22067 * elfxx-x86.h (elf_x86_hash_table): Check is_elf_hash_table first.
Diffstat (limited to 'bfd/elfxx-x86.h')
-rw-r--r--bfd/elfxx-x86.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/bfd/elfxx-x86.h b/bfd/elfxx-x86.h
index 61244f5..9c0dcbbe 100644
--- a/bfd/elfxx-x86.h
+++ b/bfd/elfxx-x86.h
@@ -41,7 +41,8 @@
#define ELIMINATE_COPY_RELOCS 1
#define elf_x86_hash_table(p, id) \
- (elf_hash_table_id ((struct elf_link_hash_table *) ((p)->hash)) == (id) \
+ (is_elf_hash_table ((p)->hash) \
+ && elf_hash_table_id ((struct elf_link_hash_table *) ((p)->hash)) == (id) \
? ((struct elf_x86_link_hash_table *) ((p)->hash)) : NULL)
/* Is a undefined weak symbol which is resolved to 0. Reference to an