This is an archive of the discontinued LLVM Phabricator instance.

llvm-objdump -m -D should disassemble all text segments
ClosedPublic

Authored by mtrent on Jan 13 2019, 11:23 AM.

Details

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

Diff Detail

Repository
rL LLVM

Event Timeline

mtrent created this revision.Jan 13 2019, 11:23 AM
mtrent edited the summary of this revision. (Show Details)Jan 13 2019, 11:24 AM
mtrent updated this revision to Diff 181489.Jan 13 2019, 4:14 PM

Fix whitespace indenting

mtrent updated this revision to Diff 181490.Jan 13 2019, 4:15 PM

Fix whitespace indenting for real this time

lhames accepted this revision.Jan 14 2019, 3:43 PM

LGTM!

This revision is now accepted and ready to land.Jan 14 2019, 3:43 PM
This revision was automatically updated to reflect the committed changes.