Hi,
The llvm-objdump tool at the moment disassembles ARM ELF binary but with lot of extra user supplied data
· The triple supplied on the command line for tools has to be be correct (ARM, thumb etc)
· The ELF file cannot have mix of ARM and thumb
· There is no direct way of using it such as llvm-objdump –d elf_file. This works for architectures such as Hexagon, X86 etc.
Is there a way to enhance the tool to make the use more friendly by removing the need to specify these extra option on command line since it is possible to find the information in the file.
The ELF file for arm does not have any field that can be easily inspected to see if the file of type ET_ARM is either a thumb only binary, ARM only binary or a mix. There is however an optional ARM specific section .ARM.attributes that can contain CPU and architecture information such as ISA in use. BFD and gold linker use this section while linking to find any incompatibilities and then emit out a merged (as per ARM ABI extensions) section in final binary.
Any ideas to add this functionality to the without completely redesigning the llvm-objdump will be appreciated. There is already a patch that uses data from ELF file to try doing this.
It is at https://reviews.llvm.org/D24636
Thanks,