LLVM  3.7.0
ELFYAML.cpp
Go to the documentation of this file.
1 //===- ELFYAML.cpp - ELF YAMLIO implementation ----------------------------===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file defines classes for handling the YAML representation of ELF.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #include "llvm/Object/ELFYAML.h"
15 #include "llvm/Support/Casting.h"
17 
18 namespace llvm {
19 
21 
22 namespace yaml {
23 
24 void
26  ELFYAML::ELF_ET &Value) {
27 #define ECase(X) IO.enumCase(Value, #X, ELF::X);
28  ECase(ET_NONE)
29  ECase(ET_REL)
30  ECase(ET_EXEC)
31  ECase(ET_DYN)
32  ECase(ET_CORE)
33 #undef ECase
34  IO.enumFallback<Hex16>(Value);
35 }
36 
37 void
39  ELFYAML::ELF_EM &Value) {
40 #define ECase(X) IO.enumCase(Value, #X, ELF::X);
41  ECase(EM_NONE)
42  ECase(EM_M32)
44  ECase(EM_386)
45  ECase(EM_68K)
46  ECase(EM_88K)
48  ECase(EM_860)
49  ECase(EM_MIPS)
50  ECase(EM_S370)
55  ECase(EM_960)
56  ECase(EM_PPC)
58  ECase(EM_S390)
59  ECase(EM_SPU)
60  ECase(EM_V800)
61  ECase(EM_FR20)
62  ECase(EM_RH32)
63  ECase(EM_RCE)
64  ECase(EM_ARM)
66  ECase(EM_SH)
69  ECase(EM_ARC)
72  ECase(EM_H8S)
78  ECase(EM_MMA)
79  ECase(EM_PCP)
80  ECase(EM_NCPU)
81  ECase(EM_NDR1)
83  ECase(EM_ME16)
87  ECase(EM_PDSP)
90  ECase(EM_FX66)
92  ECase(EM_ST7)
97  ECase(EM_SVX)
98  ECase(EM_ST19)
99  ECase(EM_VAX)
100  ECase(EM_CRIS)
103  ECase(EM_ZSP)
104  ECase(EM_MMIX)
105  ECase(EM_HUANY)
106  ECase(EM_PRISM)
107  ECase(EM_AVR)
108  ECase(EM_FR30)
109  ECase(EM_D10V)
110  ECase(EM_D30V)
111  ECase(EM_V850)
112  ECase(EM_M32R)
115  ECase(EM_PJ)
121  ECase(EM_NS32K)
122  ECase(EM_TPC)
123  ECase(EM_SNP1K)
124  ECase(EM_ST200)
125  ECase(EM_IP2K)
126  ECase(EM_MAX)
127  ECase(EM_CR)
132  ECase(EM_SEP)
133  ECase(EM_ARCA)
136  ECase(EM_DXP)
138  ECase(EM_CRX)
139  ECase(EM_XGATE)
140  ECase(EM_C166)
141  ECase(EM_M16C)
143  ECase(EM_CE)
144  ECase(EM_M32C)
146  ECase(EM_RS08)
147  ECase(EM_SHARC)
148  ECase(EM_ECOG2)
150  ECase(EM_DSP24)
159  ECase(EM_R32C)
162  ECase(EM_8051)
164  ECase(EM_NDS32)
165  ECase(EM_ECOG1)
169  ECase(EM_MANIK)
171  ECase(EM_RX)
172  ECase(EM_METAG)
175  ECase(EM_CR16)
176  ECase(EM_ETPU)
177  ECase(EM_SLE9X)
178  ECase(EM_L10M)
179  ECase(EM_K10M)
181  ECase(EM_AVR32)
182  ECase(EM_STM8)
185  ECase(EM_CUDA)
191  ECase(EM_OPEN8)
192  ECase(EM_RL78)
194  ECase(EM_78KOR)
196 #undef ECase
197 }
198 
200  IO &IO, ELFYAML::ELF_ELFCLASS &Value) {
201 #define ECase(X) IO.enumCase(Value, #X, ELF::X);
202  // Since the semantics of ELFCLASSNONE is "invalid", just don't accept it
203  // here.
206 #undef ECase
207 }
208 
210  IO &IO, ELFYAML::ELF_ELFDATA &Value) {
211 #define ECase(X) IO.enumCase(Value, #X, ELF::X);
212  // Since the semantics of ELFDATANONE is "invalid", just don't accept it
213  // here.
216 #undef ECase
217 }
218 
220  IO &IO, ELFYAML::ELF_ELFOSABI &Value) {
221 #define ECase(X) IO.enumCase(Value, #X, ELF::X);
244 #undef ECase
245 }
246 
248  ELFYAML::ELF_EF &Value) {
249  const auto *Object = static_cast<ELFYAML::Object *>(IO.getContext());
250  assert(Object && "The IO context is not initialized");
251 #define BCase(X) IO.bitSetCase(Value, #X, ELF::X);
252 #define BCaseMask(X, M) IO.maskedBitSetCase(Value, #X, ELF::X, ELF::M);
253  switch (Object->Header.Machine) {
254  case ELF::EM_ARM:
263  break;
264  case ELF::EM_MIPS:
308  break;
309  case ELF::EM_HEXAGON:
318  break;
319  default:
320  llvm_unreachable("Unsupported architecture");
321  }
322 #undef BCase
323 #undef BCaseMask
324 }
325 
327  IO &IO, ELFYAML::ELF_SHT &Value) {
328  const auto *Object = static_cast<ELFYAML::Object *>(IO.getContext());
329  assert(Object && "The IO context is not initialized");
330 #define ECase(X) IO.enumCase(Value, #X, ELF::X);
331  ECase(SHT_NULL)
333  // No SHT_SYMTAB. Use the top-level `Symbols` key instead.
334  // FIXME: Issue a diagnostic with this information.
336  ECase(SHT_RELA)
337  ECase(SHT_HASH)
339  ECase(SHT_NOTE)
341  ECase(SHT_REL)
349  ECase(SHT_LOOS)
355  ECase(SHT_HIOS)
357  switch (Object->Header.Machine) {
358  case ELF::EM_ARM:
364  break;
365  case ELF::EM_HEXAGON:
367  break;
368  case ELF::EM_X86_64:
370  break;
371  case ELF::EM_MIPS:
375  break;
376  default:
377  // Nothing to do.
378  break;
379  }
380 #undef ECase
381 }
382 
384  ELFYAML::ELF_SHF &Value) {
385 #define BCase(X) IO.bitSetCase(Value, #X, ELF::X);
396  BCase(SHF_TLS)
397 #undef BCase
398 }
399 
401  IO &IO, ELFYAML::ELF_STT &Value) {
402 #define ECase(X) IO.enumCase(Value, #X, ELF::X);
405  ECase(STT_FUNC)
407  ECase(STT_FILE)
409  ECase(STT_TLS)
411 #undef ECase
412 }
413 
415  IO &IO, ELFYAML::ELF_STV &Value) {
416 #define ECase(X) IO.enumCase(Value, #X, ELF::X);
421 #undef ECase
422 }
423 
425  ELFYAML::ELF_STO &Value) {
426  const auto *Object = static_cast<ELFYAML::Object *>(IO.getContext());
427  assert(Object && "The IO context is not initialized");
428 #define BCase(X) IO.bitSetCase(Value, #X, ELF::X);
429  switch (Object->Header.Machine) {
430  case ELF::EM_MIPS:
435  break;
436  default:
437  break; // Nothing to do
438  }
439 #undef BCase
440 #undef BCaseMask
441 }
442 
444  IO &IO, ELFYAML::ELF_RSS &Value) {
445 #define ECase(X) IO.enumCase(Value, #X, ELF::X);
447  ECase(RSS_GP)
448  ECase(RSS_GP0)
449  ECase(RSS_LOC)
450 #undef ECase
451 }
452 
454  IO &IO, ELFYAML::ELF_REL &Value) {
455  const auto *Object = static_cast<ELFYAML::Object *>(IO.getContext());
456  assert(Object && "The IO context is not initialized");
457 #define ELF_RELOC(X, Y) IO.enumCase(Value, #X, ELF::X);
458  switch (Object->Header.Machine) {
459  case ELF::EM_X86_64:
460 #include "llvm/Support/ELFRelocs/x86_64.def"
461  break;
462  case ELF::EM_MIPS:
463 #include "llvm/Support/ELFRelocs/Mips.def"
464  break;
465  case ELF::EM_HEXAGON:
466 #include "llvm/Support/ELFRelocs/Hexagon.def"
467  break;
468  case ELF::EM_386:
469 #include "llvm/Support/ELFRelocs/i386.def"
470  break;
471  case ELF::EM_AARCH64:
472 #include "llvm/Support/ELFRelocs/AArch64.def"
473  break;
474  case ELF::EM_ARM:
475 #include "llvm/Support/ELFRelocs/ARM.def"
476  break;
477  default:
478  llvm_unreachable("Unsupported architecture");
479  }
480 #undef ELF_RELOC
481 }
482 
484  IO &IO, ELFYAML::MIPS_AFL_REG &Value) {
485 #define ECase(X) IO.enumCase(Value, #X, Mips::AFL_##X);
486  ECase(REG_NONE)
487  ECase(REG_32)
488  ECase(REG_64)
489  ECase(REG_128)
490 #undef ECase
491 }
492 
494  IO &IO, ELFYAML::MIPS_ABI_FP &Value) {
495 #define ECase(X) IO.enumCase(Value, #X, Mips::Val_GNU_MIPS_ABI_##X);
496  ECase(FP_ANY)
497  ECase(FP_DOUBLE)
498  ECase(FP_SINGLE)
499  ECase(FP_SOFT)
500  ECase(FP_OLD_64)
501  ECase(FP_XX)
502  ECase(FP_64)
503  ECase(FP_64A)
504 #undef ECase
505 }
506 
508  IO &IO, ELFYAML::MIPS_AFL_EXT &Value) {
509 #define ECase(X) IO.enumCase(Value, #X, Mips::AFL_##X);
510  ECase(EXT_NONE)
511  ECase(EXT_XLR)
512  ECase(EXT_OCTEON2)
513  ECase(EXT_OCTEONP)
514  ECase(EXT_LOONGSON_3A)
515  ECase(EXT_OCTEON)
516  ECase(EXT_5900)
517  ECase(EXT_4650)
518  ECase(EXT_4010)
519  ECase(EXT_4100)
520  ECase(EXT_3900)
521  ECase(EXT_10000)
522  ECase(EXT_SB1)
523  ECase(EXT_4111)
524  ECase(EXT_4120)
525  ECase(EXT_5400)
526  ECase(EXT_5500)
527  ECase(EXT_LOONGSON_2E)
528  ECase(EXT_LOONGSON_2F)
529  ECase(EXT_OCTEON3)
530 #undef ECase
531 }
532 
534  IO &IO, ELFYAML::MIPS_ISA &Value) {
535  IO.enumCase(Value, "MIPS1", 1);
536  IO.enumCase(Value, "MIPS2", 2);
537  IO.enumCase(Value, "MIPS3", 3);
538  IO.enumCase(Value, "MIPS4", 4);
539  IO.enumCase(Value, "MIPS5", 5);
540  IO.enumCase(Value, "MIPS32", 32);
541  IO.enumCase(Value, "MIPS64", 64);
542 }
543 
545  IO &IO, ELFYAML::MIPS_AFL_ASE &Value) {
546 #define BCase(X) IO.bitSetCase(Value, #X, Mips::AFL_ASE_##X);
547  BCase(DSP)
548  BCase(DSPR2)
549  BCase(EVA)
550  BCase(MCU)
551  BCase(MDMX)
552  BCase(MIPS3D)
553  BCase(MT)
554  BCase(SMARTMIPS)
555  BCase(VIRT)
556  BCase(MSA)
557  BCase(MIPS16)
558  BCase(MICROMIPS)
559  BCase(XPA)
560 #undef BCase
561 }
562 
564  IO &IO, ELFYAML::MIPS_AFL_FLAGS1 &Value) {
565 #define BCase(X) IO.bitSetCase(Value, #X, Mips::AFL_FLAGS1_##X);
566  BCase(ODDSPREG)
567 #undef BCase
568 }
569 
571  ELFYAML::FileHeader &FileHdr) {
572  IO.mapRequired("Class", FileHdr.Class);
573  IO.mapRequired("Data", FileHdr.Data);
574  IO.mapOptional("OSABI", FileHdr.OSABI, ELFYAML::ELF_ELFOSABI(0));
575  IO.mapRequired("Type", FileHdr.Type);
576  IO.mapRequired("Machine", FileHdr.Machine);
577  IO.mapOptional("Flags", FileHdr.Flags, ELFYAML::ELF_EF(0));
578  IO.mapOptional("Entry", FileHdr.Entry, Hex64(0));
579 }
580 
581 namespace {
582 struct NormalizedOther {
583  NormalizedOther(IO &)
584  : Visibility(ELFYAML::ELF_STV(0)), Other(ELFYAML::ELF_STO(0)) {}
585  NormalizedOther(IO &, uint8_t Original)
586  : Visibility(Original & 0x3), Other(Original & ~0x3) {}
587 
588  uint8_t denormalize(IO &) { return Visibility | Other; }
589 
590  ELFYAML::ELF_STV Visibility;
591  ELFYAML::ELF_STO Other;
592 };
593 }
594 
596  IO.mapOptional("Name", Symbol.Name, StringRef());
597  IO.mapOptional("Type", Symbol.Type, ELFYAML::ELF_STT(0));
598  IO.mapOptional("Section", Symbol.Section, StringRef());
599  IO.mapOptional("Value", Symbol.Value, Hex64(0));
600  IO.mapOptional("Size", Symbol.Size, Hex64(0));
601 
603  IO.mapOptional("Visibility", Keys->Visibility, ELFYAML::ELF_STV(0));
604  IO.mapOptional("Other", Keys->Other, ELFYAML::ELF_STO(0));
605 }
606 
609  IO.mapOptional("Local", Symbols.Local);
610  IO.mapOptional("Global", Symbols.Global);
611  IO.mapOptional("Weak", Symbols.Weak);
612 }
613 
615  IO.mapOptional("Name", Section.Name, StringRef());
616  IO.mapRequired("Type", Section.Type);
617  IO.mapOptional("Flags", Section.Flags, ELFYAML::ELF_SHF(0));
618  IO.mapOptional("Address", Section.Address, Hex64(0));
619  IO.mapOptional("Link", Section.Link, StringRef());
620  IO.mapOptional("AddressAlign", Section.AddressAlign, Hex64(0));
621  IO.mapOptional("Info", Section.Info, StringRef());
622 }
623 
625  commonSectionMapping(IO, Section);
626  IO.mapOptional("Content", Section.Content);
627  IO.mapOptional("Size", Section.Size, Hex64(Section.Content.binary_size()));
628 }
629 
631  commonSectionMapping(IO, Section);
632  IO.mapOptional("Size", Section.Size, Hex64(0));
633 }
634 
636  commonSectionMapping(IO, Section);
637  IO.mapOptional("Relocations", Section.Relocations);
638 }
639 
640 static void groupSectionMapping(IO &IO, ELFYAML::Group &group) {
641  commonSectionMapping(IO, group);
642  IO.mapRequired("Members", group.Members);
643 }
644 
646  IO &IO, ELFYAML::SectionOrType &sectionOrType) {
647  IO.mapRequired("SectionOrType", sectionOrType.sectionNameOrType);
648 }
649 
651  commonSectionMapping(IO, Section);
652  IO.mapOptional("Version", Section.Version, Hex16(0));
653  IO.mapRequired("ISA", Section.ISALevel);
654  IO.mapOptional("ISARevision", Section.ISARevision, Hex8(0));
655  IO.mapOptional("ISAExtension", Section.ISAExtension,
656  ELFYAML::MIPS_AFL_EXT(Mips::AFL_EXT_NONE));
657  IO.mapOptional("ASEs", Section.ASEs, ELFYAML::MIPS_AFL_ASE(0));
658  IO.mapOptional("FpABI", Section.FpABI,
659  ELFYAML::MIPS_ABI_FP(Mips::Val_GNU_MIPS_ABI_FP_ANY));
660  IO.mapOptional("GPRSize", Section.GPRSize,
661  ELFYAML::MIPS_AFL_REG(Mips::AFL_REG_NONE));
662  IO.mapOptional("CPR1Size", Section.CPR1Size,
663  ELFYAML::MIPS_AFL_REG(Mips::AFL_REG_NONE));
664  IO.mapOptional("CPR2Size", Section.CPR2Size,
665  ELFYAML::MIPS_AFL_REG(Mips::AFL_REG_NONE));
666  IO.mapOptional("Flags1", Section.Flags1, ELFYAML::MIPS_AFL_FLAGS1(0));
667  IO.mapOptional("Flags2", Section.Flags2, Hex32(0));
668 }
669 
671  IO &IO, std::unique_ptr<ELFYAML::Section> &Section) {
672  ELFYAML::ELF_SHT sectionType;
673  if (IO.outputting())
674  sectionType = Section->Type;
675  else
676  IO.mapRequired("Type", sectionType);
677 
678  switch (sectionType) {
679  case ELF::SHT_REL:
680  case ELF::SHT_RELA:
681  if (!IO.outputting())
682  Section.reset(new ELFYAML::RelocationSection());
683  sectionMapping(IO, *cast<ELFYAML::RelocationSection>(Section.get()));
684  break;
685  case ELF::SHT_GROUP:
686  if (!IO.outputting())
687  Section.reset(new ELFYAML::Group());
688  groupSectionMapping(IO, *cast<ELFYAML::Group>(Section.get()));
689  break;
690  case ELF::SHT_NOBITS:
691  if (!IO.outputting())
692  Section.reset(new ELFYAML::NoBitsSection());
693  sectionMapping(IO, *cast<ELFYAML::NoBitsSection>(Section.get()));
694  break;
696  if (!IO.outputting())
697  Section.reset(new ELFYAML::MipsABIFlags());
698  sectionMapping(IO, *cast<ELFYAML::MipsABIFlags>(Section.get()));
699  break;
700  default:
701  if (!IO.outputting())
702  Section.reset(new ELFYAML::RawContentSection());
703  sectionMapping(IO, *cast<ELFYAML::RawContentSection>(Section.get()));
704  }
705 }
706 
708  IO &io, std::unique_ptr<ELFYAML::Section> &Section) {
709  const auto *RawSection = dyn_cast<ELFYAML::RawContentSection>(Section.get());
710  if (!RawSection || RawSection->Size >= RawSection->Content.binary_size())
711  return StringRef();
712  return "Section size must be greater or equal to the content size";
713 }
714 
715 namespace {
716 struct NormalizedMips64RelType {
717  NormalizedMips64RelType(IO &)
718  : Type(ELFYAML::ELF_REL(ELF::R_MIPS_NONE)),
719  Type2(ELFYAML::ELF_REL(ELF::R_MIPS_NONE)),
720  Type3(ELFYAML::ELF_REL(ELF::R_MIPS_NONE)),
721  SpecSym(ELFYAML::ELF_REL(ELF::RSS_UNDEF)) {}
722  NormalizedMips64RelType(IO &, ELFYAML::ELF_REL Original)
723  : Type(Original & 0xFF), Type2(Original >> 8 & 0xFF),
724  Type3(Original >> 16 & 0xFF), SpecSym(Original >> 24 & 0xFF) {}
725 
726  ELFYAML::ELF_REL denormalize(IO &) {
727  ELFYAML::ELF_REL Res = Type | Type2 << 8 | Type3 << 16 | SpecSym << 24;
728  return Res;
729  }
730 
731  ELFYAML::ELF_REL Type;
732  ELFYAML::ELF_REL Type2;
733  ELFYAML::ELF_REL Type3;
734  ELFYAML::ELF_RSS SpecSym;
735 };
736 }
737 
739  ELFYAML::Relocation &Rel) {
740  const auto *Object = static_cast<ELFYAML::Object *>(IO.getContext());
741  assert(Object && "The IO context is not initialized");
742 
743  IO.mapRequired("Offset", Rel.Offset);
744  IO.mapRequired("Symbol", Rel.Symbol);
745 
746  if (Object->Header.Machine == ELFYAML::ELF_EM(ELF::EM_MIPS) &&
747  Object->Header.Class == ELFYAML::ELF_ELFCLASS(ELF::ELFCLASS64)) {
749  IO, Rel.Type);
750  IO.mapRequired("Type", Key->Type);
751  IO.mapOptional("Type2", Key->Type2, ELFYAML::ELF_REL(ELF::R_MIPS_NONE));
752  IO.mapOptional("Type3", Key->Type3, ELFYAML::ELF_REL(ELF::R_MIPS_NONE));
753  IO.mapOptional("SpecSym", Key->SpecSym, ELFYAML::ELF_RSS(ELF::RSS_UNDEF));
754  } else
755  IO.mapRequired("Type", Rel.Type);
756 
757  IO.mapOptional("Addend", Rel.Addend, (int64_t)0);
758 }
759 
761  assert(!IO.getContext() && "The IO context is initialized already");
762  IO.setContext(&Object);
763  IO.mapRequired("FileHeader", Object.Header);
764  IO.mapOptional("Sections", Object.Sections);
765  IO.mapOptional("Symbols", Object.Symbols);
766  IO.setContext(nullptr);
767 }
768 
769 LLVM_YAML_STRONG_TYPEDEF(uint8_t, MIPS_AFL_REG)
770 LLVM_YAML_STRONG_TYPEDEF(uint8_t, MIPS_ABI_FP)
771 LLVM_YAML_STRONG_TYPEDEF(uint32_t, MIPS_AFL_EXT)
772 LLVM_YAML_STRONG_TYPEDEF(uint32_t, MIPS_AFL_ASE)
773 LLVM_YAML_STRONG_TYPEDEF(uint32_t, MIPS_AFL_FLAGS1)
774 
775 } // end namespace yaml
776 } // end namespace llvm
static void sectionMapping(IO &IO, ELFYAML::MipsABIFlags &Section)
Definition: ELFYAML.cpp:650
ArrayRef< uint8_t >::size_type binary_size() const
The number of bytes that are represented by this BinaryRef.
Definition: YAML.h:64
std::enable_if< has_SequenceTraits< T >::value, void >::type mapOptional(const char *Key, T &Val)
Definition: YAMLTraits.h:582
This file declares classes for handling the YAML representation of ELF.
void * getContext()
Definition: YAMLTraits.cpp:35
llvm::yaml::Hex16 Version
Definition: ELFYAML.h:149
ELFYAML::ELF_REL Type3
Definition: ELFYAML.cpp:733
llvm::yaml::Hex64 Address
Definition: ELFYAML.h:99
ELFYAML::ELF_STV Visibility
Definition: ELFYAML.cpp:590
FileHeader Header
Definition: ELFYAML.h:167
llvm::yaml::Hex64 Entry
Definition: ELFYAML.h:67
ELFYAML::ELF_REL Type
Definition: ELFYAML.cpp:731
LocalGlobalWeakSymbols Symbols
Definition: ELFYAML.h:173
llvm::yaml::Hex64 AddressAlign
Definition: ELFYAML.h:102
std::vector< Symbol > Weak
Definition: ELFYAML.h:80
llvm::yaml::Hex64 Size
Definition: ELFYAML.h:116
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Definition: ErrorHandling.h:98
StringRef Section
Definition: ELFYAML.h:72
llvm::yaml::Hex64 Size
Definition: ELFYAML.h:74
static void groupSectionMapping(IO &IO, ELFYAML::Group &group)
Definition: ELFYAML.cpp:640
void enumFallback(T &Val)
Definition: YAMLTraits.h:535
StringRef Name
Definition: ELFYAML.h:70
ELFYAML::ELF_STO Other
Definition: ELFYAML.cpp:591
This class should be specialized by any type that needs to be converted to/from a YAML mapping...
Definition: YAMLTraits.h:44
ELFYAML::ELF_RSS SpecSym
Definition: ELFYAML.cpp:734
std::vector< Symbol > Global
Definition: ELFYAML.h:79
void enumCase(T &Val, const char *Str, const T ConstVal)
Definition: YAMLTraits.h:520
static void commonSectionMapping(IO &IO, ELFYAML::Section &Section)
Definition: ELFYAML.cpp:614
The instances of the Type class are immutable: once they are created, they are never changed...
Definition: Type.h:45
llvm::yaml::Hex32 Flags2
Definition: ELFYAML.h:159
#define BCase(X)
std::vector< std::unique_ptr< Section > > Sections
Definition: ELFYAML.h:168
std::vector< Symbol > Local
Definition: ELFYAML.h:78
llvm::yaml::Hex8 ISARevision
Definition: ELFYAML.h:151
This class should be specialized by any integral type that converts to/from a YAML scalar where there...
Definition: YAMLTraits.h:68
#define LLVM_YAML_STRONG_TYPEDEF(_base, _type)
YAML I/O does conversion based on types.
Definition: YAMLTraits.h:1195
ELF_ELFCLASS Class
Definition: ELFYAML.h:61
std::vector< SectionOrType > Members
Definition: ELFYAML.h:126
llvm::yaml::Hex64 Offset
Definition: ELFYAML.h:134
void setContext(void *)
Definition: YAMLTraits.cpp:39
LLVM_ATTRIBUTE_UNUSED_RESULT std::enable_if< !is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type >::type dyn_cast(const Y &Val)
Definition: Casting.h:285
#define ECase(X)
ELFYAML::ELF_REL Type2
Definition: ELFYAML.cpp:732
MIPS_AFL_EXT ISAExtension
Definition: ELFYAML.h:156
llvm::yaml::Hex64 Value
Definition: ELFYAML.h:73
virtual bool outputting()=0
MIPS_AFL_FLAGS1 Flags1
Definition: ELFYAML.h:158
This class should be specialized by any integer type that is a union of bit values and the YAML repre...
Definition: YAMLTraits.h:86
LLVM Value Representation.
Definition: Value.h:69
llvm::yaml::Hex64 Size
Definition: ELFYAML.h:108
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:40
void mapRequired(const char *Key, T &Val)
Definition: YAMLTraits.h:576
ELF_ELFOSABI OSABI
Definition: ELFYAML.h:63
#define BCaseMask(X, M)
std::vector< Relocation > Relocations
Definition: ELFYAML.h:140