[llvm-readobj] Add support for MachO DataInCodeDataCommand.

Example output:

File: <stdin>
Format: Mach-O arm
Arch: arm
AddressSize: 32bit
DataInCode {
  Data offset: 300
  Data size: 32
  Data Regions [
    DICE {
      Index: 0
      Offset: 0
      Length: 4
      Kind: 1
    }
    DICE {
      Index: 1
      Offset: 4
      Length: 4
      Kind: 4
    }
    DICE {
      Index: 2
      Offset: 8
      Length: 2
      Kind: 3
    }
    DICE {
      Index: 3
      Offset: 10
      Length: 1
      Kind: 2
    }
  ]
}

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

llvm-svn: 245732
This commit is contained in:
Davide Italiano
2015-08-21 20:28:30 +00:00
parent 6ea895b557
commit 07e7acb635
3 changed files with 36 additions and 0 deletions

View File

@@ -181,6 +181,11 @@ namespace opts {
COFFBaseRelocs("coff-basereloc",
cl::desc("Display the PE/COFF .reloc section"));
// -macho-data-in-code
cl::opt<bool>
MachODataInCode("macho-data-in-code",
cl::desc("Display MachO Data in Code command"));
// -stackmap
cl::opt<bool>
PrintStackMap("stackmap",
@@ -312,6 +317,9 @@ static void dumpObject(const ObjectFile *Obj) {
if (opts::COFFBaseRelocs)
Dumper->printCOFFBaseReloc();
}
if (Obj->isMachO())
if (opts::MachODataInCode)
Dumper->printMachODataInCode();
if (opts::PrintStackMap)
Dumper->printStackMap();
}