diff options
author | Alan Modra <amodra@gmail.com> | 2020-08-25 01:51:39 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2020-08-25 02:12:35 +0930 |
commit | 573eb292ee79dc78207cedadaa8acbb1922ab699 (patch) | |
tree | c8bec6cfb1bef86edb3eabd13dbd7c771ac9baed /bfd | |
parent | a8d549c006a2135b86186d14ab5d0d5fdb702b2f (diff) | |
download | gdb-573eb292ee79dc78207cedadaa8acbb1922ab699.zip gdb-573eb292ee79dc78207cedadaa8acbb1922ab699.tar.gz gdb-573eb292ee79dc78207cedadaa8acbb1922ab699.tar.bz2 |
PR26492, ASAN: ppc64_elf_before_check_relocs elf64-ppc.c:4337
PR 26492
* elf64-ppc.c (ppc_hash_table): Test is_elf_hash_table before
accessing elf_hash_table_id.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 6 | ||||
-rw-r--r-- | bfd/elf64-ppc.c | 5 |
2 files changed, 9 insertions, 2 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index aae0c4d..8f062b0 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,5 +1,11 @@ 2020-08-25 Alan Modra <amodra@gmail.com> + PR 26492 + * elf64-ppc.c (ppc_hash_table): Test is_elf_hash_table before + accessing elf_hash_table_id. + +2020-08-25 Alan Modra <amodra@gmail.com> + PR 26483 * elf32-ppc.c (ppc_elf_hash_table): Test is_elf_hash_table before accessing elf_hash_table_id. diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c index 02f0f18..5a21bfa 100644 --- a/bfd/elf64-ppc.c +++ b/bfd/elf64-ppc.c @@ -3276,8 +3276,9 @@ struct ppc_link_hash_table /* Get the ppc64 ELF linker hash table from a link_info structure. */ #define ppc_hash_table(p) \ - (elf_hash_table_id ((struct elf_link_hash_table *) ((p)->hash)) \ - == PPC64_ELF_DATA ? ((struct ppc_link_hash_table *) ((p)->hash)) : NULL) + ((is_elf_hash_table ((p)->hash) \ + && elf_hash_table_id (elf_hash_table (p)) == PPC64_ELF_DATA) \ + ? (struct ppc_link_hash_table *) (p)->hash : NULL) #define ppc_stub_hash_lookup(table, string, create, copy) \ ((struct ppc_stub_hash_entry *) \ |