[PATCH] D101786: [llvm-objdump] Exclude __mh_execute_header symbol during MachO disassembly

Jez Ng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 11 13:50:03 PDT 2021


int3 added inline comments.


================
Comment at: llvm/test/tools/llvm-objdump/MachO/no-text-symbols-disassembly.test:76
+    version:         0
+  - cmd:             LC_UNIXTHREAD
+    cmdsize:         184
----------------
gkm wrote:
> int3 wrote:
> > I believe `LC_UNIXTHREAD` is emitted when linking for older target versions. If you pass a modern macOS version to the ld64 you should get `LC_MAIN` instead. Not that it really matters, but LC_MAIN is generally more compact to encode, especially in yaml -- it doesn't have all those PayloadBytes.
> `LC_UNIXTHREAD` is required for static linking regardless of version, and there is no way to override that. YAML output for a dynamic link is larger.
Ah I see. I went to look at my recent diff that added a yaml test, and it seems like yaml2obj doesn't require either load command: rG9260760235261a5cd150b15a3499f7988da65a02

Not sure if objdump needs it to work, but the guidance I've gotten in the past wrt yaml inputs is to make them as small as possible, even if the resulting binary doesn't execute.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D101786



More information about the llvm-commits mailing list