public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* PR26483, ASAN: ppc_elf_link_params elf32-ppc.c:2314
@ 2020-08-24 16:37 Alan Modra
  2020-08-24 17:18 ` Alan Modra
  0 siblings, 1 reply; 2+ messages in thread
From: Alan Modra @ 2020-08-24 16:37 UTC (permalink / raw)
  To: binutils

	PR 26483
	* elf32-ppc.c (ppc_elf_hash_table): Test is_elf_hash_table before
	accessing elf_hash_table_id.

diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c
index 43c0e18896..d5b8a6627a 100644
--- a/bfd/elf32-ppc.c
+++ b/bfd/elf32-ppc.c
@@ -2230,8 +2230,9 @@ struct ppc_elf_link_hash_table
 /* Get the PPC ELF linker hash table from a link_info structure.  */
 
 #define ppc_elf_hash_table(p) \
-  (elf_hash_table_id ((struct elf_link_hash_table *) ((p)->hash)) \
-  == PPC32_ELF_DATA ? ((struct ppc_elf_link_hash_table *) ((p)->hash)) : NULL)
+  ((is_elf_hash_table ((p)->hash)					\
+    && elf_hash_table_id (elf_hash_table (p)) == PPC32_ELF_DATA)	\
+   ? ((struct ppc_elf_link_hash_table *) ((p)->hash)) : NULL)
 
 /* Create an entry in a PPC ELF linker hash table.  */
 

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-08-24 17:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-24 16:37 PR26483, ASAN: ppc_elf_link_params elf32-ppc.c:2314 Alan Modra
2020-08-24 17:18 ` Alan Modra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).