On 7/10/24 11:02, Michael Morrell wrote:
I'm working on a port to a new architecture and was noticing a discrepancy in where the disassembler code lives. There is a
file "target/<arch>/disas.c" for 4 architectures (avr, loongarch, openrisc, and rx), but a file
"disas/<arch>.c" for 14 architectures (if I counted right). It seems the 4 architectures using
"target/<arch>/disas.c" are more recently added so I was wondering if that is now the preferred location. I
couldn't find information on this, but I wasn't sure where to look.
Any advice?
The older disas/arch.c files come from binutils, prior to the GPLv3 license change. These
are generally very old architectures, or not up to date.
The newer target/arch/disas.c are for architectures for which the translator and the
disassembler share generated code via decodetree. If you're implementing a new
architecture from scratch, this is your best choice.
The "best" supported are those with support in system libcapstone. :-)
r~