[PATCH 0/3] disassembler syntax highlighting in objdump (via libopcodes)

Andrew Burgess aburgess@redhat.com
Thu Feb 17 16:17:00 GMT 2022


Nelson Chu <nelson.chu@sifive.com> writes:

> Hi Andrew,
>
> I get gas/testsuite/gas/riscv/insn testcase fail after applying the
> series of patches.  Here is the reduced case,
>
> $ cat tmp.s
> .word 0x68c58543
> fmadd.s fa0,fa1,fa2,fa3,rne
> .insn r  MADD, 0, 0, a0, a1, a2, a3
> .insn 0x68c58543
>
> All these are the same instruction encoding - fmadd.s, but the first
> ".word" will be marked and dumped as data rather than instruction.  We
> are used to get the following dump result,
>
> $ /scratch/nelsonc/build-upstream/rv64gc-elf/build-install/bin/riscv64-unknown-elf-objdump
> -d tmp.o
>
> 0000000000000000 <.text>:
>    0:   68c58543                .word   0x68c58543
>    4:   68c58543                fmadd.s fa0,fa1,fa2,fa3,rne
>    8:   68c58543                fmadd.s fa0,fa1,fa2,fa3,rne
>    c:   68c58543                fmadd.s fa0,fa1,fa2,fa3,rne
>
> But now with the patches, I will get segmentation fault when trying to
> dump fmadd.s as instruction,
>
> $ /scratch/nelsonc/build-upstream/rv64gc-elf/build-install/bin/riscv64-unknown-elf-objdump
> -d tmp.o
>
> 0000000000000000 <.text>:
>    0:   68c58543                .word   0x68c58543
> Segmentation fault (core dumped)
>
> Is it possible if you could help to see what happened?  Thanks!

Sorry about that.  I'll get this fixed and post an updated version.

Thanks,
Andrew



More information about the Binutils mailing list