PR26492, ASAN: ppc64_elf_before_check_relocs elf64-ppc.c:4337
authorAlan Modra <amodra@gmail.com>
Mon, 24 Aug 2020 16:21:39 +0000 (01:51 +0930)
committerAlan Modra <amodra@gmail.com>
Mon, 24 Aug 2020 16:42:35 +0000 (02:12 +0930)
PR 26492
* elf64-ppc.c (ppc_hash_table): Test is_elf_hash_table before
accessing elf_hash_table_id.

bfd/ChangeLog
bfd/elf64-ppc.c

index aae0c4d02a58b06552005a88f8a081661609b9b2..8f062b085f3126cd0cd0f1151825b0fb19a9edaa 100644 (file)
@@ -1,3 +1,9 @@
+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
index 02f0f18fc70fd102b0084a9e64f527feb135b0de..5a21bfafbcf961fa6bce130fb04245d7a0ab4f17 100644 (file)
@@ -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 *) \
This page took 0.037788 seconds and 4 git commands to generate.