LLVM  10.0.0
ELFYAML.h
Go to the documentation of this file.
1 //===- ELFYAML.h - ELF YAMLIO implementation --------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 ///
9 /// \file
10 /// This file declares classes for handling the YAML representation
11 /// of ELF.
12 ///
13 //===----------------------------------------------------------------------===//
14 
15 #ifndef LLVM_OBJECTYAML_ELFYAML_H
16 #define LLVM_OBJECTYAML_ELFYAML_H
17 
18 #include "llvm/ADT/StringRef.h"
19 #include "llvm/ObjectYAML/YAML.h"
21 #include <cstdint>
22 #include <memory>
23 #include <vector>
24 
25 namespace llvm {
26 namespace ELFYAML {
27 
29 
30 // These types are invariant across 32/64-bit ELF, so for simplicity just
31 // directly give them their exact sizes. We don't need to worry about
32 // endianness because these are just the types in the YAMLIO structures,
33 // and are appropriately converted to the necessary endianness when
34 // reading/generating binary object files.
35 // The naming of these types is intended to be ELF_PREFIX, where PREFIX is
36 // the common prefix of the respective constants. E.g. ELF_EM corresponds
37 // to the `e_machine` constants, like `EM_X86_64`.
38 // In the future, these would probably be better suited by C++11 enum
39 // class's with appropriate fixed underlying type.
40 LLVM_YAML_STRONG_TYPEDEF(uint16_t, ELF_ET)
41 LLVM_YAML_STRONG_TYPEDEF(uint32_t, ELF_PT)
42 LLVM_YAML_STRONG_TYPEDEF(uint32_t, ELF_EM)
43 LLVM_YAML_STRONG_TYPEDEF(uint8_t, ELF_ELFCLASS)
44 LLVM_YAML_STRONG_TYPEDEF(uint8_t, ELF_ELFDATA)
45 LLVM_YAML_STRONG_TYPEDEF(uint8_t, ELF_ELFOSABI)
46 // Just use 64, since it can hold 32-bit values too.
47 LLVM_YAML_STRONG_TYPEDEF(uint64_t, ELF_EF)
48 // Just use 64, since it can hold 32-bit values too.
49 LLVM_YAML_STRONG_TYPEDEF(uint64_t, ELF_DYNTAG)
50 LLVM_YAML_STRONG_TYPEDEF(uint32_t, ELF_PF)
51 LLVM_YAML_STRONG_TYPEDEF(uint32_t, ELF_SHT)
52 LLVM_YAML_STRONG_TYPEDEF(uint32_t, ELF_REL)
53 LLVM_YAML_STRONG_TYPEDEF(uint8_t, ELF_RSS)
54 // Just use 64, since it can hold 32-bit values too.
55 LLVM_YAML_STRONG_TYPEDEF(uint64_t, ELF_SHF)
56 LLVM_YAML_STRONG_TYPEDEF(uint16_t, ELF_SHN)
57 LLVM_YAML_STRONG_TYPEDEF(uint8_t, ELF_STB)
58 LLVM_YAML_STRONG_TYPEDEF(uint8_t, ELF_STT)
59 
60 LLVM_YAML_STRONG_TYPEDEF(uint8_t, MIPS_AFL_REG)
61 LLVM_YAML_STRONG_TYPEDEF(uint8_t, MIPS_ABI_FP)
62 LLVM_YAML_STRONG_TYPEDEF(uint32_t, MIPS_AFL_EXT)
63 LLVM_YAML_STRONG_TYPEDEF(uint32_t, MIPS_AFL_ASE)
64 LLVM_YAML_STRONG_TYPEDEF(uint32_t, MIPS_AFL_FLAGS1)
65 LLVM_YAML_STRONG_TYPEDEF(uint32_t, MIPS_ISA)
66 
67 LLVM_YAML_STRONG_TYPEDEF(StringRef, YAMLFlowString)
68 
69 // For now, hardcode 64 bits everywhere that 32 or 64 would be needed
70 // since 64-bit can hold 32-bit values too.
71 struct FileHeader {
72  ELF_ELFCLASS Class;
73  ELF_ELFDATA Data;
74  ELF_ELFOSABI OSABI;
75  llvm::yaml::Hex8 ABIVersion;
76  ELF_ET Type;
77  ELF_EM Machine;
78  ELF_EF Flags;
79  llvm::yaml::Hex64 Entry;
80 
85 };
86 
87 struct SectionName {
89 };
90 
91 struct ProgramHeader {
92  ELF_PT Type;
93  ELF_PF Flags;
94  llvm::yaml::Hex64 VAddr;
95  llvm::yaml::Hex64 PAddr;
100  std::vector<SectionName> Sections;
101 };
102 
103 struct Symbol {
106  ELF_STT Type;
109  ELF_STB Binding;
110  llvm::yaml::Hex64 Value;
111  llvm::yaml::Hex64 Size;
113 };
114 
117 };
118 
119 struct DynamicEntry {
120  ELF_DYNTAG Tag;
121  llvm::yaml::Hex64 Val;
122 };
123 
125  llvm::yaml::Hex64 Address;
126  llvm::yaml::Hex64 Size;
127 };
128 
129 struct NoteEntry {
132  llvm::yaml::Hex32 Type;
133 };
134 
135 struct Chunk {
136  enum class ChunkKind {
137  Dynamic,
138  Group,
139  RawContent,
140  Relocation,
141  Relr,
142  NoBits,
143  Note,
144  Hash,
145  GnuHash,
146  Verdef,
147  Verneed,
148  StackSizes,
150  Symver,
151  MipsABIFlags,
152  Addrsig,
153  Fill,
154  LinkerOptions,
155  DependentLibraries,
156  };
157 
160 
161  Chunk(ChunkKind K) : Kind(K) {}
162  virtual ~Chunk();
163 };
164 
165 struct Section : public Chunk {
166  ELF_SHT Type;
168  llvm::yaml::Hex64 Address;
170  llvm::yaml::Hex64 AddressAlign;
172 
173  // Usually sections are not created implicitly, but loaded from YAML.
174  // When they are, this flag is used to signal about that.
176 
177  Section(ChunkKind Kind, bool IsImplicit = false)
178  : Chunk(Kind), IsImplicit(IsImplicit) {}
179 
180  static bool classof(const Chunk *S) { return S->Kind != ChunkKind::Fill; }
181 
182  // The following members are used to override section fields which is
183  // useful for creating invalid objects.
184 
185  // This can be used to override the offset stored in the sh_name field.
186  // It does not affect the name stored in the string table.
188 
189  // This can be used to override the sh_offset field. It does not place the
190  // section data at the offset specified.
192 
193  // This can be used to override the sh_size field. It does not affect the
194  // content written.
196 
197  // This can be used to override the sh_flags field.
199 };
200 
201 // Fill is a block of data which is placed outside of sections. It is
202 // not present in the sections header table, but it might affect the output file
203 // size and program headers produced.
204 struct Fill : Chunk {
206  llvm::yaml::Hex64 Size;
207 
208  // We have to remember the offset of the fill, because it does not have
209  // a corresponding section header, unlike a section. We might need this
210  // information when writing the output.
211  uint64_t ShOffset;
212 
214 
215  static bool classof(const Chunk *S) { return S->Kind == ChunkKind::Fill; }
216 };
217 
222 
223  StackSizesSection() : Section(ChunkKind::StackSizes) {}
224 
225  static bool classof(const Chunk *S) {
226  return S->Kind == ChunkKind::StackSizes;
227  }
228 
229  static bool nameMatches(StringRef Name) {
230  return Name == ".stack_sizes";
231  }
232 };
233 
235  std::vector<DynamicEntry> Entries;
237 
239 
240  static bool classof(const Chunk *S) { return S->Kind == ChunkKind::Dynamic; }
241 };
242 
247 
248  RawContentSection() : Section(ChunkKind::RawContent) {}
249 
250  static bool classof(const Chunk *S) {
251  return S->Kind == ChunkKind::RawContent;
252  }
253 };
254 
256  llvm::yaml::Hex64 Size;
257 
259 
260  static bool classof(const Chunk *S) { return S->Kind == ChunkKind::NoBits; }
261 };
262 
267 
269 
270  static bool classof(const Chunk *S) { return S->Kind == ChunkKind::Note; }
271 };
272 
278 
280 
281  static bool classof(const Chunk *S) { return S->Kind == ChunkKind::Hash; }
282 };
283 
285  // The number of hash buckets.
286  // Not used when dumping the object, but can be used to override
287  // the real number of buckets when emiting an object from a YAML document.
289 
290  // Index of the first symbol in the dynamic symbol table
291  // included in the hash table.
292  llvm::yaml::Hex32 SymNdx;
293 
294  // The number of words in the Bloom filter.
295  // Not used when dumping the object, but can be used to override the real
296  // number of words in the Bloom filter when emiting an object from a YAML
297  // document.
299 
300  // A shift constant used by the Bloom filter.
301  llvm::yaml::Hex32 Shift2;
302 };
303 
306 
311 
313 
314  static bool classof(const Chunk *S) { return S->Kind == ChunkKind::GnuHash; }
315 };
316 
317 struct VernauxEntry {
322 };
323 
324 struct VerneedEntry {
327  std::vector<VernauxEntry> AuxV;
328 };
329 
333  llvm::yaml::Hex64 Info;
334 
336 
337  static bool classof(const Chunk *S) {
338  return S->Kind == ChunkKind::Verneed;
339  }
340 };
341 
344  AddrsigSymbol(llvm::yaml::Hex32 Ndx) : Name(None), Index(Ndx) {}
346 
349 };
350 
355 
357 
358  static bool classof(const Chunk *S) { return S->Kind == ChunkKind::Addrsig; }
359 };
360 
361 struct LinkerOption {
364 };
365 
369 
370  LinkerOptionsSection() : Section(ChunkKind::LinkerOptions) {}
371 
372  static bool classof(const Chunk *S) {
373  return S->Kind == ChunkKind::LinkerOptions;
374  }
375 };
376 
380 
381  DependentLibrariesSection() : Section(ChunkKind::DependentLibraries) {}
382 
383  static bool classof(const Chunk *S) {
384  return S->Kind == ChunkKind::DependentLibraries;
385  }
386 };
387 
389  std::vector<uint16_t> Entries;
390 
392 
393  static bool classof(const Chunk *S) { return S->Kind == ChunkKind::Symver; }
394 };
395 
396 struct VerdefEntry {
401  std::vector<StringRef> VerNames;
402 };
403 
407 
408  llvm::yaml::Hex64 Info;
409 
411 
412  static bool classof(const Chunk *S) { return S->Kind == ChunkKind::Verdef; }
413 };
414 
415 struct Group : Section {
416  // Members of a group contain a flag and a list of section indices
417  // that are part of the group.
418  std::vector<SectionOrType> Members;
420 
422 
423  static bool classof(const Chunk *S) { return S->Kind == ChunkKind::Group; }
424 };
425 
426 struct Relocation {
427  llvm::yaml::Hex64 Offset;
428  int64_t Addend;
429  ELF_REL Type;
431 };
432 
434  std::vector<Relocation> Relocations;
436 
438 
439  static bool classof(const Chunk *S) {
440  return S->Kind == ChunkKind::Relocation;
441  }
442 };
443 
447 
449 
450  static bool classof(const Chunk *S) {
451  return S->Kind == ChunkKind::Relr;
452  }
453 };
454 
456  std::vector<uint32_t> Entries;
457 
459 
460  static bool classof(const Chunk *S) {
461  return S->Kind == ChunkKind::SymtabShndxSection;
462  }
463 };
464 
465 // Represents .MIPS.abiflags section
467  llvm::yaml::Hex16 Version;
468  MIPS_ISA ISALevel;
469  llvm::yaml::Hex8 ISARevision;
470  MIPS_AFL_REG GPRSize;
471  MIPS_AFL_REG CPR1Size;
472  MIPS_AFL_REG CPR2Size;
473  MIPS_ABI_FP FpABI;
474  MIPS_AFL_EXT ISAExtension;
475  MIPS_AFL_ASE ASEs;
476  MIPS_AFL_FLAGS1 Flags1;
477  llvm::yaml::Hex32 Flags2;
478 
480 
481  static bool classof(const Chunk *S) {
482  return S->Kind == ChunkKind::MipsABIFlags;
483  }
484 };
485 
486 struct Object {
488  std::vector<ProgramHeader> ProgramHeaders;
489 
490  // An object might contain output section descriptions as well as
491  // custom data that does not belong to any section.
492  std::vector<std::unique_ptr<Chunk>> Chunks;
493 
494  // Although in reality the symbols reside in a section, it is a lot
495  // cleaner and nicer if we read them from the YAML as a separate
496  // top-level key, which automatically ensures that invariants like there
497  // being a single SHT_SYMTAB section are upheld.
500 
501  std::vector<Section *> getSections() {
502  std::vector<Section *> Ret;
503  for (const std::unique_ptr<Chunk> &Sec : Chunks)
504  if (auto S = dyn_cast<ELFYAML::Section>(Sec.get()))
505  Ret.push_back(S);
506  return Ret;
507  }
508 };
509 
510 } // end namespace ELFYAML
511 } // end namespace llvm
512 
513 LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::ELFYAML::AddrsigSymbol)
514 LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::ELFYAML::StackSizeEntry)
515 LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::ELFYAML::DynamicEntry)
516 LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::ELFYAML::LinkerOption)
517 LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::ELFYAML::NoteEntry)
518 LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::ELFYAML::ProgramHeader)
519 LLVM_YAML_IS_SEQUENCE_VECTOR(std::unique_ptr<llvm::ELFYAML::Chunk>)
520 LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::ELFYAML::Symbol)
521 LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::ELFYAML::VerdefEntry)
522 LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::ELFYAML::VernauxEntry)
523 LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::ELFYAML::VerneedEntry)
524 LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::ELFYAML::Relocation)
525 LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::ELFYAML::SectionOrType)
526 LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::ELFYAML::SectionName)
527 
528 namespace llvm {
529 namespace yaml {
530 
531 template <>
532 struct ScalarEnumerationTraits<ELFYAML::ELF_ET> {
533  static void enumeration(IO &IO, ELFYAML::ELF_ET &Value);
534 };
535 
536 template <> struct ScalarEnumerationTraits<ELFYAML::ELF_PT> {
537  static void enumeration(IO &IO, ELFYAML::ELF_PT &Value);
538 };
539 
540 template <>
541 struct ScalarEnumerationTraits<ELFYAML::ELF_EM> {
542  static void enumeration(IO &IO, ELFYAML::ELF_EM &Value);
543 };
544 
545 template <>
546 struct ScalarEnumerationTraits<ELFYAML::ELF_ELFCLASS> {
547  static void enumeration(IO &IO, ELFYAML::ELF_ELFCLASS &Value);
548 };
549 
550 template <>
551 struct ScalarEnumerationTraits<ELFYAML::ELF_ELFDATA> {
552  static void enumeration(IO &IO, ELFYAML::ELF_ELFDATA &Value);
553 };
554 
555 template <>
556 struct ScalarEnumerationTraits<ELFYAML::ELF_ELFOSABI> {
557  static void enumeration(IO &IO, ELFYAML::ELF_ELFOSABI &Value);
558 };
559 
560 template <>
561 struct ScalarBitSetTraits<ELFYAML::ELF_EF> {
562  static void bitset(IO &IO, ELFYAML::ELF_EF &Value);
563 };
564 
565 template <> struct ScalarBitSetTraits<ELFYAML::ELF_PF> {
566  static void bitset(IO &IO, ELFYAML::ELF_PF &Value);
567 };
568 
569 template <>
570 struct ScalarEnumerationTraits<ELFYAML::ELF_SHT> {
571  static void enumeration(IO &IO, ELFYAML::ELF_SHT &Value);
572 };
573 
574 template <>
575 struct ScalarBitSetTraits<ELFYAML::ELF_SHF> {
576  static void bitset(IO &IO, ELFYAML::ELF_SHF &Value);
577 };
578 
579 template <> struct ScalarEnumerationTraits<ELFYAML::ELF_SHN> {
580  static void enumeration(IO &IO, ELFYAML::ELF_SHN &Value);
581 };
582 
583 template <> struct ScalarEnumerationTraits<ELFYAML::ELF_STB> {
584  static void enumeration(IO &IO, ELFYAML::ELF_STB &Value);
585 };
586 
587 template <>
588 struct ScalarEnumerationTraits<ELFYAML::ELF_STT> {
589  static void enumeration(IO &IO, ELFYAML::ELF_STT &Value);
590 };
591 
592 template <>
593 struct ScalarEnumerationTraits<ELFYAML::ELF_REL> {
594  static void enumeration(IO &IO, ELFYAML::ELF_REL &Value);
595 };
596 
597 template <>
598 struct ScalarEnumerationTraits<ELFYAML::ELF_DYNTAG> {
599  static void enumeration(IO &IO, ELFYAML::ELF_DYNTAG &Value);
600 };
601 
602 template <>
603 struct ScalarEnumerationTraits<ELFYAML::ELF_RSS> {
604  static void enumeration(IO &IO, ELFYAML::ELF_RSS &Value);
605 };
606 
607 template <>
608 struct ScalarEnumerationTraits<ELFYAML::MIPS_AFL_REG> {
609  static void enumeration(IO &IO, ELFYAML::MIPS_AFL_REG &Value);
610 };
611 
612 template <>
613 struct ScalarEnumerationTraits<ELFYAML::MIPS_ABI_FP> {
614  static void enumeration(IO &IO, ELFYAML::MIPS_ABI_FP &Value);
615 };
616 
617 template <>
618 struct ScalarEnumerationTraits<ELFYAML::MIPS_AFL_EXT> {
619  static void enumeration(IO &IO, ELFYAML::MIPS_AFL_EXT &Value);
620 };
621 
622 template <>
623 struct ScalarEnumerationTraits<ELFYAML::MIPS_ISA> {
624  static void enumeration(IO &IO, ELFYAML::MIPS_ISA &Value);
625 };
626 
627 template <>
628 struct ScalarBitSetTraits<ELFYAML::MIPS_AFL_ASE> {
629  static void bitset(IO &IO, ELFYAML::MIPS_AFL_ASE &Value);
630 };
631 
632 template <>
633 struct ScalarBitSetTraits<ELFYAML::MIPS_AFL_FLAGS1> {
634  static void bitset(IO &IO, ELFYAML::MIPS_AFL_FLAGS1 &Value);
635 };
636 
637 template <>
638 struct MappingTraits<ELFYAML::FileHeader> {
639  static void mapping(IO &IO, ELFYAML::FileHeader &FileHdr);
640 };
641 
642 template <> struct MappingTraits<ELFYAML::ProgramHeader> {
643  static void mapping(IO &IO, ELFYAML::ProgramHeader &FileHdr);
644 };
645 
646 template <>
647 struct MappingTraits<ELFYAML::Symbol> {
648  static void mapping(IO &IO, ELFYAML::Symbol &Symbol);
649  static StringRef validate(IO &IO, ELFYAML::Symbol &Symbol);
650 };
651 
652 template <> struct MappingTraits<ELFYAML::StackSizeEntry> {
653  static void mapping(IO &IO, ELFYAML::StackSizeEntry &Rel);
654 };
655 
656 template <> struct MappingTraits<ELFYAML::GnuHashHeader> {
657  static void mapping(IO &IO, ELFYAML::GnuHashHeader &Rel);
658 };
659 
660 template <> struct MappingTraits<ELFYAML::DynamicEntry> {
661  static void mapping(IO &IO, ELFYAML::DynamicEntry &Rel);
662 };
663 
664 template <> struct MappingTraits<ELFYAML::NoteEntry> {
665  static void mapping(IO &IO, ELFYAML::NoteEntry &N);
666 };
667 
668 template <> struct MappingTraits<ELFYAML::VerdefEntry> {
669  static void mapping(IO &IO, ELFYAML::VerdefEntry &E);
670 };
671 
672 template <> struct MappingTraits<ELFYAML::VerneedEntry> {
673  static void mapping(IO &IO, ELFYAML::VerneedEntry &E);
674 };
675 
676 template <> struct MappingTraits<ELFYAML::VernauxEntry> {
677  static void mapping(IO &IO, ELFYAML::VernauxEntry &E);
678 };
679 
680 template <> struct MappingTraits<ELFYAML::AddrsigSymbol> {
681  static void mapping(IO &IO, ELFYAML::AddrsigSymbol &Sym);
682 };
683 
684 template <> struct MappingTraits<ELFYAML::LinkerOption> {
685  static void mapping(IO &IO, ELFYAML::LinkerOption &Sym);
686 };
687 
688 template <> struct MappingTraits<ELFYAML::Relocation> {
689  static void mapping(IO &IO, ELFYAML::Relocation &Rel);
690 };
691 
692 template <> struct MappingTraits<std::unique_ptr<ELFYAML::Chunk>> {
693  static void mapping(IO &IO, std::unique_ptr<ELFYAML::Chunk> &C);
694  static StringRef validate(IO &io, std::unique_ptr<ELFYAML::Chunk> &C);
695 };
696 
697 template <>
698 struct MappingTraits<ELFYAML::Object> {
699  static void mapping(IO &IO, ELFYAML::Object &Object);
700 };
701 
702 template <> struct MappingTraits<ELFYAML::SectionOrType> {
703  static void mapping(IO &IO, ELFYAML::SectionOrType &sectionOrType);
704 };
705 
706 template <> struct MappingTraits<ELFYAML::SectionName> {
707  static void mapping(IO &IO, ELFYAML::SectionName &sectionName);
708 };
709 
710 } // end namespace yaml
711 } // end namespace llvm
712 
713 #endif // LLVM_OBJECTYAML_ELFYAML_H
Optional< llvm::yaml::Hex32 > NBuckets
Definition: ELFYAML.h:288
const NoneType None
Definition: None.h:23
uint64_t CallInst * C
static bool classof(const Chunk *S)
Definition: ELFYAML.h:372
Optional< ELF_SHF > Flags
Definition: ELFYAML.h:167
Optional< llvm::yaml::Hex64 > Size
Definition: ELFYAML.h:353
This class represents lattice values for constants.
Definition: AllocatorList.h:23
static bool classof(const Chunk *S)
Definition: ELFYAML.h:393
Optional< std::vector< llvm::yaml::Hex64 > > BloomFilter
Definition: ELFYAML.h:308
Optional< yaml::BinaryRef > Content
Definition: ELFYAML.h:219
amdgpu Simplify well known AMD library false FunctionCallee Value const Twine & Name
Optional< yaml::BinaryRef > Content
Definition: ELFYAML.h:446
Optional< std::vector< Symbol > > DynamicSymbols
Definition: ELFYAML.h:499
Optional< llvm::yaml::Hex64 > Align
Definition: ELFYAML.h:96
llvm::yaml::Hex32 SymNdx
Definition: ELFYAML.h:292
Optional< ELF_SHN > Index
Definition: ELFYAML.h:108
Optional< llvm::yaml::Hex64 > Size
Definition: ELFYAML.h:220
uint64_t ShOffset
Definition: ELFYAML.h:211
llvm::yaml::Hex64 PAddr
Definition: ELFYAML.h:95
std::vector< SectionName > Sections
Definition: ELFYAML.h:100
llvm::yaml::Hex16 Version
Definition: ELFYAML.h:467
Optional< llvm::yaml::Hex64 > Size
Definition: ELFYAML.h:245
llvm::yaml::Hex64 Info
Definition: ELFYAML.h:408
llvm::yaml::Hex64 Address
Definition: ELFYAML.h:168
FileHeader Header
Definition: ELFYAML.h:487
static bool classof(const Chunk *S)
Definition: ELFYAML.h:215
llvm::yaml::Hex64 Entry
Definition: ELFYAML.h:79
Optional< llvm::yaml::Hex64 > Size
Definition: ELFYAML.h:275
static bool classof(const Chunk *S)
Definition: ELFYAML.h:460
llvm::yaml::Hex64 AddressAlign
Definition: ELFYAML.h:170
Optional< llvm::yaml::Hex32 > Index
Definition: ELFYAML.h:348
Optional< std::vector< llvm::yaml::Hex32 > > HashValues
Definition: ELFYAML.h:310
llvm::yaml::Hex64 Size
Definition: ELFYAML.h:256
std::vector< DynamicEntry > Entries
Definition: ELFYAML.h:235
Definition: BitVector.h:937
Optional< StringRef > Signature
Definition: ELFYAML.h:419
Optional< std::vector< StackSizeEntry > > Entries
Definition: ELFYAML.h:221
StringRef Section
Definition: ELFYAML.h:107
static bool classof(const Chunk *S)
Definition: ELFYAML.h:250
llvm::yaml::Hex64 Size
Definition: ELFYAML.h:111
Optional< std::vector< uint32_t > > Chain
Definition: ELFYAML.h:277
llvm::yaml::Hex8 ABIVersion
Definition: ELFYAML.h:75
llvm::yaml::Hex64 Info
Definition: ELFYAML.h:333
static bool classof(const Chunk *S)
Definition: ELFYAML.h:260
static bool classof(const Chunk *S)
Definition: ELFYAML.h:481
static bool classof(const Chunk *S)
Definition: ELFYAML.h:439
static bool classof(const Chunk *S)
Definition: ELFYAML.h:423
Optional< llvm::yaml::Hex64 > EntSize
Definition: ELFYAML.h:171
std::vector< std::unique_ptr< Chunk > > Chunks
Definition: ELFYAML.h:492
Optional< GnuHashHeader > Header
Definition: ELFYAML.h:307
Optional< uint8_t > Other
Definition: ELFYAML.h:112
Optional< llvm::yaml::Hex64 > ShSize
Definition: ELFYAML.h:195
std::vector< ProgramHeader > ProgramHeaders
Definition: ELFYAML.h:488
StringRef Name
Definition: ELFYAML.h:159
Optional< std::vector< Symbol > > Symbols
Definition: ELFYAML.h:498
std::vector< VernauxEntry > AuxV
Definition: ELFYAML.h:327
Optional< llvm::yaml::Hex16 > SHStrNdx
Definition: ELFYAML.h:84
llvm::yaml::Hex32 Shift2
Definition: ELFYAML.h:301
llvm::yaml::Hex32 Flags2
Definition: ELFYAML.h:477
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
static bool classof(const Chunk *S)
Definition: ELFYAML.h:337
static bool classof(const Chunk *S)
Definition: ELFYAML.h:180
std::vector< uint32_t > Entries
Definition: ELFYAML.h:456
Optional< llvm::yaml::Hex64 > Size
Definition: ELFYAML.h:265
Optional< llvm::yaml::Hex64 > SHOff
Definition: ELFYAML.h:82
std::vector< StringRef > VerNames
Definition: ELFYAML.h:401
Optional< yaml::BinaryRef > Content
Definition: ELFYAML.h:368
static bool classof(const Chunk *S)
Definition: ELFYAML.h:240
AddrsigSymbol(llvm::yaml::Hex32 Ndx)
Definition: ELFYAML.h:344
Optional< std::vector< ELFYAML::NoteEntry > > Notes
Definition: ELFYAML.h:266
Optional< yaml::BinaryRef > Content
Definition: ELFYAML.h:244
Optional< yaml::BinaryRef > Content
Definition: ELFYAML.h:236
std::vector< Section * > getSections()
Definition: ELFYAML.h:501
AddrsigSymbol(StringRef N)
Definition: ELFYAML.h:343
llvm::yaml::Hex8 ISARevision
Definition: ELFYAML.h:469
Optional< std::vector< LinkerOption > > Options
Definition: ELFYAML.h:367
yaml::BinaryRef Desc
Definition: ELFYAML.h:131
Optional< llvm::yaml::Hex64 > MemSize
Definition: ELFYAML.h:98
Optional< std::vector< llvm::yaml::Hex64 > > Entries
Definition: ELFYAML.h:445
Optional< llvm::yaml::Hex32 > MaskWords
Definition: ELFYAML.h:298
llvm::yaml::Hex32 Type
Definition: ELFYAML.h:132
StringRef dropUniqueSuffix(StringRef S)
Definition: ELFEmitter.cpp:396
ELF_ELFCLASS Class
Definition: ELFYAML.h:72
std::vector< SectionOrType > Members
Definition: ELFYAML.h:418
Optional< llvm::yaml::Hex64 > ShOffset
Definition: ELFYAML.h:191
Optional< StringRef > Name
Definition: ELFYAML.h:347
static bool nameMatches(StringRef Name)
Definition: ELFYAML.h:229
llvm::yaml::Hex64 Offset
Definition: ELFYAML.h:427
Optional< yaml::BinaryRef > Content
Definition: ELFYAML.h:305
Optional< std::vector< VerneedEntry > > VerneedV
Definition: ELFYAML.h:332
Optional< llvm::yaml::Hex16 > SHNum
Definition: ELFYAML.h:83
Optional< llvm::yaml::Hex64 > Info
Definition: ELFYAML.h:246
Specialized YAMLIO scalar type for representing a binary blob.
Definition: YAML.h:63
Optional< llvm::yaml::Hex64 > ShName
Definition: ELFYAML.h:187
Section(ChunkKind Kind, bool IsImplicit=false)
Definition: ELFYAML.h:177
static bool classof(const Chunk *S)
Definition: ELFYAML.h:412
Optional< llvm::yaml::Hex64 > ShFlags
Definition: ELFYAML.h:198
static bool classof(const Chunk *S)
Definition: ELFYAML.h:358
llvm::yaml::Hex64 Address
Definition: ELFYAML.h:125
Optional< yaml::BinaryRef > Pattern
Definition: ELFYAML.h:205
Optional< yaml::BinaryRef > Content
Definition: ELFYAML.h:406
MIPS_AFL_EXT ISAExtension
Definition: ELFYAML.h:474
Optional< std::vector< uint32_t > > Bucket
Definition: ELFYAML.h:276
#define N
Optional< std::vector< llvm::yaml::Hex32 > > HashBuckets
Definition: ELFYAML.h:309
llvm::yaml::Hex64 Value
Definition: ELFYAML.h:110
Optional< std::vector< AddrsigSymbol > > Symbols
Definition: ELFYAML.h:354
Optional< yaml::BinaryRef > Content
Definition: ELFYAML.h:352
Optional< llvm::yaml::Hex64 > FileSize
Definition: ELFYAML.h:97
Optional< yaml::BinaryRef > Content
Definition: ELFYAML.h:331
Optional< llvm::yaml::Hex16 > SHEntSize
Definition: ELFYAML.h:81
Optional< uint32_t > NameIndex
Definition: ELFYAML.h:105
MIPS_AFL_FLAGS1 Flags1
Definition: ELFYAML.h:476
static bool classof(const Chunk *S)
Definition: ELFYAML.h:450
LLVM Value Representation.
Definition: Value.h:74
static bool classof(const Chunk *S)
Definition: ELFYAML.h:225
Optional< yaml::BinaryRef > Content
Definition: ELFYAML.h:264
static bool classof(const Chunk *S)
Definition: ELFYAML.h:281
llvm::yaml::Hex64 Val
Definition: ELFYAML.h:121
Optional< std::vector< VerdefEntry > > Entries
Definition: ELFYAML.h:405
Optional< std::vector< YAMLFlowString > > Libs
Definition: ELFYAML.h:378
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:54
Optional< yaml::BinaryRef > Content
Definition: ELFYAML.h:274
std::vector< uint16_t > Entries
Definition: ELFYAML.h:389
ELF_ELFOSABI OSABI
Definition: ELFYAML.h:74
llvm::yaml::Hex64 VAddr
Definition: ELFYAML.h:94
Optional< yaml::BinaryRef > Content
Definition: ELFYAML.h:379
Optional< StringRef > Symbol
Definition: ELFYAML.h:430
llvm::yaml::Hex64 Size
Definition: ELFYAML.h:126
static bool classof(const Chunk *S)
Definition: ELFYAML.h:270
std::vector< Relocation > Relocations
Definition: ELFYAML.h:434
static bool classof(const Chunk *S)
Definition: ELFYAML.h:314
Chunk(ChunkKind K)
Definition: ELFYAML.h:161
void validate(const Triple &TT, const FeatureBitset &FeatureBits)
llvm::yaml::Hex64 Size
Definition: ELFYAML.h:206
static bool classof(const Chunk *S)
Definition: ELFYAML.h:383
ChunkKind Kind
Definition: ELFYAML.h:158
Optional< llvm::yaml::Hex64 > Offset
Definition: ELFYAML.h:99