[PATCH] D56649: llvm-objdump -m -D should disassemble all text segments

Michael Trent via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 13 11:23:36 PST 2019


mtrent created this revision.
mtrent added reviewers: ab, pete, lhames.
Herald added a subscriber: rupprecht.

When running llvm-objdump with the -macho option objdump will by default
disassemble only the __TEXT,__text section (or __TEXT_EXEC,__text when
disassembling MH_KEXT_BUNDLE files). The -disassemble-all option is
treated no diferently than -disassemble.

This change upates llvm-objdump's MachO parsing code to disassemble all
__text sections found in a file when -disassemble-all is specified. This
is useful for disassembling files with more than one __text section, or
when disassembling files whose __text section is not present in __TEXT.

I added a lit test case that verifies "llvm-objdump -m -d" and 
"llvm-objdump -m -D" produce the expected results on a reference binary. 
I also updated the CommandGuide documentation for llvm-objdump.rst and
verified it renders correctly as man and html.


Repository:
  rL LLVM

https://reviews.llvm.org/D56649

Files:
  docs/CommandGuide/llvm-objdump.rst
  test/tools/llvm-objdump/X86/Inputs/macho-multiple-text
  test/tools/llvm-objdump/X86/macho-disassemble-all.test
  tools/llvm-objdump/MachODump.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D56649.181479.patch
Type: text/x-patch
Size: 5508 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190113/1c4be6bf/attachment.bin>


More information about the llvm-commits mailing list