#include "ObjDumper.h"
#include "llvm-readobj.h"
#include "llvm/Demangle/Demangle.h"
#include "llvm/Object/XCOFFObjectFile.h"
#include "llvm/Support/FormattedStream.h"
#include "llvm/Support/ScopedPrinter.h"
#include <ctime>
usingnamespacellvm;
usingnamespaceobject;
namespace {
class XCOFFDumper : public ObjDumper { … };
}
void XCOFFDumper::printFileHeaders() { … }
void XCOFFDumper::printAuxiliaryHeader() { … }
void XCOFFDumper::printSectionHeaders() { … }
void XCOFFDumper::printLoaderSection(bool PrintHeader, bool PrintSymbols,
bool PrintRelocations) { … }
void XCOFFDumper::printLoaderSectionHeader(uintptr_t LoaderSectionAddr) { … }
const EnumEntry<XCOFF::StorageClass> SymStorageClass[] = …;
template <typename LoaderSectionSymbolEntry, typename LoaderSectionHeader>
void XCOFFDumper::printLoaderSectionSymbolsHelper(uintptr_t LoaderSectionAddr) { … }
void XCOFFDumper::printLoaderSectionSymbols(uintptr_t LoaderSectionAddr) { … }
const EnumEntry<XCOFF::RelocationType> RelocationTypeNameclass[] = …;
static const char *getImplicitLoaderSectionSymName(int SymIndx) { … }
template <typename LoadSectionRelocTy>
void XCOFFDumper::printLoaderSectionRelocationEntry(
LoadSectionRelocTy *LoaderSecRelEntPtr, StringRef SymbolName) { … }
template <typename LoaderSectionHeader, typename LoaderSectionSymbolEntry,
typename LoaderSectionRelocationEntry>
void XCOFFDumper::printLoaderSectionRelocationEntriesHelper(
uintptr_t LoaderSectionAddr) { … }
void XCOFFDumper::printLoaderSectionRelocationEntries(
uintptr_t LoaderSectionAddr) { … }
template <typename T>
void XCOFFDumper::printExceptionSectionEntry(const T &ExceptionSectEnt) const { … }
template <typename T> void XCOFFDumper::printExceptionSectionEntries() const { … }
void XCOFFDumper::printExceptionSection() { … }
void XCOFFDumper::printRelocations() { … }
template <typename RelTy> void XCOFFDumper::printRelocation(RelTy Reloc) { … }
template <typename Shdr, typename RelTy>
void XCOFFDumper::printRelocations(ArrayRef<Shdr> Sections) { … }
const EnumEntry<XCOFF::CFileStringType> FileStringType[] = …;
const EnumEntry<XCOFF::SymbolAuxType> SymAuxType[] = …;
void XCOFFDumper::printFileAuxEnt(const XCOFFFileAuxEnt *AuxEntPtr) { … }
static const EnumEntry<XCOFF::StorageMappingClass> CsectStorageMappingClass[] = …;
const EnumEntry<XCOFF::SymbolType> CsectSymbolTypeClass[] = …;
void XCOFFDumper::printCsectAuxEnt(XCOFFCsectAuxRef AuxEntRef) { … }
void XCOFFDumper::printSectAuxEntForStat(
const XCOFFSectAuxEntForStat *AuxEntPtr) { … }
void XCOFFDumper::printExceptionAuxEnt(const XCOFFExceptionAuxEnt *AuxEntPtr) { … }
void XCOFFDumper::printFunctionAuxEnt(const XCOFFFunctionAuxEnt32 *AuxEntPtr) { … }
void XCOFFDumper::printFunctionAuxEnt(const XCOFFFunctionAuxEnt64 *AuxEntPtr) { … }
void XCOFFDumper::printBlockAuxEnt(const XCOFFBlockAuxEnt32 *AuxEntPtr) { … }
void XCOFFDumper::printBlockAuxEnt(const XCOFFBlockAuxEnt64 *AuxEntPtr) { … }
template <typename T>
void XCOFFDumper::printSectAuxEntForDWARF(const T *AuxEntPtr) { … }
static StringRef GetSymbolValueName(XCOFF::StorageClass SC) { … }
const EnumEntry<XCOFF::CFileLangId> CFileLangIdClass[] = …;
const EnumEntry<XCOFF::CFileCpuId> CFileCpuIdClass[] = …;
template <typename T> const T *XCOFFDumper::getAuxEntPtr(uintptr_t AuxAddress) { … }
static void printUnexpectedRawAuxEnt(ScopedPrinter &W, uintptr_t AuxAddress) { … }
void XCOFFDumper::printSymbol(const SymbolRef &S) { … }
void XCOFFDumper::printSymbols(bool ) { … }
void XCOFFDumper::printStringTable() { … }
void XCOFFDumper::printDynamicSymbols() { … }
void XCOFFDumper::printUnwindInfo() { … }
void XCOFFDumper::printStackMap() const { … }
void XCOFFDumper::printNeededLibraries() { … }
const EnumEntry<XCOFF::SectionTypeFlags> SectionTypeFlagsNames[] = …;
const EnumEntry<XCOFF::DwarfSectionSubtypeFlags>
DWARFSectionSubtypeFlagsNames[] = …;
template <typename T>
void XCOFFDumper::printOverflowSectionHeader(T &Sec) const { … }
template <typename T>
void XCOFFDumper::printGenericSectionHeader(T &Sec) const { … }
enum PrintStyle { … };
template <typename T, typename V>
static void printAuxMemberHelper(PrintStyle Style, const char *MemberName,
const T &Member, const V *AuxHeader,
uint16_t AuxSize, uint16_t &PartialFieldOffset,
const char *&PartialFieldName,
ScopedPrinter &W) { … }
template <class T>
void checkAndPrintAuxHeaderParseError(const char *PartialFieldName,
uint16_t PartialFieldOffset,
uint16_t AuxSize, T &AuxHeader,
XCOFFDumper *Dumper) { … }
void XCOFFDumper::printAuxiliaryHeader(
const XCOFFAuxiliaryHeader32 *AuxHeader) { … }
void XCOFFDumper::printAuxiliaryHeader(
const XCOFFAuxiliaryHeader64 *AuxHeader) { … }
template <typename T>
void XCOFFDumper::printSectionHeaders(ArrayRef<T> Sections) { … }
namespace llvm {
std::unique_ptr<ObjDumper>
createXCOFFDumper(const object::XCOFFObjectFile &XObj, ScopedPrinter &Writer) { … }
}