]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
RISC-V: Don't emit 2-byte NOPs if the C extension is disabled
authorPalmer Dabbelt <palmer@dabbelt.com>
Fri, 6 Oct 2017 19:06:45 +0000 (12:06 -0700)
committerPalmer Dabbelt <palmer@dabbelt.com>
Tue, 24 Oct 2017 01:26:29 +0000 (18:26 -0700)
commit2c3f27ed0d6a91bc0812bb2fc6965fd03a413fee
treeca1d3cfd10a99c0bebe31f943f4ec3ee483f24d2
parentfee0ea1f2d3079f7fc3d48109c2a81cc7b7f241c
RISC-V: Don't emit 2-byte NOPs if the C extension is disabled

Systems without the C extension mandate 4-byte alignment for
instructions, so there is no reason to allow for 2-byte alignment.  This
change avoids emitting lots of unimplemented instructions into object
files on non-C targets, which users keep reporting as a bug.  While this
isn't actually a bug (as none of the offsets in object files are
relevant until RISC-V), it is ugly.

gas/ChangeLog

2017-10-23  Palmer Dabbelt  <palmer@dabbelt.com>

        * config/tc-riscv.c (riscv_frag_align_code): Align code by 4
        bytes on non-RVC systems.
gas/ChangeLog
gas/config/tc-riscv.c