ubsan elfnn-aarch64.c:7142 shift exponent 32 is too large
authorAlan Modra <amodra@gmail.com>
Wed, 2 Sep 2020 00:33:14 +0000 (10:03 +0930)
committerAlan Modra <amodra@gmail.com>
Wed, 2 Sep 2020 07:00:42 +0000 (16:30 +0930)
* elfnn-aarch64.c (elfNN_aarch64_relocate_section): Correct type
of constant shifted left.

bfd/ChangeLog
bfd/elfnn-aarch64.c

index d45c0e8bee213da10cf3c1997079ce2c04bc3ba0..156bb7abf739c3d66b4ee2eaf09b241e6296d574 100644 (file)
@@ -1,3 +1,8 @@
+2020-09-02  Alan Modra  <amodra@gmail.com>
+
+       * elfnn-aarch64.c (elfNN_aarch64_relocate_section): Correct type
+       of constant shifted left.
+
 2020-09-02  Alan Modra  <amodra@gmail.com>
 
        * elf32-pru.c (pru_elf32_do_ldi32_relocate): Use an unsigned
index 302d8dd7e66a61fa51028302e9de2521a836812f..5b4c189b593c6fe96053571ad8f95bd78b293dae 100644 (file)
@@ -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