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=alpha-linuxecoff CFLAGS="-g -O2 -fsanitize=address,undefined -Wno-error" CXXLAGS="-g -O2 -fsanitize=address,undefined -Wno-error" LDFLAGS="-ldl" Target: alpha-linuxecoff | exit( YY_EXIT_FAILURE ); Executing on host: sh -c {/dev/shm/z4gjobiy/ld/../gas/as-new -I/home/mliska/Programming/binutils/ld/testsuite/ld-checks -o tmpdir/asm.o /home/mliska/Programming/binutils/ld/testsuite/ld-checks/asm.s 2>&1} /dev/null ld.tmp (timeout = 300) /home/mliska/Programming/binutils/bfd/cache.c:386:12: runtime error: null pointer passed as argument 1, which is declared to never be null
The master branch has been updated by Alan Modra <amodra@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=9863cbb7bd3495107a5b1b4d887c95d859c9a35e commit 9863cbb7bd3495107a5b1b4d887c95d859c9a35e Author: Alan Modra <amodra@gmail.com> Date: Wed Aug 26 14:18:53 2020 +0930 PR26418 UBSAN: cache.c:386 null pointer fwrite PR 26418 * ecofflink.c (WRITE): Don't write size 0 chunks.
Fixed
The master branch has been updated by Alan Modra <amodra@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=7ca371dba5d612ff1cdaa4ffe33474c1993fbe7f commit 7ca371dba5d612ff1cdaa4ffe33474c1993fbe7f Author: Alan Modra <amodra@gmail.com> Date: Fri Aug 28 21:45:49 2020 +0930 PR26418 UBSAN: cache.c:386 null pointer fwrite The previous "fix" tested the wrong value. PR 26418 * ecofflink.c (WRITE): Really don't write zero size chunks.
The master branch has been updated by Alan Modra <amodra@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=07319accdf8eecc5111b343802dadd067f683d26 commit 07319accdf8eecc5111b343802dadd067f683d26 Author: Alan Modra <amodra@gmail.com> Date: Fri Aug 28 23:06:47 2020 +0930 PR26418 UBSAN: cache.c:386 null pointer fwrite And some more. PR 26418 * ecofflink.c (bfd_ecoff_write_accumulated_debug): Don't write zero size buffers.