llvm.org GIT mirror llvm / e9414c2
llvm-objdump -m -D should disassemble all text segments Summary: 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. rdar://42899338 Reviewers: ab, pete, lhames Reviewed By: lhames Subscribers: rupprecht, llvm-commits Differential Revision: https://reviews.llvm.org/D56649 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@351238 91177308-0d34-0410-b5e6-96231b3b80d8 Michael Trent 7 months ago
4 changed file(s) with 77 addition(s) and 19 deletion(s). Raw diff Collapse all Expand all
1515
1616 COMMANDS
1717 --------
18 At least one of the following commands are required, and some commands can be combined with other commands:
18 At least one of the following commands are required, and some commands can be
19 combined with other commands:
1920
20 .. option:: -disassemble
21 .. option:: -d, -disassemble
2122
22 Display assembler mnemonics for the machine instructions
23
23 Display assembler mnemonics for the machine instructions. Disassembles all
24 text sections found in the input file(s).
25
26 .. option:: -D, -disassemble-all
27
28 Display assembler mnemonics for the machine instructions. Disassembles all
29 sections found in the input file(s).
30
2431 .. option:: -help
2532
2633 Display usage information and exit. Does not stack with other commands.
4451 .. option:: -version
4552
4653 Display the version of this program. Does not stack with other commands.
47
54
4855 OPTIONS
4956 -------
5057 :program:`llvm-objdump` supports the following options:
5158
5259 .. option:: -arch=
5360
54 Specify the architecture to disassemble. see -version for available
61 Specify the architecture to disassemble. see ``-version`` for available
5562 architectures.
5663
5764 .. option:: -cfg
6774
6875 Print line information from debug info if available.
6976
70 .. option:: -macho
77 .. option:: -m, -macho
7178
72 Use Mach-O specific object file parser.
79 Use Mach-O specific object file parser. Commands and other options may behave
80 differently when used with ``-macho``.
7381
7482 .. option:: -mattr=
7583
7684 Target specific attributes.
77
85
7886 .. option:: -mc-x86-disable-arith-relaxation
7987
8088 Disable relaxation of arithmetic instruction for X86.
8290 .. option:: -stats
8391
8492 Enable statistics output from program.
85
93
8694 .. option:: -triple=
8795
88 Target triple to disassemble for, see -version for available targets.
89
96 Target triple to disassemble for, see ``-version`` for available targets.
97
9098 .. option:: -x86-asm-syntax=