15 #ifndef LLVM_OBJECTYAML_ELFYAML_H
16 #define LLVM_OBJECTYAML_ELFYAML_H
85 return sizeof(
typename ELFT::Sym);
89 return sizeof(
typename ELFT::Rel);
91 return sizeof(
typename ELFT::Rela);
93 return sizeof(
typename ELFT::Relr);
95 return sizeof(
typename ELFT::Dyn);
101 return sizeof(
typename ELFT::Half);
105 if (SecName ==
".debug_str")
143 std::optional<llvm::yaml::Hex64>
Value;
144 std::optional<llvm::yaml::Hex64>
Size;
235 std::optional<llvm::yaml::Hex64>
Size;
249 virtual std::vector<std::pair<StringRef, bool>>
getEntries()
const {
301 std::optional<std::vector<SectionHeader>>
Sections;
302 std::optional<std::vector<SectionHeader>>
Excluded;
319 std::optional<std::vector<BBAddrMapEntry>>
Entries;
323 std::vector<std::pair<StringRef, bool>>
getEntries()
const override {
324 return {{
"Entries",
Entries.has_value()}};
333 std::optional<std::vector<StackSizeEntry>>
Entries;
337 std::vector<std::pair<StringRef, bool>>
getEntries()
const override {
338 return {{
"Entries",
Entries.has_value()}};
346 return Name ==
".stack_sizes";
351 std::optional<std::vector<DynamicEntry>>
Entries;
355 std::vector<std::pair<StringRef, bool>>
getEntries()
const override {
356 return {{
"Entries",
Entries.has_value()}};
363 std::optional<llvm::yaml::Hex64>
Info;
382 std::optional<std::vector<ELFYAML::NoteEntry>>
Notes;
386 std::vector<std::pair<StringRef, bool>>
getEntries()
const override {
387 return {{
"Notes",
Notes.has_value()}};
394 std::optional<std::vector<uint32_t>>
Bucket;
395 std::optional<std::vector<uint32_t>>
Chain;
397 std::vector<std::pair<StringRef, bool>>
getEntries()
const override {
398 return {{
"Bucket",
Bucket.has_value()}, {
"Chain",
Chain.has_value()}};
403 std::optional<llvm::yaml::Hex64>
NBucket;
439 std::vector<std::pair<StringRef, bool>>
getEntries()
const override {
440 return {{
"Header",
Header.has_value()},
459 std::vector<VernauxEntry>
AuxV;
464 std::optional<llvm::yaml::Hex64>
Info;
468 std::vector<std::pair<StringRef, bool>>
getEntries()
const override {
469 return {{
"Dependencies",
VerneedV.has_value()}};
478 std::optional<std::vector<YAMLFlowString>>
Symbols;
482 std::vector<std::pair<StringRef, bool>>
getEntries()
const override {
483 return {{
"Symbols",
Symbols.has_value()}};
495 std::optional<std::vector<LinkerOption>>
Options;
499 std::vector<std::pair<StringRef, bool>>
getEntries()
const override {
500 return {{
"Options",
Options.has_value()}};
509 std::optional<std::vector<YAMLFlowString>>
Libs;
513 std::vector<std::pair<StringRef, bool>>
getEntries()
const override {
514 return {{
"Libraries",
Libs.has_value()}};
529 std::optional<std::vector<CallGraphEntryWeight>>
Entries;
533 std::vector<std::pair<StringRef, bool>>
getEntries()
const override {
534 return {{
"Entries",
Entries.has_value()}};
547 std::vector<std::pair<StringRef, bool>>
getEntries()
const override {
548 return {{
"Entries",
Entries.has_value()}};
563 std::optional<std::vector<VerdefEntry>>
Entries;
564 std::optional<llvm::yaml::Hex64>
Info;
568 std::vector<std::pair<StringRef, bool>>
getEntries()
const override {
569 return {{
"Entries",
Entries.has_value()}};
578 std::optional<std::vector<SectionOrType>>
Members;
583 std::vector<std::pair<StringRef, bool>>
getEntries()
const override {
584 return {{
"Members",
Members.has_value()}};
603 std::vector<std::pair<StringRef, bool>>
getEntries()
const override {
613 std::optional<std::vector<llvm::yaml::Hex64>>
Entries;
617 std::vector<std::pair<StringRef, bool>>
getEntries()
const override {
618 return {{
"Entries",
Entries.has_value()}};
631 std::vector<std::pair<StringRef, bool>>
getEntries()
const override {
632 return {{
"Entries",
Entries.has_value()}};
646 std::optional<std::vector<ARMIndexTableEntry>>
Entries;
650 std::vector<std::pair<StringRef, bool>>
getEntries()
const override {
651 return {{
"Entries",
Entries.has_value()}};
685 std::optional<llvm::yaml::Hex64>
Align;
702 std::vector<std::unique_ptr<Chunk>>
Chunks;
710 std::optional<DWARFYAML::Data>
DWARF;
713 std::vector<Section *>
Ret;
714 for (
const std::unique_ptr<Chunk> &Sec :
Chunks)
715 if (
auto S = dyn_cast<ELFYAML::Section>(Sec.get()))
721 for (
const std::unique_ptr<Chunk> &
C :
Chunks)
722 if (
auto *
S = dyn_cast<ELFYAML::SectionHeaderTable>(
C.get()))
732 const NoBitsSection &
S);
758 template <>
struct ScalarTraits<ELFYAML::YAMLIntUInt> {
759 static void output(
const ELFYAML::YAMLIntUInt &Val,
void *Ctx,
762 ELFYAML::YAMLIntUInt &Val);
767 struct ScalarEnumerationTraits<ELFYAML::ELF_ET> {
768 static void enumeration(IO &IO, ELFYAML::ELF_ET &
Value);
771 template <>
struct ScalarEnumerationTraits<ELFYAML::ELF_PT> {
772 static void enumeration(IO &IO, ELFYAML::ELF_PT &
Value);
775 template <>
struct ScalarEnumerationTraits<ELFYAML::ELF_NT> {
776 static void enumeration(IO &IO, ELFYAML::ELF_NT &
Value);
780 struct ScalarEnumerationTraits<ELFYAML::ELF_EM> {
781 static void enumeration(IO &IO, ELFYAML::ELF_EM &
Value);
785 struct ScalarEnumerationTraits<ELFYAML::ELF_ELFCLASS> {
786 static void enumeration(IO &IO, ELFYAML::ELF_ELFCLASS &
Value);
790 struct ScalarEnumerationTraits<ELFYAML::ELF_ELFDATA> {
791 static void enumeration(IO &IO, ELFYAML::ELF_ELFDATA &
Value);
795 struct ScalarEnumerationTraits<ELFYAML::ELF_ELFOSABI> {
796 static void enumeration(IO &IO, ELFYAML::ELF_ELFOSABI &
Value);
800 struct ScalarBitSetTraits<ELFYAML::ELF_EF> {
801 static void bitset(IO &IO, ELFYAML::ELF_EF &
Value);
804 template <>
struct ScalarBitSetTraits<ELFYAML::ELF_PF> {
805 static void bitset(IO &IO, ELFYAML::ELF_PF &
Value);
809 struct ScalarEnumerationTraits<ELFYAML::ELF_SHT> {
810 static void enumeration(IO &IO, ELFYAML::ELF_SHT &
Value);
814 struct ScalarBitSetTraits<ELFYAML::ELF_SHF> {
815 static void bitset(IO &IO, ELFYAML::ELF_SHF &
Value);
818 template <>
struct ScalarEnumerationTraits<ELFYAML::ELF_SHN> {
819 static void enumeration(IO &IO, ELFYAML::ELF_SHN &
Value);
822 template <>
struct ScalarEnumerationTraits<ELFYAML::ELF_STB> {
823 static void enumeration(IO &IO, ELFYAML::ELF_STB &
Value);
827 struct ScalarEnumerationTraits<ELFYAML::ELF_STT> {
828 static void enumeration(IO &IO, ELFYAML::ELF_STT &
Value);
832 struct ScalarEnumerationTraits<ELFYAML::ELF_REL> {
833 static void enumeration(IO &IO, ELFYAML::ELF_REL &
Value);
837 struct ScalarEnumerationTraits<ELFYAML::ELF_DYNTAG> {
838 static void enumeration(IO &IO, ELFYAML::ELF_DYNTAG &
Value);
842 struct ScalarEnumerationTraits<ELFYAML::ELF_RSS> {
843 static void enumeration(IO &IO, ELFYAML::ELF_RSS &
Value);
847 struct ScalarEnumerationTraits<ELFYAML::MIPS_AFL_REG> {
848 static void enumeration(IO &IO, ELFYAML::MIPS_AFL_REG &
Value);
852 struct ScalarEnumerationTraits<ELFYAML::MIPS_ABI_FP> {
853 static void enumeration(IO &IO, ELFYAML::MIPS_ABI_FP &
Value);
857 struct ScalarEnumerationTraits<ELFYAML::MIPS_AFL_EXT> {
858 static void enumeration(IO &IO, ELFYAML::MIPS_AFL_EXT &
Value);
862 struct ScalarEnumerationTraits<ELFYAML::MIPS_ISA> {
863 static void enumeration(IO &IO, ELFYAML::MIPS_ISA &
Value);
867 struct ScalarBitSetTraits<ELFYAML::MIPS_AFL_ASE> {
868 static void bitset(IO &IO, ELFYAML::MIPS_AFL_ASE &
Value);
872 struct ScalarBitSetTraits<ELFYAML::MIPS_AFL_FLAGS1> {
873 static void bitset(IO &IO, ELFYAML::MIPS_AFL_FLAGS1 &
Value);
949 static void mapping(IO &IO, std::unique_ptr<ELFYAML::Chunk> &
C);
950 static std::string
validate(IO &io, std::unique_ptr<ELFYAML::Chunk> &
C);
965 #endif // LLVM_OBJECTYAML_ELFYAML_H