PR26461 UBSAN: elfxx-ia64.c:747 cannot be represented
authorAlan Modra <amodra@gmail.com>
Mon, 31 Aug 2020 00:45:34 +0000 (10:15 +0930)
committerAlan Modra <amodra@gmail.com>
Mon, 31 Aug 2020 10:58:10 +0000 (20:28 +0930)
PR 26461
* elfxx-ia64.c (ia64_elf_install_value): Make expressions unsigned
that might shift values into sign bit.

bfd/ChangeLog
bfd/elfxx-ia64.c

index 04f6f4c77ea8e867c04fc1e75c762cc7602bb05c..85fd9f42d1ac76a75b36d70bbfb43a50b6db5856 100644 (file)
@@ -1,3 +1,9 @@
+2020-08-31  Alan Modra  <amodra@gmail.com>
+
+       PR 26461
+       * elfxx-ia64.c (ia64_elf_install_value): Make expressions unsigned
+       that might shift values into sign bit.
+
 2020-08-31  Alan Modra  <amodra@gmail.com>
 
        PR 26445
index b2e55df2b1fbfdf6e6e4cb2859a840d2c6940cd7..a559008c37d3b81fe17704406616a2bd60b3a2e6 100644 (file)
@@ -685,7 +685,7 @@ ia64_elf_install_value (bfd_byte *hit_addr, bfd_vma v, unsigned int r_type)
         slot 2: bits 23..63 in t1 */
 
       /* First, clear the bits that form the 64 bit constant.  */
-      t0 &= ~(0x3ffffLL << 46);
+      t0 &= ~(0x3ffffULL << 46);
       t1 &= ~(0x7fffffLL
              | ((  (0x07fLL << 13) | (0x1ffLL << 27)
                    | (0x01fLL << 22) | (0x001LL << 21)
@@ -714,7 +714,7 @@ ia64_elf_install_value (bfd_byte *hit_addr, bfd_vma v, unsigned int r_type)
         slot 2: bits 23..63 in t1 */
 
       /* First, clear the bits that form the 64 bit constant.  */
-      t0 &= ~(0x3ffffLL << 46);
+      t0 &= ~(0x3ffffULL << 46);
       t1 &= ~(0x7fffffLL
              | ((1LL << 36 | 0xfffffLL << 13) << 23));
 
@@ -744,7 +744,7 @@ ia64_elf_install_value (bfd_byte *hit_addr, bfd_vma v, unsigned int r_type)
       if (err)
        return bfd_reloc_overflow;
 
-      dword &= ~(0x1ffffffffffLL << shift);
+      dword &= ~(0x1ffffffffffULL << shift);
       dword |= (insn << shift);
       bfd_putl64 (dword, hit_addr);
       break;
This page took 0.029461 seconds and 4 git commands to generate.