aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/Object/MachO.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/Object/MachO.h')
-rw-r--r--include/llvm/Object/MachO.h96
1 files changed, 48 insertions, 48 deletions
diff --git a/include/llvm/Object/MachO.h b/include/llvm/Object/MachO.h
index 50435d6..100613a 100644
--- a/include/llvm/Object/MachO.h
+++ b/include/llvm/Object/MachO.h
@@ -18,10 +18,8 @@
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Triple.h"
-#include "llvm/Object/MachOFormat.h"
#include "llvm/Object/ObjectFile.h"
#include "llvm/Support/MachO.h"
-#include "llvm/Support/raw_ostream.h"
namespace llvm {
namespace object {
@@ -55,7 +53,7 @@ class MachOObjectFile : public ObjectFile {
public:
struct LoadCommandInfo {
const char *Ptr; // Where in memory the load command is.
- macho::LoadCommand C; // The command itself.
+ MachO::load_command C; // The command itself.
};
MachOObjectFile(MemoryBuffer *Object, bool IsLittleEndian, bool Is64Bits,
@@ -69,7 +67,6 @@ public:
virtual error_code getSymbolSize(DataRefImpl Symb, uint64_t &Res) const;
virtual error_code getSymbolType(DataRefImpl Symb,
SymbolRef::Type &Res) const;
- virtual error_code getSymbolNMTypeChar(DataRefImpl Symb, char &Res) const;
virtual error_code getSymbolFlags(DataRefImpl Symb, uint32_t &Res) const;
virtual error_code getSymbolSection(DataRefImpl Symb,
section_iterator &Res) const;
@@ -91,8 +88,8 @@ public:
virtual error_code isSectionReadOnlyData(DataRefImpl Sec, bool &Res) const;
virtual error_code sectionContainsSymbol(DataRefImpl Sec, DataRefImpl Symb,
bool &Result) const;
- virtual relocation_iterator getSectionRelBegin(DataRefImpl Sec) const;
- virtual relocation_iterator getSectionRelEnd(DataRefImpl Sec) const;
+ virtual relocation_iterator section_rel_begin(DataRefImpl Sec) const;
+ virtual relocation_iterator section_rel_end(DataRefImpl Sec) const;
virtual error_code getRelocationNext(DataRefImpl Rel,
RelocationRef &Res) const;
@@ -131,8 +128,8 @@ public:
virtual StringRef getLoadName() const;
- relocation_iterator getSectionRelBegin(unsigned Index) const;
- relocation_iterator getSectionRelEnd(unsigned Index) const;
+ relocation_iterator section_rel_begin(unsigned Index) const;
+ relocation_iterator section_rel_end(unsigned Index) const;
dice_iterator begin_dices() const;
dice_iterator end_dices() const;
@@ -148,50 +145,53 @@ public:
ArrayRef<char> getSectionRawFinalSegmentName(DataRefImpl Sec) const;
// MachO specific Info about relocations.
- bool isRelocationScattered(const macho::RelocationEntry &RE) const;
- unsigned getPlainRelocationSymbolNum(const macho::RelocationEntry &RE) const;
- bool getPlainRelocationExternal(const macho::RelocationEntry &RE) const;
- bool getScatteredRelocationScattered(const macho::RelocationEntry &RE) const;
- uint32_t getScatteredRelocationValue(const macho::RelocationEntry &RE) const;
- unsigned getAnyRelocationAddress(const macho::RelocationEntry &RE) const;
- unsigned getAnyRelocationPCRel(const macho::RelocationEntry &RE) const;
- unsigned getAnyRelocationLength(const macho::RelocationEntry &RE) const;
- unsigned getAnyRelocationType(const macho::RelocationEntry &RE) const;
- SectionRef getRelocationSection(const macho::RelocationEntry &RE) const;
+ bool isRelocationScattered(const MachO::any_relocation_info &RE) const;
+ unsigned getPlainRelocationSymbolNum(
+ const MachO::any_relocation_info &RE) const;
+ bool getPlainRelocationExternal(const MachO::any_relocation_info &RE) const;
+ bool getScatteredRelocationScattered(
+ const MachO::any_relocation_info &RE) const;
+ uint32_t getScatteredRelocationValue(
+ const MachO::any_relocation_info &RE) const;
+ unsigned getAnyRelocationAddress(const MachO::any_relocation_info &RE) const;
+ unsigned getAnyRelocationPCRel(const MachO::any_relocation_info &RE) const;
+ unsigned getAnyRelocationLength(const MachO::any_relocation_info &RE) const;
+ unsigned getAnyRelocationType(const MachO::any_relocation_info &RE) const;
+ SectionRef getRelocationSection(const MachO::any_relocation_info &RE) const;
// Walk load commands.
LoadCommandInfo getFirstLoadCommandInfo() const;
LoadCommandInfo getNextLoadCommandInfo(const LoadCommandInfo &L) const;
// MachO specific structures.
- macho::Section getSection(DataRefImpl DRI) const;
- macho::Section64 getSection64(DataRefImpl DRI) const;
- macho::Section getSection(const LoadCommandInfo &L, unsigned Index) const;
- macho::Section64 getSection64(const LoadCommandInfo &L, unsigned Index) const;
- macho::SymbolTableEntry getSymbolTableEntry(DataRefImpl DRI) const;
- macho::Symbol64TableEntry getSymbol64TableEntry(DataRefImpl DRI) const;
-
- macho::LinkeditDataLoadCommand
+ MachO::section getSection(DataRefImpl DRI) const;
+ MachO::section_64 getSection64(DataRefImpl DRI) const;
+ MachO::section getSection(const LoadCommandInfo &L, unsigned Index) const;
+ MachO::section_64 getSection64(const LoadCommandInfo &L,unsigned Index) const;
+ MachO::nlist getSymbolTableEntry(DataRefImpl DRI) const;
+ MachO::nlist_64 getSymbol64TableEntry(DataRefImpl DRI) const;
+
+ MachO::linkedit_data_command
getLinkeditDataLoadCommand(const LoadCommandInfo &L) const;
- macho::SegmentLoadCommand
+ MachO::segment_command
getSegmentLoadCommand(const LoadCommandInfo &L) const;
- macho::Segment64LoadCommand
+ MachO::segment_command_64
getSegment64LoadCommand(const LoadCommandInfo &L) const;
- macho::LinkerOptionsLoadCommand
+ MachO::linker_options_command
getLinkerOptionsLoadCommand(const LoadCommandInfo &L) const;
- macho::RelocationEntry getRelocation(DataRefImpl Rel) const;
- macho::DataInCodeTableEntry getDice(DataRefImpl Rel) const;
- macho::Header getHeader() const;
- macho::Header64Ext getHeader64Ext() const;
- macho::IndirectSymbolTableEntry
- getIndirectSymbolTableEntry(const macho::DysymtabLoadCommand &DLC,
+ MachO::any_relocation_info getRelocation(DataRefImpl Rel) const;
+ MachO::data_in_code_entry getDice(DataRefImpl Rel) const;
+ MachO::mach_header getHeader() const;
+ MachO::mach_header_64 getHeader64() const;
+ uint32_t
+ getIndirectSymbolTableEntry(const MachO::dysymtab_command &DLC,
unsigned Index) const;
- macho::DataInCodeTableEntry getDataInCodeTableEntry(uint32_t DataOffset,
- unsigned Index) const;
- macho::SymtabLoadCommand getSymtabLoadCommand() const;
- macho::DysymtabLoadCommand getDysymtabLoadCommand() const;
- macho::LinkeditDataLoadCommand getDataInCodeLoadCommand() const;
+ MachO::data_in_code_entry getDataInCodeTableEntry(uint32_t DataOffset,
+ unsigned Index) const;
+ MachO::symtab_command getSymtabLoadCommand() const;
+ MachO::dysymtab_command getDysymtabLoadCommand() const;
+ MachO::linkedit_data_command getDataInCodeLoadCommand() const;
StringRef getStringTableData() const;
bool is64Bit() const;
@@ -225,8 +225,8 @@ inline bool DiceRef::operator<(const DiceRef &Other) const {
inline error_code DiceRef::getNext(DiceRef &Result) const {
DataRefImpl Rel = DicePimpl;
- const macho::DataInCodeTableEntry *P =
- reinterpret_cast<const macho::DataInCodeTableEntry *>(Rel.p);
+ const MachO::data_in_code_entry *P =
+ reinterpret_cast<const MachO::data_in_code_entry *>(Rel.p);
Rel.p = reinterpret_cast<uintptr_t>(P + 1);
Result = DiceRef(Rel, OwningObject);
return object_error::success;
@@ -239,24 +239,24 @@ inline error_code DiceRef::getNext(DiceRef &Result) const {
inline error_code DiceRef::getOffset(uint32_t &Result) const {
const MachOObjectFile *MachOOF =
static_cast<const MachOObjectFile *>(OwningObject);
- macho::DataInCodeTableEntry Dice = MachOOF->getDice(DicePimpl);
- Result = Dice.Offset;
+ MachO::data_in_code_entry Dice = MachOOF->getDice(DicePimpl);
+ Result = Dice.offset;
return object_error::success;
}
inline error_code DiceRef::getLength(uint16_t &Result) const {
const MachOObjectFile *MachOOF =
static_cast<const MachOObjectFile *>(OwningObject);
- macho::DataInCodeTableEntry Dice = MachOOF->getDice(DicePimpl);
- Result = Dice.Length;
+ MachO::data_in_code_entry Dice = MachOOF->getDice(DicePimpl);
+ Result = Dice.length;
return object_error::success;
}
inline error_code DiceRef::getKind(uint16_t &Result) const {
const MachOObjectFile *MachOOF =
static_cast<const MachOObjectFile *>(OwningObject);
- macho::DataInCodeTableEntry Dice = MachOOF->getDice(DicePimpl);
- Result = Dice.Kind;
+ MachO::data_in_code_entry Dice = MachOOF->getDice(DicePimpl);
+ Result = Dice.kind;
return object_error::success;
}