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=cr16-elf CFLAGS="-g -O2 -fsanitize=address,undefined -Wno-error" CXXLAGS="-g -O2 -fsanitize=address,undefined -Wno-error" LDFLAGS="-ldl" Target: cr16-elf PASS: gas/macros/paren Executing on host: sh -c {../as-new /home/mliska/Programming/binutils/gas/testsuite/gas/macros/exit.s 2>gas.stderr} /dev/null (timeout = 300) ==42113==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7fffffffbbe5 at pc 0x0000004ccea0 bp 0x7fffffffbb80 sp 0x7fffffffbb78 #0 0x4cce9f in get_b_cc /home/mliska/Programming/binutils/gas/config/tc-cr16.c:1533 #1 0x4dbe40 in is_bcc_insn /home/mliska/Programming/binutils/gas/config/tc-cr16.c:1548 #2 0x4dbe40 in md_assemble /home/mliska/Programming/binutils/gas/config/tc-cr16.c:2548 #3 0x488f87 in read_a_source_file /home/mliska/Programming/binutils/gas/read.c:1182 #4 0x41444f in perform_an_assembly_pass /home/mliska/Programming/binutils/gas/as.c:1253 #5 0x41444f in main /home/mliska/Programming/binutils/gas/as.c:1417 #6 0x7ffff6adacc9 in __libc_start_main (/lib64/libc.so.6+0x26cc9) #7 0x4167f9 in _start (/dev/shm/y8krvqy2/gas/as-new+0x4167f9)
The master branch has been updated by Alan Modra <amodra@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=d3e0baddb206bc7c5ad5beb0c4ac3db8a5feb889 commit d3e0baddb206bc7c5ad5beb0c4ac3db8a5feb889 Author: Alan Modra <amodra@gmail.com> Date: Tue Aug 25 15:34:10 2020 +0930 PR26441, ASAN: get_b_cc tc-cr16.c:1521 PR 26441 * config/tc-cr16.c (get_b_cc): Return NULL early if op isn't two or three chars, and don't bother copying.
Fixed.
*** Bug 26439 has been marked as a duplicate of this bug. ***
*** Bug 26440 has been marked as a duplicate of this bug. ***