#include "llvm/BinaryFormat/MachO.h"
#include "llvm/ObjectYAML/DWARFEmitter.h"
#include "llvm/ObjectYAML/ObjectYAML.h"
#include "llvm/ObjectYAML/yaml2obj.h"
#include "llvm/Support/Errc.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/FormatVariadic.h"
#include "llvm/Support/LEB128.h"
#include "llvm/Support/SystemZ/zOSSupport.h"
#include "llvm/Support/YAMLTraits.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Support/Format.h"
usingnamespacellvm;
namespace {
class MachOWriter { … };
Error MachOWriter::writeMachO(raw_ostream &OS) { … }
void MachOWriter::writeHeader(raw_ostream &OS) { … }
template <typename SectionType>
SectionType constructSection(const MachOYAML::Section &Sec) { … }
template <typename StructType>
size_t writeLoadCommandData(MachOYAML::LoadCommand &LC, raw_ostream &OS,
bool IsLittleEndian) { … }
template <>
size_t writeLoadCommandData<MachO::segment_command>(MachOYAML::LoadCommand &LC,
raw_ostream &OS,
bool IsLittleEndian) { … }
template <>
size_t writeLoadCommandData<MachO::segment_command_64>(
MachOYAML::LoadCommand &LC, raw_ostream &OS, bool IsLittleEndian) { … }
size_t writePayloadString(MachOYAML::LoadCommand &LC, raw_ostream &OS) { … }
template <>
size_t writeLoadCommandData<MachO::dylib_command>(MachOYAML::LoadCommand &LC,
raw_ostream &OS,
bool IsLittleEndian) { … }
template <>
size_t writeLoadCommandData<MachO::dylinker_command>(MachOYAML::LoadCommand &LC,
raw_ostream &OS,
bool IsLittleEndian) { … }
template <>
size_t writeLoadCommandData<MachO::rpath_command>(MachOYAML::LoadCommand &LC,
raw_ostream &OS,
bool IsLittleEndian) { … }
template <>
size_t writeLoadCommandData<MachO::sub_framework_command>(
MachOYAML::LoadCommand &LC, raw_ostream &OS, bool IsLittleEndian) { … }
template <>
size_t writeLoadCommandData<MachO::sub_umbrella_command>(
MachOYAML::LoadCommand &LC, raw_ostream &OS, bool IsLittleEndian) { … }
template <>
size_t writeLoadCommandData<MachO::sub_client_command>(
MachOYAML::LoadCommand &LC, raw_ostream &OS, bool IsLittleEndian) { … }
template <>
size_t writeLoadCommandData<MachO::sub_library_command>(
MachOYAML::LoadCommand &LC, raw_ostream &OS, bool IsLittleEndian) { … }
template <>
size_t writeLoadCommandData<MachO::build_version_command>(
MachOYAML::LoadCommand &LC, raw_ostream &OS, bool IsLittleEndian) { … }
void ZeroFillBytes(raw_ostream &OS, size_t Size) { … }
void Fill(raw_ostream &OS, size_t Size, uint32_t Data) { … }
void MachOWriter::ZeroToOffset(raw_ostream &OS, size_t Offset) { … }
void MachOWriter::writeLoadCommands(raw_ostream &OS) { … }
Error MachOWriter::writeSectionData(raw_ostream &OS) { … }
static MachO::any_relocation_info
makeRelocationInfo(const MachOYAML::Relocation &R, bool IsLE) { … }
static MachO::any_relocation_info
makeScatteredRelocationInfo(const MachOYAML::Relocation &R) { … }
void MachOWriter::writeRelocations(raw_ostream &OS) { … }
void MachOWriter::writeBindOpcodes(
raw_ostream &OS, std::vector<MachOYAML::BindOpcode> &BindOpcodes) { … }
void MachOWriter::dumpExportEntry(raw_ostream &OS,
MachOYAML::ExportEntry &Entry) { … }
void MachOWriter::writeExportTrie(raw_ostream &OS) { … }
template <typename NListType>
void writeNListEntry(MachOYAML::NListEntry &NLE, raw_ostream &OS,
bool IsLittleEndian) { … }
void MachOWriter::writeLinkEditData(raw_ostream &OS) { … }
void MachOWriter::writeRebaseOpcodes(raw_ostream &OS) { … }
void MachOWriter::writeBasicBindOpcodes(raw_ostream &OS) { … }
void MachOWriter::writeWeakBindOpcodes(raw_ostream &OS) { … }
void MachOWriter::writeLazyBindOpcodes(raw_ostream &OS) { … }
void MachOWriter::writeNameList(raw_ostream &OS) { … }
void MachOWriter::writeStringTable(raw_ostream &OS) { … }
void MachOWriter::writeDynamicSymbolTable(raw_ostream &OS) { … }
void MachOWriter::writeFunctionStarts(raw_ostream &OS) { … }
void MachOWriter::writeDataInCode(raw_ostream &OS) { … }
void MachOWriter::writeChainedFixups(raw_ostream &OS) { … }
void MachOWriter::writeDyldExportsTrie(raw_ostream &OS) { … }
class UniversalWriter { … };
Error UniversalWriter::writeMachO(raw_ostream &OS) { … }
void UniversalWriter::writeFatHeader(raw_ostream &OS) { … }
template <typename FatArchType>
FatArchType constructFatArch(MachOYAML::FatArch &Arch) { … }
template <typename StructType>
void writeFatArch(MachOYAML::FatArch &LC, raw_ostream &OS) { … }
template <>
void writeFatArch<MachO::fat_arch>(MachOYAML::FatArch &Arch, raw_ostream &OS) { … }
template <>
void writeFatArch<MachO::fat_arch_64>(MachOYAML::FatArch &Arch,
raw_ostream &OS) { … }
void UniversalWriter::writeFatArchs(raw_ostream &OS) { … }
void UniversalWriter::ZeroToOffset(raw_ostream &OS, size_t Offset) { … }
}
namespace llvm {
namespace yaml {
bool yaml2macho(YamlObjectFile &Doc, raw_ostream &Out, ErrorHandler EH) { … }
}
}