[binutils-gdb] PR27630, ubsan: elf32-arm.c:6587:20

Alan Modra amodra@sourceware.org
Wed Apr 14 08:59:45 GMT 2021


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=c9f9a78d00d1a054c013da612949bbd6d1720ed7

commit c9f9a78d00d1a054c013da612949bbd6d1720ed7
Author: Alan Modra <amodra@gmail.com>
Date:   Wed Apr 14 17:22:33 2021 +0930

    PR27630, ubsan: elf32-arm.c:6587:20
    
            PR 27630
            * elf32-arm.c (elf32_arm_size_stubs): Don't use &hash->root when
            hash might be NULL, cast instead.

Diff:
---
 bfd/ChangeLog   | 6 ++++++
 bfd/elf32-arm.c | 5 +++--
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 1603be8e954..c3e52533a10 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -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.
diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c
index 29656a7ab63..81667ea090d 100644
--- a/bfd/elf32-arm.c
+++ b/bfd/elf32-arm.c
@@ -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]))


More information about the Binutils-cvs mailing list