Make llvm-objdump handle both arm and thumb disassembly from the same Mach-O

file with -macho, the Mach-O specific object file parser option.

After some discussion I chose to do this implementation contained in the logic
of llvm-objdump’s MachODump.cpp using a second disassembler for thumb when
needed and with updates mostly contained in the MachOObjectFile class.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215931 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Kevin Enderby
2014-08-18 20:21:02 +00:00
parent 0526d167a9
commit f759032ccd
5 changed files with 185 additions and 13 deletions

View File

@@ -137,6 +137,7 @@ public:
StringRef getFileFormatName() const override;
unsigned getArch() const override;
Triple getArch(const char **McpuDefault, Triple *ThumbTriple) const;
relocation_iterator section_rel_begin(unsigned Index) const;
relocation_iterator section_rel_end(unsigned Index) const;
@@ -215,7 +216,12 @@ public:
StringRef &Suffix);
static Triple::ArchType getArch(uint32_t CPUType);
static Triple getArch(uint32_t CPUType, uint32_t CPUSubType);
static Triple getArch(uint32_t CPUType, uint32_t CPUSubType,
const char **McpuDefault = nullptr);
static Triple getThumbArch(uint32_t CPUType, uint32_t CPUSubType,
const char **McpuDefault = nullptr);
static Triple getArch(uint32_t CPUType, uint32_t CPUSubType,
const char **McpuDefault, Triple *ThumbTriple);
static bool isValidArch(StringRef ArchFlag);
static Triple getHostArch();