PR27630, ubsan: elf32-arm.c:6587:20
authorAlan Modra <amodra@gmail.com>
Wed, 14 Apr 2021 07:52:33 +0000 (17:22 +0930)
committerAlan Modra <amodra@gmail.com>
Wed, 14 Apr 2021 07:56:15 +0000 (17:26 +0930)
PR 27630
* elf32-arm.c (elf32_arm_size_stubs): Don't use &hash->root when
hash might be NULL, cast instead.

bfd/ChangeLog
bfd/elf32-arm.c

index 1603be8e954014d74299ee178d524eccf8da2933..c3e52533a1017794c5c16e4c3b72764d89d4861d 100644 (file)
@@ -1,3 +1,9 @@
+2021-04-14  Alan Modra  <amodra@gmail.com>
+
+       PR 27630
+       * elf32-arm.c (elf32_arm_size_stubs): Don't use &hash->root when
+       hash might be NULL, cast instead.
+
 2021-04-13  ClĂ©ment Chigot  <clement.chigot@atos.net>
 
        * xcofflink.c (xcoff_link_check_ar_symbols): Update esym earlier.
index 29656a7ab63405a0cd29fdf693563bca3b768657..81667ea090d51e505368b4299f1bf5d0fa7d1509 100644 (file)
@@ -6582,8 +6582,9 @@ elf32_arm_size_stubs (bfd *output_bfd,
                      && (r_type != (unsigned int) R_ARM_PLT32)
                      && !((r_type == (unsigned int) R_ARM_TLS_CALL
                            || r_type == (unsigned int) R_ARM_THM_TLS_CALL)
-                          && r_type == elf32_arm_tls_transition
-                              (info, r_type, &hash->root)
+                          && r_type == (elf32_arm_tls_transition
+                                        (info, r_type,
+                                         (struct elf_link_hash_entry *) hash))
                           && ((hash ? hash->tls_type
                                : (elf32_arm_local_got_tls_type
                                   (input_bfd)[r_indx]))