Bug 26462

Summary: UBSAN error: bfd/reloc.c:473:15:
Product: binutils Reporter: Martin Liska <mliska>
Component: binutilsAssignee: Not yet assigned to anyone <unassigned>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: 2.34   
Target Milestone: 2.36   
Host: Target:
Build: Last reconfirmed:

Description Martin Liska 2020-08-20 12:29:43 UTC
The following fails when I build binutils with:
configure --build=x86_64-linux --disable-nls --disable-gdb --disable-gdbserver --disable-sim --disable-readline --disable-libdecnumber --enable-obsolete --target=ia64-hpux CFLAGS="-g -O2 -fsanitize=address,undefined -Wno-error" CXXLAGS="-g -O2 -fsanitize=address,undefined -Wno-error" LDFLAGS="-ldl"
Target: ia64-hpux
PASS: objcopy compress debug sections in archive with zlib-gnu
Executing on host: /dev/shm/_1ja1wuz/binutils/objdump -W tmpdir/dw2-1-compressed.o  /dev/null objdump.out (timeout = 300)
/home/mliska/Programming/binutils/bfd/reloc.c:473:15: runtime error: shift exponent 4294967295 is too large for 64-bit type 'long unsigned int'
Comment 1 cvs-commit@gcc.gnu.org 2020-08-27 12:36:23 UTC
The master branch has been updated by Alan Modra <amodra@sourceware.org>:

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

commit cd570d497efca7b71ca999cb80d24bfcea5181ac
Author: Alan Modra <amodra@gmail.com>
Date:   Thu Aug 27 13:25:31 2020 +0930

    PR26462 UBSAN: reloc.c:473 shift exponent 4294967295
    
            PR 26462
            * reloc.c (bfd_check_overflow): Return early if zero bitsize.
Comment 2 Alan Modra 2020-08-27 23:06:16 UTC
Fixed