[llvm-readobj] MachO: Dump segment command.

Example output:

File: <stdin>
Format: Mach-O arm
Arch: arm
AddressSize: 32bit
Segment {
  Cmd: LC_SEGMENT
  Name:
  Size: 260
  vmaddr: 0x0
  vmsize: 0x10
  fileoff: 408
  filesize: 408
  maxprot: rwx
  initprot: rwx
  nsects: 3
  flags: 0x0
}

Differential Revision:	 http://reviews.llvm.org/D12542

llvm-svn: 246665
This commit is contained in:
Davide Italiano
2015-09-02 16:24:24 +00:00
parent af0beb0a5c
commit d1f099682e
3 changed files with 87 additions and 0 deletions

View File

@@ -187,6 +187,11 @@ namespace opts {
MachODataInCode("macho-data-in-code",
cl::desc("Display MachO Data in Code command"));
// -macho-segment
cl::opt<bool>
MachOSegment("macho-segment",
cl::desc("Display MachO Segment command"));
// -macho-version-min
cl::opt<bool>
MachOVersionMin("macho-version-min",
@@ -331,6 +336,8 @@ static void dumpObject(const ObjectFile *Obj) {
if (Obj->isMachO()) {
if (opts::MachODataInCode)
Dumper->printMachODataInCode();
if (opts::MachOSegment)
Dumper->printMachOSegment();
if (opts::MachOVersionMin)
Dumper->printMachOVersionMin();
if (opts::MachODysymtab)