<div dir="ltr"><div class="gmail_extra"><div><div class="gmail_signature">On Fri, Sep 16, 2016 at 2:51 PM, Hemant Kulkarni <span dir="ltr"><<a href="mailto:khemant@codeaurora.org" target="_blank">khemant@codeaurora.org</a>></span> wrote:<br></div></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div lang="EN-US"><div><p class="MsoNormal">Hi,<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">The llvm-objdump tool at the moment disassembles ARM ELF binary but with lot of extra user supplied data<u></u><u></u></p><p style="margin-left:38.25pt"><u></u><span style="font-family:symbol"><span>·<span style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:7pt;line-height:normal;font-family:"times new roman"">         </span></span></span><u></u>The triple supplied on the command line for tools has to be be correct (ARM, thumb etc)<u></u><u></u></p><p style="margin-left:38.25pt"><u></u><span style="font-family:symbol"><span>·<span style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:7pt;line-height:normal;font-family:"times new roman"">         </span></span></span><u></u>The ELF file cannot have mix of ARM and thumb<u></u><u></u></p><p style="margin-left:38.25pt"><u></u><span style="font-family:symbol"><span>·<span style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:7pt;line-height:normal;font-family:"times new roman"">         </span></span></span><u></u>There is no direct way of using it such as llvm-objdump –d elf_file. This works for architectures such as Hexagon, X86 etc.<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">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.<u></u><u></u></p><p class="MsoNormal">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. <u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">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. <u></u><u></u></p><p class="MsoNormal">It is at <a href="https://reviews.llvm.org/D24636" target="_blank">https://reviews.llvm.org/<wbr>D24636</a><u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Thanks,<u></u><u></u></p><p class="MsoNormal"><br></p></div></div></blockquote><div><br></div><div>objdump is currently in a pretty bad state. The disassembler was basically ripped from llvm-mc and has been hacked on since without needed refactoring. I feel that at this point we need to stop and restructure it before throwing more complexity onto the pile.</div><div><br></div><div><div class="gmail_signature">- Michael Spencer</div></div><div> </div></div></div></div>