Bug 26461 - UBSAN error: bfd/elfxx-ia64.c:747:34:
Summary: UBSAN error: bfd/elfxx-ia64.c:747:34:
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: binutils (show other bugs)
Version: 2.34
: P2 normal
Target Milestone: 2.36
Assignee: Alan Modra
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-08-20 12:29 UTC by Martin Liska
Modified: 2020-08-31 11:02 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Last reconfirmed: 2020-08-31 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Liska 2020-08-20 12:29:07 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-elf CFLAGS="-g -O2 -fsanitize=address,undefined -Wno-error" CXXLAGS="-g -O2 -fsanitize=address,undefined -Wno-error" LDFLAGS="-ldl"
Target: ia64-elf
FAIL: ld-ia64/error2
Executing on host: sh -c {./ld-new   -L/home/mliska/Programming/binutils/ld/testsuite/ld-ia64  -pie -shared -o tmpdir/dump tmpdir/error1.o  2>&1}  /dev/null dump.tmp (timeout = 300)
/home/mliska/Programming/binutils/bfd/elfxx-ia64.c:747:34: runtime error: left shift of 2199023255551 by 23 places cannot be represented in type 'long long int'
Comment 1 Sourceware Commits 2020-08-31 10:59:27 UTC
The master branch has been updated by Alan Modra <amodra@sourceware.org>:

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

commit 108f6f97bd862e969f898c1347903ae1cf38ead4
Author: Alan Modra <amodra@gmail.com>
Date:   Mon Aug 31 10:15:34 2020 +0930

    PR26461 UBSAN: elfxx-ia64.c:747 cannot be represented
    
            PR 26461
            * elfxx-ia64.c (ia64_elf_install_value): Make expressions unsigned
            that might shift values into sign bit.
Comment 2 Alan Modra 2020-08-31 11:02:14 UTC
Fixed