#include "ARMEHABIPrinter.h"
#include "DwarfCFIEHPrinter.h"
#include "ObjDumper.h"
#include "StackMapPrinter.h"
#include "llvm-readobj.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/BitVector.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/DenseSet.h"
#include "llvm/ADT/MapVector.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/Twine.h"
#include "llvm/BinaryFormat/AMDGPUMetadataVerifier.h"
#include "llvm/BinaryFormat/ELF.h"
#include "llvm/BinaryFormat/MsgPackDocument.h"
#include "llvm/Demangle/Demangle.h"
#include "llvm/Object/Archive.h"
#include "llvm/Object/ELF.h"
#include "llvm/Object/ELFObjectFile.h"
#include "llvm/Object/ELFTypes.h"
#include "llvm/Object/Error.h"
#include "llvm/Object/ObjectFile.h"
#include "llvm/Object/RelocationResolver.h"
#include "llvm/Object/StackMapParser.h"
#include "llvm/Support/AMDGPUMetadata.h"
#include "llvm/Support/ARMAttributeParser.h"
#include "llvm/Support/ARMBuildAttributes.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/Endian.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/Format.h"
#include "llvm/Support/FormatVariadic.h"
#include "llvm/Support/FormattedStream.h"
#include "llvm/Support/HexagonAttributeParser.h"
#include "llvm/Support/LEB128.h"
#include "llvm/Support/MSP430AttributeParser.h"
#include "llvm/Support/MSP430Attributes.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/MipsABIFlags.h"
#include "llvm/Support/RISCVAttributeParser.h"
#include "llvm/Support/RISCVAttributes.h"
#include "llvm/Support/ScopedPrinter.h"
#include "llvm/Support/SystemZ/zOSSupport.h"
#include "llvm/Support/raw_ostream.h"
#include <algorithm>
#include <array>
#include <cinttypes>
#include <cstddef>
#include <cstdint>
#include <cstdlib>
#include <iterator>
#include <memory>
#include <optional>
#include <string>
#include <system_error>
#include <vector>
usingnamespacellvm;
usingnamespacellvm::object;
usingnamespacellvm::support;
usingnamespaceELF;
#define LLVM_READOBJ_ENUM_CASE(ns, enum) …
#define ENUM_ENT(enum, altName) …
#define ENUM_ENT_1(enum) …
namespace {
template <class ELFT> struct RelSymbol { … };
struct DynRegionInfo { … };
struct GroupMember { … };
struct GroupSection { … };
namespace {
struct NoteType { … };
}
template <class ELFT> class Relocation { … };
template <class ELFT> class MipsGOTParser;
template <typename ELFT> class ELFDumper : public ObjDumper { … };
template <class ELFT>
std::string ELFDumper<ELFT>::describe(const Elf_Shdr &Sec) const { … }
namespace {
template <class ELFT> struct SymtabLink { … };
template <class ELFT>
Expected<SymtabLink<ELFT>> getLinkAsSymtab(const ELFFile<ELFT> &Obj,
const typename ELFT::Shdr &Sec,
unsigned ExpectedType) { … }
}
template <class ELFT>
Expected<ArrayRef<typename ELFT::Versym>>
ELFDumper<ELFT>::getVersionTable(const Elf_Shdr &Sec, ArrayRef<Elf_Sym> *SymTab,
StringRef *StrTab,
const Elf_Shdr **SymTabSec) const { … }
template <class ELFT>
std::pair<typename ELFDumper<ELFT>::Elf_Sym_Range, std::optional<StringRef>>
ELFDumper<ELFT>::getSymtabAndStrtab() const { … }
template <class ELFT>
void ELFDumper<ELFT>::printSymbolsHelper(bool IsDynamic,
bool ExtraSymInfo) const { … }
template <typename ELFT> class GNUELFDumper : public ELFDumper<ELFT> { … };
template <typename ELFT> class LLVMELFDumper : public ELFDumper<ELFT> { … };
template <typename ELFT> class JSONELFDumper : public LLVMELFDumper<ELFT> { … };
}
namespace llvm {
template <class ELFT>
static std::unique_ptr<ObjDumper>
createELFDumper(const ELFObjectFile<ELFT> &Obj, ScopedPrinter &Writer) { … }
std::unique_ptr<ObjDumper> createELFDumper(const object::ELFObjectFileBase &Obj,
ScopedPrinter &Writer) { … }
}
template <class ELFT>
Expected<SmallVector<std::optional<VersionEntry>, 0> *>
ELFDumper<ELFT>::getVersionMap() const { … }
template <typename ELFT>
Expected<StringRef> ELFDumper<ELFT>::getSymbolVersion(const Elf_Sym &Sym,
bool &IsDefault) const { … }
template <typename ELFT>
Expected<RelSymbol<ELFT>>
ELFDumper<ELFT>::getRelocationTarget(const Relocation<ELFT> &R,
const Elf_Shdr *SymTab) const { … }
template <typename ELFT>
ArrayRef<typename ELFT::Word>
ELFDumper<ELFT>::getShndxTable(const Elf_Shdr *Symtab) const { … }
static std::string maybeDemangle(StringRef Name) { … }
template <typename ELFT>
std::string ELFDumper<ELFT>::getStaticSymbolName(uint32_t Index) const { … }
template <typename ELFT>
std::string ELFDumper<ELFT>::getFullSymbolName(
const Elf_Sym &Symbol, unsigned SymIndex, DataRegion<Elf_Word> ShndxTable,
std::optional<StringRef> StrTable, bool IsDynamic) const { … }
template <typename ELFT>
Expected<unsigned>
ELFDumper<ELFT>::getSymbolSectionIndex(const Elf_Sym &Symbol, unsigned SymIndex,
DataRegion<Elf_Word> ShndxTable) const { … }
template <typename ELFT>
Expected<StringRef>
ELFDumper<ELFT>::getSymbolSectionName(const Elf_Sym &Symbol,
unsigned SectionIndex) const { … }
template <class ELFO>
static const typename ELFO::Elf_Shdr *
findNotEmptySectionByAddress(const ELFO &Obj, StringRef FileName,
uint64_t Addr) { … }
const EnumEntry<unsigned> ElfClass[] = …;
const EnumEntry<unsigned> ElfDataEncoding[] = …;
const EnumEntry<unsigned> ElfObjectFileType[] = …;
const EnumEntry<unsigned> ElfOSABI[] = …;
const EnumEntry<unsigned> AMDGPUElfOSABI[] = …;
const EnumEntry<unsigned> ARMElfOSABI[] = …;
const EnumEntry<unsigned> C6000ElfOSABI[] = …;
const EnumEntry<unsigned> ElfMachineType[] = …;
const EnumEntry<unsigned> ElfSymbolBindings[] = …;
const EnumEntry<unsigned> ElfSymbolVisibilities[] = …;
const EnumEntry<unsigned> AMDGPUSymbolTypes[] = …;
static const char *getGroupType(uint32_t Flag) { … }
const EnumEntry<unsigned> ElfSectionFlags[] = …;
const EnumEntry<unsigned> ElfGNUSectionFlags[] = …;
const EnumEntry<unsigned> ElfSolarisSectionFlags[] = …;
const EnumEntry<unsigned> ElfXCoreSectionFlags[] = …;
const EnumEntry<unsigned> ElfARMSectionFlags[] = …;
const EnumEntry<unsigned> ElfHexagonSectionFlags[] = …;
const EnumEntry<unsigned> ElfMipsSectionFlags[] = …;
const EnumEntry<unsigned> ElfX86_64SectionFlags[] = …;
static std::vector<EnumEntry<unsigned>>
getSectionFlagsForTarget(unsigned EOSAbi, unsigned EMachine) { … }
static std::string getGNUFlags(unsigned EOSAbi, unsigned EMachine,
uint64_t Flags) { … }
static StringRef segmentTypeToString(unsigned Arch, unsigned Type) { … }
static std::string getGNUPtType(unsigned Arch, unsigned Type) { … }
const EnumEntry<unsigned> ElfSegmentFlags[] = …;
const EnumEntry<unsigned> ElfHeaderMipsFlags[] = …;
#define AMDGPU_MACH_ENUM_ENTS …
const EnumEntry<unsigned> ElfHeaderAMDGPUFlagsABIVersion3[] = …;
const EnumEntry<unsigned> ElfHeaderAMDGPUFlagsABIVersion4[] = …;
const EnumEntry<unsigned> ElfHeaderNVPTXFlags[] = …;
const EnumEntry<unsigned> ElfHeaderRISCVFlags[] = …;
const EnumEntry<unsigned> ElfHeaderSPARCFlags[] = …;
const EnumEntry<unsigned> ElfHeaderAVRFlags[] = …;
const EnumEntry<unsigned> ElfHeaderLoongArchFlags[] = …;
static const EnumEntry<unsigned> ElfHeaderXtensaFlags[] = …;
const EnumEntry<unsigned> ElfSymOtherFlags[] = …;
const EnumEntry<unsigned> ElfMipsSymOtherFlags[] = …;
const EnumEntry<unsigned> ElfAArch64SymOtherFlags[] = …;
const EnumEntry<unsigned> ElfMips16SymOtherFlags[] = …;
const EnumEntry<unsigned> ElfRISCVSymOtherFlags[] = …;
static const char *getElfMipsOptionsOdkType(unsigned Odk) { … }
template <typename ELFT>
std::pair<const typename ELFT::Phdr *, const typename ELFT::Shdr *>
ELFDumper<ELFT>::findDynamic() { … }
template <typename ELFT>
void ELFDumper<ELFT>::loadDynamicTable() { … }
template <typename ELFT>
ELFDumper<ELFT>::ELFDumper(const object::ELFObjectFile<ELFT> &O,
ScopedPrinter &Writer)
: … { … }
template <typename ELFT> void ELFDumper<ELFT>::parseDynamicTable() { … }
template <typename ELFT> void ELFDumper<ELFT>::printVersionInfo() { … }
#define LLVM_READOBJ_DT_FLAG_ENT …
const EnumEntry<unsigned> ElfDynamicDTFlags[] = …;
const EnumEntry<unsigned> ElfDynamicDTFlags1[] = …;
const EnumEntry<unsigned> ElfDynamicDTMipsFlags[] = …;
#undef LLVM_READOBJ_DT_FLAG_ENT
template <typename T, typename TFlag>
void printFlags(T Value, ArrayRef<EnumEntry<TFlag>> Flags, raw_ostream &OS) { … }
template <class ELFT>
const typename ELFT::Shdr *
ELFDumper<ELFT>::findSectionByName(StringRef Name) const { … }
template <class ELFT>
std::string ELFDumper<ELFT>::getDynamicEntry(uint64_t Type,
uint64_t Value) const { … }
template <class ELFT>
StringRef ELFDumper<ELFT>::getDynamicString(uint64_t Value) const { … }
template <class ELFT> void ELFDumper<ELFT>::printUnwindInfo() { … }
namespace {
template <> void ELFDumper<ELF32LE>::printUnwindInfo() { … }
}
template <class ELFT> void ELFDumper<ELFT>::printNeededLibraries() { … }
template <class ELFT>
static Error checkHashTable(const ELFDumper<ELFT> &Dumper,
const typename ELFT::Hash *H,
bool *IsHeaderValid = nullptr) { … }
template <class ELFT>
static Error checkGNUHashTable(const ELFFile<ELFT> &Obj,
const typename ELFT::GnuHash *GnuHashTable,
bool *IsHeaderValid = nullptr) { … }
template <typename ELFT> void ELFDumper<ELFT>::printHashTable() { … }
template <class ELFT>
static Expected<ArrayRef<typename ELFT::Word>>
getGnuHashTableChains(std::optional<DynRegionInfo> DynSymRegion,
const typename ELFT::GnuHash *GnuHashTable) { … }
template <typename ELFT>
void ELFDumper<ELFT>::printGnuHashTable() { … }
template <typename ELFT> void ELFDumper<ELFT>::printHashHistograms() { … }
template <typename ELFT>
void ELFDumper<ELFT>::printHashHistogram(const Elf_Hash &HashTable) const { … }
template <class ELFT>
void ELFDumper<ELFT>::printGnuHashHistogram(
const Elf_GnuHash &GnuHashTable) const { … }
template <typename ELFT> void ELFDumper<ELFT>::printLoadName() { … }
template <class ELFT> void ELFDumper<ELFT>::printArchSpecificInfo() { … }
template <class ELFT>
void ELFDumper<ELFT>::printAttributes(
unsigned AttrShType, std::unique_ptr<ELFAttributeParser> AttrParser,
llvm::endianness Endianness) { … }
namespace {
template <class ELFT> class MipsGOTParser { … };
}
template <class ELFT>
MipsGOTParser<ELFT>::MipsGOTParser(const ELFDumper<ELFT> &D)
: … { … }
template <class ELFT>
Error MipsGOTParser<ELFT>::findGOT(Elf_Dyn_Range DynTable,
Elf_Sym_Range DynSyms) { … }
template <class ELFT>
Error MipsGOTParser<ELFT>::findPLT(Elf_Dyn_Range DynTable) { … }
template <class ELFT> uint64_t MipsGOTParser<ELFT>::getGp() const { … }
template <class ELFT>
const typename MipsGOTParser<ELFT>::Entry *
MipsGOTParser<ELFT>::getGotLazyResolver() const { … }
template <class ELFT>
const typename MipsGOTParser<ELFT>::Entry *
MipsGOTParser<ELFT>::getGotModulePointer() const { … }
template <class ELFT>
typename MipsGOTParser<ELFT>::Entries
MipsGOTParser<ELFT>::getLocalEntries() const { … }
template <class ELFT>
typename MipsGOTParser<ELFT>::Entries
MipsGOTParser<ELFT>::getGlobalEntries() const { … }
template <class ELFT>
typename MipsGOTParser<ELFT>::Entries
MipsGOTParser<ELFT>::getOtherEntries() const { … }
template <class ELFT>
uint64_t MipsGOTParser<ELFT>::getGotAddress(const Entry *E) const { … }
template <class ELFT>
int64_t MipsGOTParser<ELFT>::getGotOffset(const Entry *E) const { … }
template <class ELFT>
const typename MipsGOTParser<ELFT>::Elf_Sym *
MipsGOTParser<ELFT>::getGotSym(const Entry *E) const { … }
template <class ELFT>
const typename MipsGOTParser<ELFT>::Entry *
MipsGOTParser<ELFT>::getPltLazyResolver() const { … }
template <class ELFT>
const typename MipsGOTParser<ELFT>::Entry *
MipsGOTParser<ELFT>::getPltModulePointer() const { … }
template <class ELFT>
typename MipsGOTParser<ELFT>::Entries
MipsGOTParser<ELFT>::getPltEntries() const { … }
template <class ELFT>
uint64_t MipsGOTParser<ELFT>::getPltAddress(const Entry *E) const { … }
template <class ELFT>
const typename MipsGOTParser<ELFT>::Elf_Sym *
MipsGOTParser<ELFT>::getPltSym(const Entry *E) const { … }
const EnumEntry<unsigned> ElfMipsISAExtType[] = …;
const EnumEntry<unsigned> ElfMipsASEFlags[] = …;
const EnumEntry<unsigned> ElfMipsFpABIType[] = …;
static const EnumEntry<unsigned> ElfMipsFlags1[] { … };
static int getMipsRegisterSize(uint8_t Flag) { … }
template <class ELFT>
static void printMipsReginfoData(ScopedPrinter &W,
const Elf_Mips_RegInfo<ELFT> &Reginfo) { … }
template <class ELFT> void ELFDumper<ELFT>::printMipsReginfo() { … }
template <class ELFT>
static Expected<const Elf_Mips_Options<ELFT> *>
readMipsOptions(const uint8_t *SecBegin, ArrayRef<uint8_t> &SecData,
bool &IsSupported) { … }
template <class ELFT> void ELFDumper<ELFT>::printMipsOptions() { … }
template <class ELFT> void ELFDumper<ELFT>::printStackMap() const { … }
template <class ELFT>
void ELFDumper<ELFT>::printReloc(const Relocation<ELFT> &R, unsigned RelIndex,
const Elf_Shdr &Sec, const Elf_Shdr *SymTab) { … }
template <class ELFT>
std::vector<EnumEntry<unsigned>>
ELFDumper<ELFT>::getOtherFlagsFromSymbol(const Elf_Ehdr &Header,
const Elf_Sym &Symbol) const { … }
static inline void printFields(formatted_raw_ostream &OS, StringRef Str1,
StringRef Str2) { … }
template <class ELFT>
static std::string getSectionHeadersNumString(const ELFFile<ELFT> &Obj,
StringRef FileName) { … }
template <class ELFT>
static std::string getSectionHeaderTableIndexString(const ELFFile<ELFT> &Obj,
StringRef FileName) { … }
static const EnumEntry<unsigned> *getObjectFileEnumEntry(unsigned Type) { … }
template <class ELFT>
void GNUELFDumper<ELFT>::printFileSummary(StringRef FileStr, ObjectFile &Obj,
ArrayRef<std::string> InputFilenames,
const Archive *A) { … }
template <class ELFT> void GNUELFDumper<ELFT>::printFileHeaders() { … }
template <class ELFT> std::vector<GroupSection> ELFDumper<ELFT>::getGroups() { … }
static DenseMap<uint64_t, const GroupSection *>
mapSectionsToGroups(ArrayRef<GroupSection> Groups) { … }
template <class ELFT> void GNUELFDumper<ELFT>::printGroupSections() { … }
template <class ELFT>
void GNUELFDumper<ELFT>::printRelRelaReloc(const Relocation<ELFT> &R,
const RelSymbol<ELFT> &RelSym) { … }
template <class ELFT>
static void printRelocHeaderFields(formatted_raw_ostream &OS, unsigned SType,
const typename ELFT::Ehdr &EHeader,
uint64_t CrelHdr = 0) { … }
template <class ELFT>
void GNUELFDumper<ELFT>::printDynamicRelocHeader(unsigned Type, StringRef Name,
const DynRegionInfo &Reg) { … }
template <class ELFT>
static bool isRelocationSec(const typename ELFT::Shdr &Sec,
const typename ELFT::Ehdr &EHeader) { … }
template <class ELFT> void GNUELFDumper<ELFT>::printRelocations() { … }
template <class ELFT> void GNUELFDumper<ELFT>::printRelr(const Elf_Shdr &Sec) { … }
static std::string getSectionTypeOffsetString(unsigned Type) { … }
static std::string getSectionTypeString(unsigned Machine, unsigned Type) { … }
static void printSectionDescription(formatted_raw_ostream &OS,
unsigned EMachine) { … }
template <class ELFT> void GNUELFDumper<ELFT>::printSectionHeaders() { … }
template <class ELFT>
void GNUELFDumper<ELFT>::printSymtabMessage(const Elf_Shdr *Symtab,
size_t Entries,
bool NonVisibilityBitsUsed,
bool ExtraSymInfo) const { … }
template <class ELFT>
std::string GNUELFDumper<ELFT>::getSymbolSectionNdx(
const Elf_Sym &Symbol, unsigned SymIndex, DataRegion<Elf_Word> ShndxTable,
bool ExtraSymInfo) const { … }
template <class ELFT>
void GNUELFDumper<ELFT>::printSymbol(const Elf_Sym &Symbol, unsigned SymIndex,
DataRegion<Elf_Word> ShndxTable,
std::optional<StringRef> StrTable,
bool IsDynamic, bool NonVisibilityBitsUsed,
bool ExtraSymInfo) const { … }
template <class ELFT>
void GNUELFDumper<ELFT>::printHashedSymbol(const Elf_Sym *Symbol,
unsigned SymIndex,
DataRegion<Elf_Word> ShndxTable,
StringRef StrTable,
uint32_t Bucket) { … }
template <class ELFT>
void GNUELFDumper<ELFT>::printSymbols(bool PrintSymbols,
bool PrintDynamicSymbols,
bool ExtraSymInfo) { … }
template <class ELFT>
void GNUELFDumper<ELFT>::printHashTableSymbols(const Elf_Hash &SysVHash) { … }
template <class ELFT>
void GNUELFDumper<ELFT>::printGnuHashTableSymbols(const Elf_GnuHash &GnuHash) { … }
template <class ELFT> void GNUELFDumper<ELFT>::printHashSymbols() { … }
template <class ELFT> void GNUELFDumper<ELFT>::printSectionDetails() { … }
static inline std::string printPhdrFlags(unsigned Flag) { … }
template <class ELFT>
static bool checkTLSSections(const typename ELFT::Phdr &Phdr,
const typename ELFT::Shdr &Sec) { … }
template <class ELFT>
static bool checkPTDynamic(const typename ELFT::Phdr &Phdr,
const typename ELFT::Shdr &Sec) { … }
template <class ELFT>
void GNUELFDumper<ELFT>::printProgramHeaders(
bool PrintProgramHeaders, cl::boolOrDefault PrintSectionMapping) { … }
template <class ELFT> void GNUELFDumper<ELFT>::printProgramHeaders() { … }
template <class ELFT> void GNUELFDumper<ELFT>::printSectionMapping() { … }
namespace {
template <class ELFT>
RelSymbol<ELFT> getSymbolForReloc(const ELFDumper<ELFT> &Dumper,
const Relocation<ELFT> &Reloc) { … }
}
template <class ELFT>
static size_t getMaxDynamicTagSize(const ELFFile<ELFT> &Obj,
typename ELFT::DynRange Tags) { … }
template <class ELFT> void GNUELFDumper<ELFT>::printDynamicTable() { … }
template <class ELFT> void GNUELFDumper<ELFT>::printDynamicRelocations() { … }
template <class ELFT>
void ELFDumper<ELFT>::printDynamicReloc(const Relocation<ELFT> &R) { … }
template <class ELFT>
void ELFDumper<ELFT>::printRelocationsHelper(const Elf_Shdr &Sec) { … }
template <class ELFT> void ELFDumper<ELFT>::printDynamicRelocationsHelper() { … }
template <class ELFT>
void GNUELFDumper<ELFT>::printGNUVersionSectionProlog(
const typename ELFT::Shdr &Sec, const Twine &Label, unsigned EntriesNum) { … }
template <class ELFT>
void GNUELFDumper<ELFT>::printVersionSymbolSection(const Elf_Shdr *Sec) { … }
static std::string versionFlagToString(unsigned Flags) { … }
template <class ELFT>
void GNUELFDumper<ELFT>::printVersionDefinitionSection(const Elf_Shdr *Sec) { … }
template <class ELFT>
void GNUELFDumper<ELFT>::printVersionDependencySection(const Elf_Shdr *Sec) { … }
template <class ELFT>
void GNUELFDumper<ELFT>::printHashHistogramStats(size_t NBucket,
size_t MaxChain,
size_t TotalSyms,
ArrayRef<size_t> Count,
bool IsGnu) const { … }
template <class ELFT> void GNUELFDumper<ELFT>::printCGProfile() { … }
template <class ELFT>
void GNUELFDumper<ELFT>::printBBAddrMaps(bool ) { … }
static Expected<std::vector<uint64_t>> toULEB128Array(ArrayRef<uint8_t> Data) { … }
template <class ELFT>
static Expected<std::vector<uint64_t>>
decodeAddrsigSection(const ELFFile<ELFT> &Obj, const typename ELFT::Shdr &Sec) { … }
template <class ELFT> void GNUELFDumper<ELFT>::printAddrsig() { … }
template <class ELFT>
static bool printAArch64PAuthABICoreInfo(raw_ostream &OS, uint32_t DataSize,
ArrayRef<uint8_t> Desc) { … }
template <typename ELFT>
static std::string getGNUProperty(uint32_t Type, uint32_t DataSize,
ArrayRef<uint8_t> Data) { … }
template <typename ELFT>
static SmallVector<std::string, 4> getGNUPropertyList(ArrayRef<uint8_t> Arr) { … }
struct GNUAbiTag { … };
template <typename ELFT> static GNUAbiTag getGNUAbiTag(ArrayRef<uint8_t> Desc) { … }
static std::string getGNUBuildId(ArrayRef<uint8_t> Desc) { … }
static StringRef getDescAsStringRef(ArrayRef<uint8_t> Desc) { … }
template <typename ELFT>
static bool printGNUNote(raw_ostream &OS, uint32_t NoteType,
ArrayRef<uint8_t> Desc) { … }
AndroidNoteProperties;
static AndroidNoteProperties getAndroidNoteProperties(uint32_t NoteType,
ArrayRef<uint8_t> Desc) { … }
static bool printAndroidNote(raw_ostream &OS, uint32_t NoteType,
ArrayRef<uint8_t> Desc) { … }
template <class ELFT>
void GNUELFDumper<ELFT>::printMemtag(
const ArrayRef<std::pair<std::string, std::string>> DynamicEntries,
const ArrayRef<uint8_t> AndroidNoteDesc,
const ArrayRef<std::pair<uint64_t, uint64_t>> Descriptors) { … }
template <typename ELFT>
static bool printLLVMOMPOFFLOADNote(raw_ostream &OS, uint32_t NoteType,
ArrayRef<uint8_t> Desc) { … }
const EnumEntry<unsigned> FreeBSDFeatureCtlFlags[] = …;
struct FreeBSDNote { … };
template <typename ELFT>
static std::optional<FreeBSDNote>
getFreeBSDNote(uint32_t NoteType, ArrayRef<uint8_t> Desc, bool IsCore) { … }
struct AMDNote { … };
template <typename ELFT>
static AMDNote getAMDNote(uint32_t NoteType, ArrayRef<uint8_t> Desc) { … }
struct AMDGPUNote { … };
template <typename ELFT>
static AMDGPUNote getAMDGPUNote(uint32_t NoteType, ArrayRef<uint8_t> Desc) { … }
struct CoreFileMapping { … };
struct CoreNote { … };
static Expected<CoreNote> readCoreNote(DataExtractor Desc) { … }
template <typename ELFT>
static void printCoreNote(raw_ostream &OS, const CoreNote &Note) { … }
const NoteType GenericNoteTypes[] = …;
const NoteType GNUNoteTypes[] = …;
const NoteType FreeBSDCoreNoteTypes[] = …;
const NoteType FreeBSDNoteTypes[] = …;
const NoteType NetBSDCoreNoteTypes[] = …;
const NoteType OpenBSDCoreNoteTypes[] = …;
const NoteType AMDNoteTypes[] = …;
const NoteType AMDGPUNoteTypes[] = …;
const NoteType LLVMOMPOFFLOADNoteTypes[] = …;
const NoteType AndroidNoteTypes[] = …;
const NoteType CoreNoteTypes[] = …;
template <class ELFT>
StringRef getNoteTypeName(const typename ELFT::Note &Note, unsigned ELFType) { … }
template <class ELFT>
static void processNotesHelper(
const ELFDumper<ELFT> &Dumper,
llvm::function_ref<void(std::optional<StringRef>, typename ELFT::Off,
typename ELFT::Addr, size_t)>
StartNotesFn,
llvm::function_ref<Error(const typename ELFT::Note &, bool)> ProcessNoteFn,
llvm::function_ref<void()> FinishNotesFn) { … }
template <class ELFT> void GNUELFDumper<ELFT>::printNotes() { … }
template <class ELFT>
ArrayRef<uint8_t>
ELFDumper<ELFT>::getMemtagGlobalsSectionContents(uint64_t ExpectedAddr) { … }
constexpr uint64_t MemtagStepVarintReservedBits = …;
constexpr uint64_t MemtagGranuleSize = …;
template <typename ELFT> void ELFDumper<ELFT>::printMemtag() { … }
template <class ELFT> void GNUELFDumper<ELFT>::printELFLinkerOptions() { … }
template <class ELFT>
void ELFDumper<ELFT>::printDependentLibsHelper(
function_ref<void(const Elf_Shdr &)> OnSectionStart,
function_ref<void(StringRef, uint64_t)> OnLibEntry) { … }
template <class ELFT>
void ELFDumper<ELFT>::forEachRelocationDo(
const Elf_Shdr &Sec,
llvm::function_ref<void(const Relocation<ELFT> &, unsigned,
const Elf_Shdr &, const Elf_Shdr *)>
RelRelaFn) { … }
template <class ELFT>
StringRef ELFDumper<ELFT>::getPrintableSectionName(const Elf_Shdr &Sec) const { … }
template <class ELFT> void GNUELFDumper<ELFT>::printDependentLibs() { … }
template <class ELFT>
SmallVector<uint32_t> ELFDumper<ELFT>::getSymbolIndexesForFunctionAddress(
uint64_t SymValue, std::optional<const Elf_Shdr *> FunctionSec) { … }
template <class ELFT>
bool ELFDumper<ELFT>::printFunctionStackSize(
uint64_t SymValue, std::optional<const Elf_Shdr *> FunctionSec,
const Elf_Shdr &StackSizeSec, DataExtractor Data, uint64_t *Offset) { … }
template <class ELFT>
void GNUELFDumper<ELFT>::printStackSizeEntry(uint64_t Size,
ArrayRef<std::string> FuncNames) { … }
template <class ELFT>
void ELFDumper<ELFT>::printStackSize(const Relocation<ELFT> &R,
const Elf_Shdr &RelocSec, unsigned Ndx,
const Elf_Shdr *SymTab,
const Elf_Shdr *FunctionSec,
const Elf_Shdr &StackSizeSec,
const RelocationResolver &Resolver,
DataExtractor Data) { … }
template <class ELFT>
void ELFDumper<ELFT>::printNonRelocatableStackSizes(
std::function<void()> PrintHeader) { … }
template <class ELFT>
void ELFDumper<ELFT>::printRelocatableStackSizes(
std::function<void()> PrintHeader) { … }
template <class ELFT>
void GNUELFDumper<ELFT>::printStackSizes() { … }
template <class ELFT>
void GNUELFDumper<ELFT>::printMipsGOT(const MipsGOTParser<ELFT> &Parser) { … }
template <class ELFT>
void GNUELFDumper<ELFT>::printMipsPLT(const MipsGOTParser<ELFT> &Parser) { … }
template <class ELFT>
Expected<const Elf_Mips_ABIFlags<ELFT> *>
getMipsAbiFlagsSection(const ELFDumper<ELFT> &Dumper) { … }
template <class ELFT> void GNUELFDumper<ELFT>::printMipsABIFlags() { … }
template <class ELFT> void LLVMELFDumper<ELFT>::printFileHeaders() { … }
template <class ELFT> void LLVMELFDumper<ELFT>::printGroupSections() { … }
template <class ELFT>
std::string LLVMELFDumper<ELFT>::getGroupSectionHeaderName() const { … }
template <class ELFT>
void LLVMELFDumper<ELFT>::printSectionGroupMembers(StringRef Name,
uint64_t Idx) const { … }
template <class ELFT> void LLVMELFDumper<ELFT>::printRelocations() { … }
template <class ELFT>
void LLVMELFDumper<ELFT>::printExpandedRelRelaReloc(const Relocation<ELFT> &R,
StringRef SymbolName,
StringRef RelocName) { … }
template <class ELFT>
void LLVMELFDumper<ELFT>::printDefaultRelRelaReloc(const Relocation<ELFT> &R,
StringRef SymbolName,
StringRef RelocName) { … }
template <class ELFT>
void LLVMELFDumper<ELFT>::printRelocationSectionInfo(const Elf_Shdr &Sec,
StringRef Name,
const unsigned SecNdx) { … }
template <class ELFT> void LLVMELFDumper<ELFT>::printEmptyGroupMessage() const { … }
template <class ELFT>
void LLVMELFDumper<ELFT>::printRelRelaReloc(const Relocation<ELFT> &R,
const RelSymbol<ELFT> &RelSym) { … }
template <class ELFT> void LLVMELFDumper<ELFT>::printSectionHeaders() { … }
template <class ELFT>
void LLVMELFDumper<ELFT>::printSymbolSection(
const Elf_Sym &Symbol, unsigned SymIndex,
DataRegion<Elf_Word> ShndxTable) const { … }
template <class ELFT>
void LLVMELFDumper<ELFT>::printSymbolOtherField(const Elf_Sym &Symbol) const { … }
template <class ELFT>
void LLVMELFDumper<ELFT>::printZeroSymbolOtherField(
const Elf_Sym &Symbol) const { … }
template <class ELFT>
void LLVMELFDumper<ELFT>::printSymbol(const Elf_Sym &Symbol, unsigned SymIndex,
DataRegion<Elf_Word> ShndxTable,
std::optional<StringRef> StrTable,
bool IsDynamic,
bool ,
bool ) const { … }
template <class ELFT>
void LLVMELFDumper<ELFT>::printSymbols(bool PrintSymbols,
bool PrintDynamicSymbols,
bool ExtraSymInfo) { … }
template <class ELFT> void LLVMELFDumper<ELFT>::printDynamicTable() { … }
template <class ELFT>
void JSONELFDumper<ELFT>::printAuxillaryDynamicTableEntryInfo(
const Elf_Dyn &Entry) { … }
template <class ELFT> void JSONELFDumper<ELFT>::printDynamicTable() { … }
template <class ELFT> void LLVMELFDumper<ELFT>::printDynamicRelocations() { … }
template <class ELFT>
void LLVMELFDumper<ELFT>::printProgramHeaders(
bool PrintProgramHeaders, cl::boolOrDefault PrintSectionMapping) { … }
template <class ELFT> void LLVMELFDumper<ELFT>::printProgramHeaders() { … }
template <class ELFT>
void LLVMELFDumper<ELFT>::printVersionSymbolSection(const Elf_Shdr *Sec) { … }
const EnumEntry<unsigned> SymVersionFlags[] = …;
template <class ELFT>
void LLVMELFDumper<ELFT>::printVersionDefinitionSection(const Elf_Shdr *Sec) { … }
template <class ELFT>
void LLVMELFDumper<ELFT>::printVersionDependencySection(const Elf_Shdr *Sec) { … }
template <class ELFT>
void LLVMELFDumper<ELFT>::printHashHistogramStats(size_t NBucket,
size_t MaxChain,
size_t TotalSyms,
ArrayRef<size_t> Count,
bool IsGnu) const { … }
template <class ELFT>
static bool getSymbolIndices(const typename ELFT::Shdr *CGRelSection,
const ELFFile<ELFT> &Obj,
const LLVMELFDumper<ELFT> *Dumper,
SmallVector<uint32_t, 128> &SymbolIndices) { … }
template <class ELFT> void LLVMELFDumper<ELFT>::printCGProfile() { … }
template <class ELFT>
void LLVMELFDumper<ELFT>::printBBAddrMaps(bool PrettyPGOAnalysis) { … }
template <class ELFT> void LLVMELFDumper<ELFT>::printAddrsig() { … }
template <typename ELFT>
static bool printGNUNoteLLVMStyle(uint32_t NoteType, ArrayRef<uint8_t> Desc,
ScopedPrinter &W) { … }
static bool printAndroidNoteLLVMStyle(uint32_t NoteType, ArrayRef<uint8_t> Desc,
ScopedPrinter &W) { … }
template <class ELFT>
void LLVMELFDumper<ELFT>::printMemtag(
const ArrayRef<std::pair<std::string, std::string>> DynamicEntries,
const ArrayRef<uint8_t> AndroidNoteDesc,
const ArrayRef<std::pair<uint64_t, uint64_t>> Descriptors) { … }
template <typename ELFT>
static bool printLLVMOMPOFFLOADNoteLLVMStyle(uint32_t NoteType,
ArrayRef<uint8_t> Desc,
ScopedPrinter &W) { … }
static void printCoreNoteLLVMStyle(const CoreNote &Note, ScopedPrinter &W) { … }
template <class ELFT> void LLVMELFDumper<ELFT>::printNotes() { … }
template <class ELFT> void LLVMELFDumper<ELFT>::printELFLinkerOptions() { … }
template <class ELFT> void LLVMELFDumper<ELFT>::printDependentLibs() { … }
template <class ELFT> void LLVMELFDumper<ELFT>::printStackSizes() { … }
template <class ELFT>
void LLVMELFDumper<ELFT>::printStackSizeEntry(uint64_t Size,
ArrayRef<std::string> FuncNames) { … }
template <class ELFT>
void LLVMELFDumper<ELFT>::printMipsGOT(const MipsGOTParser<ELFT> &Parser) { … }
template <class ELFT>
void LLVMELFDumper<ELFT>::printMipsPLT(const MipsGOTParser<ELFT> &Parser) { … }
template <class ELFT> void LLVMELFDumper<ELFT>::printMipsABIFlags() { … }
template <class ELFT>
void JSONELFDumper<ELFT>::printFileSummary(StringRef FileStr, ObjectFile &Obj,
ArrayRef<std::string> InputFilenames,
const Archive *A) { … }
template <class ELFT>
void JSONELFDumper<ELFT>::printZeroSymbolOtherField(
const Elf_Sym &Symbol) const { … }
template <class ELFT>
void JSONELFDumper<ELFT>::printDefaultRelRelaReloc(const Relocation<ELFT> &R,
StringRef SymbolName,
StringRef RelocName) { … }
template <class ELFT>
void JSONELFDumper<ELFT>::printRelocationSectionInfo(const Elf_Shdr &Sec,
StringRef Name,
const unsigned SecNdx) { … }
template <class ELFT>
std::string JSONELFDumper<ELFT>::getGroupSectionHeaderName() const { … }
template <class ELFT>
void JSONELFDumper<ELFT>::printSectionGroupMembers(StringRef Name,
uint64_t Idx) const { … }
template <class ELFT> void JSONELFDumper<ELFT>::printEmptyGroupMessage() const { … }