ghidra icon indicating copy to clipboard operation
ghidra copied to clipboard

Add Hexagon Assembly Language Support

Open aguerriero1998 opened this issue 4 years ago • 3 comments

Describe the solution you'd like A clear and concise description of what you want to happen.

I'd like the hexagon architecture to be added to ghidra. Currently there is no support for this assembly language.

The programmer's reference manual can be found here: https://developer.qualcomm.com/software/hexagon-dsp-sdk/tools

It gives an overview of the hexagon architecture and provides the instruction set encoding.

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Currently this architecture is not supported. There are IDA plugins to support this but I cannot afford to buy IDA and it would be nice to have support in ghidra.

There is a closed issue where someone laid some ground work to add support for this assembly language but it was closed #315. I have implemented a number of ALU operations in SLEIGH and would like additional help in finishing the instruction set.

aguerriero1998 avatar Mar 04 '20 17:03 aguerriero1998

For what it's worth, the source code (along with prebuilts) for the old gcc releases targeting Hexagon appear to be mirrored under https://mirrors.edge.kernel.org/caf_patches/quic/hexagon/4.0/index.html

Edit: It seems like a more recent version can be found under https://mirrors.edge.kernel.org/caf_patches/quic/hexagon/V5/, which has both hexagon and qdsp6 targets.

These contain QDSPv6 instruction definitions under source/gcc/gcc-4.4/gcc/config/qdsp6/ (check out qdsp6.md, builtins.md etc).

Not sure how useful this would be to anyone, but perhaps these can be converted to SLEIGH definitions or used to further aid in adding Hexagon support to Ghidra.

Ristovski avatar Jan 03 '21 18:01 Ristovski

omega bump

huntergregal avatar Sep 21 '21 14:09 huntergregal

PSA: QEMU version 6.0+ has also received Qualcomm Hexagon DSP support: https://github.com/qemu/qemu/blob/v6.0.0/target/hexagon/README, it seems to be based based on https://github.com/revng/qemu-hexagon

Ristovski avatar Dec 16 '21 19:12 Ristovski