[PATCH] D78032: [llvm-objdump] Default to the "apple-latest" mcpu when disassembling arm64 Mach-O binaries

Michael Trent via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 14 16:52:40 PDT 2020


mtrent added a comment.
Herald added a subscriber: danielkiss.

In D78032#1978566 <https://reviews.llvm.org/D78032#1978566>, @MaskRay wrote:

> In D78032#1978339 <https://reviews.llvm.org/D78032#1978339>, @mtrent wrote:
>
> > In D78032#1978249 <https://reviews.llvm.org/D78032#1978249>, @MaskRay wrote:
> >
> > > Can you clarify whether the intention is:
> > >
> > > - For MachOObjectFile::getArchTriple <https://github.com/llvm/llvm-project/blob/master/llvm/lib/Object/MachOObjectFile.cpp#L2598>, we want to use a conservative arch flag, because it may be used by both producers and consumers. We don't want to impose an arch feature restriction for binaries created by the producers.
> > > - For llvm-objdump and may be llvm-nm/llvm-size, the read-only consumers, we want to use the latest arch flag so that all features can be decoded correctly.
> >
> >
> > I don't understand the question?
>
>
> Is it possible to make the (defaulting mcpu to "apple-latest") decision in a library, instead of in llvm-objdump and other individual tools?


Anything is possible, it's only software.

The request from Ahmed and others who work on the library code team was to do this in the tools. I think if they thought making this change that the library level was the right thing do to they would have done it themselves when they added "apple-latest" to llvm.org.

I can also make the change upstream from here, doing it in Apple's cctools otool interface. But people who use llvm-objdump to disassemble MachO binaries directly will find this useful, given that that the triple doesn't always infer the Mcpu option.

Ahmed, do you have anything to add here?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D78032/new/

https://reviews.llvm.org/D78032





More information about the llvm-commits mailing list