public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* ubsan elfnn-aarch64.c:7142 shift exponent 32 is too large
@ 2020-09-02  8:42 Alan Modra
  0 siblings, 0 replies; only message in thread
From: Alan Modra @ 2020-09-02  8:42 UTC (permalink / raw)
  To: binutils

	* elfnn-aarch64.c (elfNN_aarch64_relocate_section): Correct type
	of constant shifted left.

diff --git a/bfd/elfnn-aarch64.c b/bfd/elfnn-aarch64.c
index 302d8dd7e6..5b4c189b59 100644
--- a/bfd/elfnn-aarch64.c
+++ b/bfd/elfnn-aarch64.c
@@ -7139,7 +7139,7 @@ elfNN_aarch64_relocate_section (bfd *output_bfd,
 
 		 Try to catch this situation here and provide a more helpful
 		 error message to the user.  */
-	      if (addend & ((1UL << howto->rightshift) - 1)
+	      if (addend & (((bfd_vma) 1 << howto->rightshift) - 1)
 		  /* FIXME: Are we testing all of the appropriate reloc
 		     types here ?  */
 		  && (real_r_type == BFD_RELOC_AARCH64_LD_LO19_PCREL
-- 
Alan Modra
Australia Development Lab, IBM


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-09-02  8:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-02  8:42 ubsan elfnn-aarch64.c:7142 shift exponent 32 is too large 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).