]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
PR26462 UBSAN: reloc.c:473 shift exponent 4294967295
authorAlan Modra <amodra@gmail.com>
Thu, 27 Aug 2020 03:55:31 +0000 (13:25 +0930)
committerAlan Modra <amodra@gmail.com>
Thu, 27 Aug 2020 12:26:33 +0000 (21:56 +0930)
PR 26462
* reloc.c (bfd_check_overflow): Return early if zero bitsize.

bfd/ChangeLog
bfd/reloc.c

index 18ded261a575a99dabade2c92907eaad49ef4cf6..6d3ba691da9116808d6b509c589252a7b3f5f46b 100644 (file)
@@ -1,3 +1,8 @@
+2020-08-27  Alan Modra  <amodra@gmail.com>
+
+       PR 26462
+       * reloc.c (bfd_check_overflow): Return early if zero bitsize.
+
 2020-08-27  Alan Modra  <amodra@gmail.com>
 
        * elf32-arm.c (elf32_arm_final_link_relocate): Don't segfault
index 9aba84ca81e829b3386942bbae8c04b5b7daa544..7d3479acef4ad1c187ebdd4e7b3b62351286f2f6 100644 (file)
@@ -466,6 +466,9 @@ bfd_check_overflow (enum complain_overflow how,
   bfd_vma fieldmask, addrmask, signmask, ss, a;
   bfd_reloc_status_type flag = bfd_reloc_ok;
 
+  if (bitsize == 0)
+    return flag;
+
   /* Note: BITSIZE should always be <= ADDRSIZE, but in case it's not,
      we'll be permissive: extra bits in the field mask will
      automatically extend the address mask for purposes of the