[binutils-gdb] Fix a sanitization problem running the linker testsuite for the AArch64 target.

Nick Clifton nickc@sourceware.org
Wed Aug 26 14:52:11 GMT 2020


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

commit b74a6c6086033907f4ea1dbd61166ee63b6f0a99
Author: Nick Clifton <nickc@redhat.com>
Date:   Wed Aug 26 15:50:36 2020 +0100

    Fix a sanitization problem running the linker testsuite for the AArch64 target.
    
            PR 26411
            * elfnn-aarch64.c (elfNN_aarch64_relocate_section): Use an
            unsigned long constant when creating a mask to test for alignment
            issues.

Diff:
---
 bfd/ChangeLog       | 7 +++++++
 bfd/elfnn-aarch64.c | 2 +-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 988e2f0c649..bae3449fbe8 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,10 @@
+2020-08-26  Nick Clifton  <nickc@redhat.com>
+
+	PR 26411
+	* elfnn-aarch64.c (elfNN_aarch64_relocate_section): Use an
+	unsigned long constant when creating a mask to test for alignment
+	issues.
+
 2020-08-26  Alan Modra  <amodra@gmail.com>
 
 	PR 26507
diff --git a/bfd/elfnn-aarch64.c b/bfd/elfnn-aarch64.c
index 9b0b51b4fb0..302d8dd7e66 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 & ((1 << howto->rightshift) - 1)
+	      if (addend & ((1UL << howto->rightshift) - 1)
 		  /* FIXME: Are we testing all of the appropriate reloc
 		     types here ?  */
 		  && (real_r_type == BFD_RELOC_AARCH64_LD_LO19_PCREL


More information about the Binutils-cvs mailing list