LLVM  4.0.0
Object/COFF.h
Go to the documentation of this file.
1 //===- COFF.h - COFF object file implementation -----------------*- C++ -*-===//
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 declares the COFFObjectFile class.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_OBJECT_COFF_H
15 #define LLVM_OBJECT_COFF_H
16 
17 #include "llvm/ADT/PointerUnion.h"
19 #include "llvm/Object/ObjectFile.h"
20 #include "llvm/Support/COFF.h"
21 #include "llvm/Support/Endian.h"
22 #include "llvm/Support/ErrorOr.h"
23 
24 namespace llvm {
25 template <typename T> class ArrayRef;
26 
27 namespace object {
28 class ImportDirectoryEntryRef;
29 class DelayImportDirectoryEntryRef;
30 class ExportDirectoryEntryRef;
31 class ImportedSymbolRef;
39 
40 /// The DOS compatible header at the front of all PE/COFF executables.
41 struct dos_header {
42  char Magic[2];
61 };
62 
71 
72  bool isImportLibrary() const { return NumberOfSections == 0xffff; }
73 };
74 
81  uint8_t UUID[16];
89 };
90 
91 /// The 32-bit PE header that follows the COFF header.
92 struct pe32_header {
116  // FIXME: This should be DllCharacteristics.
123  // FIXME: This should be NumberOfRvaAndSizes.
125 };
126 
127 /// The 64-bit PE header that follows the COFF header.
158 };
159 
163 };
164 
174 };
175 
176 template <typename IntTy>
178  IntTy Data;
179 
180  bool isOrdinal() const { return Data < 0; }
181 
182  uint16_t getOrdinal() const {
183  assert(isOrdinal() && "ILT entry is not an ordinal!");
184  return Data & 0xFFFF;
185  }
186 
188  assert(!isOrdinal() && "ILT entry is not a Hint/Name RVA!");
189  return Data & 0xFFFFFFFF;
190  }
191 };
192 
197 
199  // dumpbin reports this field as "Characteristics" instead of "Attributes".
208 };
209 
222 };
223 
227 };
228 
231 
235 };
236 
237 template <typename SectionNumberType>
238 struct coff_symbol {
239  union {
242  } Name;
243 
245  SectionNumberType SectionNumber;
246 
248 
249  uint8_t StorageClass;
251 };
252 
255 
256 // Contains only common parts of coff_symbol16 and coff_symbol32.
258  union {
261  } Name;
263 };
264 
266 public:
267  COFFSymbolRef(const coff_symbol16 *CS) : CS16(CS), CS32(nullptr) {}
268  COFFSymbolRef(const coff_symbol32 *CS) : CS16(nullptr), CS32(CS) {}
269  COFFSymbolRef() : CS16(nullptr), CS32(nullptr) {}
270 
271  const void *getRawPtr() const {
272  return CS16 ? static_cast<const void *>(CS16) : CS32;
273  }
274 
276  if (CS16)
277  return reinterpret_cast<const coff_symbol_generic *>(CS16);
278  return reinterpret_cast<const coff_symbol_generic *>(CS32);
279  }
280 
282  return A.getRawPtr() < B.getRawPtr();
283  }
284 
285  bool isBigObj() const {
286  if (CS16)
287  return false;
288  if (CS32)
289  return true;
290  llvm_unreachable("COFFSymbolRef points to nothing!");
291  }
292 
293  const char *getShortName() const {
294  return CS16 ? CS16->Name.ShortName : CS32->Name.ShortName;
295  }
296 
298  assert(isSet() && "COFFSymbolRef points to nothing!");
299  return CS16 ? CS16->Name.Offset : CS32->Name.Offset;
300  }
301 
302  uint32_t getValue() const { return CS16 ? CS16->Value : CS32->Value; }
303 
304  int32_t getSectionNumber() const {
305  assert(isSet() && "COFFSymbolRef points to nothing!");
306  if (CS16) {
307  // Reserved sections are returned as negative numbers.
309  return CS16->SectionNumber;
310  return static_cast<int16_t>(CS16->SectionNumber);
311  }
312  return static_cast<int32_t>(CS32->SectionNumber);
313  }
314 
315  uint16_t getType() const {
316  assert(isSet() && "COFFSymbolRef points to nothing!");
317  return CS16 ? CS16->Type : CS32->Type;
318  }
319 
320  uint8_t getStorageClass() const {
321  assert(isSet() && "COFFSymbolRef points to nothing!");
322  return CS16 ? CS16->StorageClass : CS32->StorageClass;
323  }
324 
325  uint8_t getNumberOfAuxSymbols() const {
326  assert(isSet() && "COFFSymbolRef points to nothing!");
327  return CS16 ? CS16->NumberOfAuxSymbols : CS32->NumberOfAuxSymbols;
328  }
329 
330  uint8_t getBaseType() const { return getType() & 0x0F; }
331 
332  uint8_t getComplexType() const {
333  return (getType() & 0xF0) >> COFF::SCT_COMPLEX_TYPE_SHIFT;
334  }
335 
336  bool isAbsolute() const {
337  return getSectionNumber() == -1;
338  }
339 
340  bool isExternal() const {
342  }
343 
344  bool isCommon() const {
346  getValue() != 0;
347  }
348 
349  bool isUndefined() const {
351  getValue() == 0;
352  }
353 
354  bool isWeakExternal() const {
356  }
357 
358  bool isFunctionDefinition() const {
362  }
363 
364  bool isFunctionLineInfo() const {
366  }
367 
368  bool isAnyUndefined() const {
369  return isUndefined() || isWeakExternal();
370  }
371 
372  bool isFileRecord() const {
374  }
375 
376  bool isSection() const {
378  }
379 
380  bool isSectionDefinition() const {
381  // C++/CLI creates external ABS symbols for non-const appdomain globals.
382  // These are also followed by an auxiliary section definition.
383  bool isAppdomainGlobal =
386  bool isOrdinarySection = getStorageClass() == COFF::IMAGE_SYM_CLASS_STATIC;
387  if (!getNumberOfAuxSymbols())
388  return false;
389  return isAppdomainGlobal || isOrdinarySection;
390  }
391 
392  bool isCLRToken() const {
394  }
395 
396 private:
397  bool isSet() const { return CS16 || CS32; }
398 
399  const coff_symbol16 *CS16;
400  const coff_symbol32 *CS32;
401 };
402 
403 struct coff_section {
414 
415  // Returns true if the actual number of relocations is stored in
416  // VirtualAddress field of the first relocation table entry.
417  bool hasExtendedRelocations() const {
419  NumberOfRelocations == UINT16_MAX;
420  }
422  // The IMAGE_SCN_TYPE_NO_PAD bit is a legacy way of getting to
423  // IMAGE_SCN_ALIGN_1BYTES.
425  return 1;
426 
427  // Bit [20:24] contains section alignment. Both 0 and 1 mean alignment 1.
428  uint32_t Shift = (Characteristics >> 20) & 0xF;
429  if (Shift > 0)
430  return 1U << (Shift - 1);
431  return 1;
432  }
433 };
434 
439 };
440 
446  char Unused1[2];
447 };
448 
449 static_assert(sizeof(coff_aux_function_definition) == 18,
450  "auxiliary entry must be 18 bytes");
451 
453  char Unused1[4];
455  char Unused2[6];
457  char Unused3[2];
458 };
459 
460 static_assert(sizeof(coff_aux_bf_and_ef_symbol) == 18,
461  "auxiliary entry must be 18 bytes");
462 
466  char Unused1[10];
467 };
468 
469 static_assert(sizeof(coff_aux_weak_external) == 18,
470  "auxiliary entry must be 18 bytes");
471 
478  uint8_t Selection;
479  uint8_t Unused;
481  int32_t getNumber(bool IsBigObj) const {
482  uint32_t Number = static_cast<uint32_t>(NumberLowPart);
483  if (IsBigObj)
484  Number |= static_cast<uint32_t>(NumberHighPart) << 16;
485  return static_cast<int32_t>(Number);
486  }
487 };
488 
489 static_assert(sizeof(coff_aux_section_definition) == 18,
490  "auxiliary entry must be 18 bytes");
491 
493  uint8_t AuxType;
494  uint8_t Reserved;
496  char MBZ[12];
497 };
498 
499 static_assert(sizeof(coff_aux_clr_token) == 18,
500  "auxiliary entry must be 18 bytes");
501 
511  int getType() const { return TypeInfo & 0x3; }
512  int getNameType() const { return (TypeInfo >> 2) & 0x7; }
513 };
514 
521  bool isNull() const {
522  return ImportLookupTableRVA == 0 && TimeDateStamp == 0 &&
523  ForwarderChain == 0 && NameRVA == 0 && ImportAddressTableRVA == 0;
524  }
525 };
526 
527 template <typename IntTy>
536  // Bit [20:24] contains section alignment.
537  uint32_t Shift = (Characteristics & 0x00F00000) >> 20;
538  if (Shift > 0)
539  return 1U << (Shift - 1);
540  return 0;
541  }
542 };
543 
546 
568 };
569 
591 };
592 
597 };
598 
602 };
603 
606  int getType() const { return Data >> 12; }
607  int getOffset() const { return Data & ((1 << 12) - 1); }
608 };
609 
610 class COFFObjectFile : public ObjectFile {
611 private:
614  const coff_file_header *COFFHeader;
615  const coff_bigobj_file_header *COFFBigObjHeader;
616  const pe32_header *PE32Header;
617  const pe32plus_header *PE32PlusHeader;
618  const data_directory *DataDirectory;
619  const coff_section *SectionTable;
620  const coff_symbol16 *SymbolTable16;
621  const coff_symbol32 *SymbolTable32;
622  const char *StringTable;
623  uint32_t StringTableSize;
624  const coff_import_directory_table_entry *ImportDirectory;
625  const delay_import_directory_table_entry *DelayImportDirectory;
626  uint32_t NumberOfDelayImportDirectory;
627  const export_directory_table_entry *ExportDirectory;
628  const coff_base_reloc_block_header *BaseRelocHeader;
629  const coff_base_reloc_block_header *BaseRelocEnd;
630  const debug_directory *DebugDirectoryBegin;
631  const debug_directory *DebugDirectoryEnd;
632 
633  std::error_code getString(uint32_t offset, StringRef &Res) const;
634 
635  template <typename coff_symbol_type>
636  const coff_symbol_type *toSymb(DataRefImpl Symb) const;
637  const coff_section *toSec(DataRefImpl Sec) const;
638  const coff_relocation *toRel(DataRefImpl Rel) const;
639 
640  std::error_code initSymbolTablePtr();
641  std::error_code initImportTablePtr();
642  std::error_code initDelayImportTablePtr();
643  std::error_code initExportTablePtr();
644  std::error_code initBaseRelocPtr();
645  std::error_code initDebugDirectoryPtr();
646 
647 public:
648  uintptr_t getSymbolTable() const {
649  if (SymbolTable16)
650  return reinterpret_cast<uintptr_t>(SymbolTable16);
651  if (SymbolTable32)
652  return reinterpret_cast<uintptr_t>(SymbolTable32);
653  return uintptr_t(0);
654  }
655  uint16_t getMachine() const {
656  if (COFFHeader)
657  return COFFHeader->Machine;
658  if (COFFBigObjHeader)
659  return COFFBigObjHeader->Machine;
660  llvm_unreachable("no COFF header!");
661  }
662  uint16_t getSizeOfOptionalHeader() const {
663  if (COFFHeader)
664  return COFFHeader->isImportLibrary() ? 0
665  : COFFHeader->SizeOfOptionalHeader;
666  // bigobj doesn't have this field.
667  if (COFFBigObjHeader)
668  return 0;
669  llvm_unreachable("no COFF header!");
670  }
671  uint16_t getCharacteristics() const {
672  if (COFFHeader)
673  return COFFHeader->isImportLibrary() ? 0 : COFFHeader->Characteristics;
674  // bigobj doesn't have characteristics to speak of,
675  // editbin will silently lie to you if you attempt to set any.
676  if (COFFBigObjHeader)
677  return 0;
678  llvm_unreachable("no COFF header!");
679  }
681  if (COFFHeader)
682  return COFFHeader->TimeDateStamp;
683  if (COFFBigObjHeader)
684  return COFFBigObjHeader->TimeDateStamp;
685  llvm_unreachable("no COFF header!");
686  }
688  if (COFFHeader)
689  return COFFHeader->isImportLibrary() ? 0 : COFFHeader->NumberOfSections;
690  if (COFFBigObjHeader)
691  return COFFBigObjHeader->NumberOfSections;
692  llvm_unreachable("no COFF header!");
693  }
695  if (COFFHeader)
696  return COFFHeader->isImportLibrary() ? 0
697  : COFFHeader->PointerToSymbolTable;
698  if (COFFBigObjHeader)
699  return COFFBigObjHeader->PointerToSymbolTable;
700  llvm_unreachable("no COFF header!");
701  }
703  if (COFFHeader)
704  return COFFHeader->isImportLibrary() ? 0 : COFFHeader->NumberOfSymbols;
705  if (COFFBigObjHeader)
706  return COFFBigObjHeader->NumberOfSymbols;
707  llvm_unreachable("no COFF header!");
708  }
710  if (!SymbolTable16 && !SymbolTable32)
711  return 0;
712  return getRawNumberOfSymbols();
713  }
714 protected:
715  void moveSymbolNext(DataRefImpl &Symb) const override;
716  Expected<StringRef> getSymbolName(DataRefImpl Symb) const override;
717  Expected<uint64_t> getSymbolAddress(DataRefImpl Symb) const override;
718  uint32_t getSymbolAlignment(DataRefImpl Symb) const override;
719  uint64_t getSymbolValueImpl(DataRefImpl Symb) const override;
720  uint64_t getCommonSymbolSizeImpl(DataRefImpl Symb) const override;
721  uint32_t getSymbolFlags(DataRefImpl Symb) const override;
724  void moveSectionNext(DataRefImpl &Sec) const override;
725  std::error_code getSectionName(DataRefImpl Sec,
726  StringRef &Res) const override;
727  uint64_t getSectionAddress(DataRefImpl Sec) const override;
728  uint64_t getSectionSize(DataRefImpl Sec) const override;
729  std::error_code getSectionContents(DataRefImpl Sec,
730  StringRef &Res) const override;
731  uint64_t getSectionAlignment(DataRefImpl Sec) const override;
732  bool isSectionCompressed(DataRefImpl Sec) const override;
733  bool isSectionText(DataRefImpl Sec) const override;
734  bool isSectionData(DataRefImpl Sec) const override;
735  bool isSectionBSS(DataRefImpl Sec) const override;
736  bool isSectionVirtual(DataRefImpl Sec) const override;
738  relocation_iterator section_rel_end(DataRefImpl Sec) const override;
739 
740  void moveRelocationNext(DataRefImpl &Rel) const override;
741  uint64_t getRelocationOffset(DataRefImpl Rel) const override;
742  symbol_iterator getRelocationSymbol(DataRefImpl Rel) const override;
743  uint64_t getRelocationType(DataRefImpl Rel) const override;
745  SmallVectorImpl<char> &Result) const override;
746 
747 public:
748  COFFObjectFile(MemoryBufferRef Object, std::error_code &EC);
749  basic_symbol_iterator symbol_begin() const override;
750  basic_symbol_iterator symbol_end() const override;
751  section_iterator section_begin() const override;
752  section_iterator section_end() const override;
753 
754  const coff_section *getCOFFSection(const SectionRef &Section) const;
755  COFFSymbolRef getCOFFSymbol(const DataRefImpl &Ref) const;
757  const coff_relocation *getCOFFRelocation(const RelocationRef &Reloc) const;
758  unsigned getSectionID(SectionRef Sec) const;
759  unsigned getSymbolSectionID(SymbolRef Sym) const;
760 
761  uint8_t getBytesInAddress() const override;
762  StringRef getFileFormatName() const override;
763  unsigned getArch() const override;
764  SubtargetFeatures getFeatures() const override { return SubtargetFeatures(); }
765 
775  return DebugDirectoryBegin;
776  }
778  return DebugDirectoryEnd;
779  }
780 
783  delay_import_directories() const;
788  }
789 
790  const dos_header *getDOSHeader() const {
791  if (!PE32Header && !PE32PlusHeader)
792  return nullptr;
793  return reinterpret_cast<const dos_header *>(base());
794  }
795  std::error_code getPE32Header(const pe32_header *&Res) const;
796  std::error_code getPE32PlusHeader(const pe32plus_header *&Res) const;
797  std::error_code getDataDirectory(uint32_t index,
798  const data_directory *&Res) const;
799  std::error_code getSection(int32_t index, const coff_section *&Res) const;
800  template <typename coff_symbol_type>
801  std::error_code getSymbol(uint32_t Index,
802  const coff_symbol_type *&Res) const {
803  if (Index >= getNumberOfSymbols())
805 
806  Res = reinterpret_cast<coff_symbol_type *>(getSymbolTable()) + Index;
807  return std::error_code();
808  }
810  if (SymbolTable16) {
811  const coff_symbol16 *Symb = nullptr;
812  if (std::error_code EC = getSymbol(index, Symb))
813  return EC;
814  return COFFSymbolRef(Symb);
815  }
816  if (SymbolTable32) {
817  const coff_symbol32 *Symb = nullptr;
818  if (std::error_code EC = getSymbol(index, Symb))
819  return EC;
820  return COFFSymbolRef(Symb);
821  }
823  }
824  template <typename T>
825  std::error_code getAuxSymbol(uint32_t index, const T *&Res) const {
827  if (std::error_code EC = s.getError())
828  return EC;
829  Res = reinterpret_cast<const T *>(s->getRawPtr());
830  return std::error_code();
831  }
832  std::error_code getSymbolName(COFFSymbolRef Symbol, StringRef &Res) const;
833  std::error_code getSymbolName(const coff_symbol_generic *Symbol,
834  StringRef &Res) const;
835 
837 
838  size_t getSymbolTableEntrySize() const {
839  if (COFFHeader)
840  return sizeof(coff_symbol16);
841  if (COFFBigObjHeader)
842  return sizeof(coff_symbol32);
843  llvm_unreachable("null symbol table pointer!");
844  }
845 
847  getRelocations(const coff_section *Sec) const;
848 
849  std::error_code getSectionName(const coff_section *Sec, StringRef &Res) const;
850  uint64_t getSectionSize(const coff_section *Sec) const;
851  std::error_code getSectionContents(const coff_section *Sec,
852  ArrayRef<uint8_t> &Res) const;
853 
854  uint64_t getImageBase() const;
855  std::error_code getVaPtr(uint64_t VA, uintptr_t &Res) const;
856  std::error_code getRvaPtr(uint32_t Rva, uintptr_t &Res) const;
857 
858  /// Given an RVA base and size, returns a valid array of bytes or an error
859  /// code if the RVA and size is not contained completely within a valid
860  /// section.
861  std::error_code getRvaAndSizeAsBytes(uint32_t RVA, uint32_t Size,
862  ArrayRef<uint8_t> &Contents) const;
863 
864  std::error_code getHintName(uint32_t Rva, uint16_t &Hint,
865  StringRef &Name) const;
866 
867  /// Get PDB information out of a codeview debug directory entry.
868  std::error_code getDebugPDBInfo(const debug_directory *DebugDir,
869  const codeview::DebugInfo *&Info,
870  StringRef &PDBFileName) const;
871 
872  /// Get PDB information from an executable. If the information is not present,
873  /// Info will be set to nullptr and PDBFileName will be empty. An error is
874  /// returned only on corrupt object files. Convenience accessor that can be
875  /// used if the debug directory is not already handy.
876  std::error_code getDebugPDBInfo(const codeview::DebugInfo *&Info,
877  StringRef &PDBFileName) const;
878 
879  bool isRelocatableObject() const override;
880  bool is64() const { return PE32PlusHeader; }
881 
882  static inline bool classof(const Binary *v) { return v->isCOFF(); }
883 };
884 
885 // The iterator for the import directory table.
887 public:
888  ImportDirectoryEntryRef() : OwningObject(nullptr) {}
890  uint32_t I, const COFFObjectFile *Owner)
891  : ImportTable(Table), Index(I), OwningObject(Owner) {}
892 
893  bool operator==(const ImportDirectoryEntryRef &Other) const;
894  void moveNext();
895 
899 
903 
904  std::error_code getName(StringRef &Result) const;
905  std::error_code getImportLookupTableRVA(uint32_t &Result) const;
906  std::error_code getImportAddressTableRVA(uint32_t &Result) const;
907 
908  std::error_code
910 
911 private:
912  const coff_import_directory_table_entry *ImportTable;
913  uint32_t Index;
914  const COFFObjectFile *OwningObject;
915 };
916 
918 public:
919  DelayImportDirectoryEntryRef() : OwningObject(nullptr) {}
921  uint32_t I, const COFFObjectFile *Owner)
922  : Table(T), Index(I), OwningObject(Owner) {}
923 
924  bool operator==(const DelayImportDirectoryEntryRef &Other) const;
925  void moveNext();
926 
930 
931  std::error_code getName(StringRef &Result) const;
932  std::error_code getDelayImportTable(
933  const delay_import_directory_table_entry *&Result) const;
934  std::error_code getImportAddress(int AddrIndex, uint64_t &Result) const;
935 
936 private:
938  uint32_t Index;
939  const COFFObjectFile *OwningObject;
940 };
941 
942 // The iterator for the export directory table entry.
944 public:
945  ExportDirectoryEntryRef() : OwningObject(nullptr) {}
947  const COFFObjectFile *Owner)
948  : ExportTable(Table), Index(I), OwningObject(Owner) {}
949 
950  bool operator==(const ExportDirectoryEntryRef &Other) const;
951  void moveNext();
952 
953  std::error_code getDllName(StringRef &Result) const;
954  std::error_code getOrdinalBase(uint32_t &Result) const;
955  std::error_code getOrdinal(uint32_t &Result) const;
956  std::error_code getExportRVA(uint32_t &Result) const;
957  std::error_code getSymbolName(StringRef &Result) const;
958 
959  std::error_code isForwarder(bool &Result) const;
960  std::error_code getForwardTo(StringRef &Result) const;
961 
962 private:
963  const export_directory_table_entry *ExportTable;
964  uint32_t Index;
965  const COFFObjectFile *OwningObject;
966 };
967 
969 public:
970  ImportedSymbolRef() : OwningObject(nullptr) {}
972  const COFFObjectFile *Owner)
973  : Entry32(Entry), Entry64(nullptr), Index(I), OwningObject(Owner) {}
975  const COFFObjectFile *Owner)
976  : Entry32(nullptr), Entry64(Entry), Index(I), OwningObject(Owner) {}
977 
978  bool operator==(const ImportedSymbolRef &Other) const;
979  void moveNext();
980 
981  std::error_code getSymbolName(StringRef &Result) const;
982  std::error_code isOrdinal(bool &Result) const;
983  std::error_code getOrdinal(uint16_t &Result) const;
984  std::error_code getHintNameRVA(uint32_t &Result) const;
985 
986 private:
987  const import_lookup_table_entry32 *Entry32;
988  const import_lookup_table_entry64 *Entry64;
989  uint32_t Index;
990  const COFFObjectFile *OwningObject;
991 };
992 
994 public:
995  BaseRelocRef() : OwningObject(nullptr) {}
997  const COFFObjectFile *Owner)
998  : Header(Header), Index(0), OwningObject(Owner) {}
999 
1000  bool operator==(const BaseRelocRef &Other) const;
1001  void moveNext();
1002 
1003  std::error_code getType(uint8_t &Type) const;
1004  std::error_code getRVA(uint32_t &Result) const;
1005 
1006 private:
1007  const coff_base_reloc_block_header *Header;
1008  uint32_t Index;
1009  const COFFObjectFile *OwningObject;
1010 };
1011 
1012 // Corresponds to `_FPO_DATA` structure in the PE/COFF spec.
1013 struct FpoData {
1014  support::ulittle32_t Offset; // ulOffStart: Offset 1st byte of function code
1015  support::ulittle32_t Size; // cbProcSize: # bytes in function
1016  support::ulittle32_t NumLocals; // cdwLocals: # bytes in locals/4
1017  support::ulittle16_t NumParams; // cdwParams: # bytes in params/4
1019 
1020  // cbProlog: # bytes in prolog
1021  int getPrologSize() const { return Attributes & 0xF; }
1022 
1023  // cbRegs: # regs saved
1024  int getNumSavedRegs() const { return (Attributes >> 8) & 0x7; }
1025 
1026  // fHasSEH: true if seh is func
1027  bool hasSEH() const { return (Attributes >> 9) & 1; }
1028 
1029  // fUseBP: true if EBP has been allocated
1030  bool useBP() const { return (Attributes >> 10) & 1; }
1031 
1032  // cbFrame: frame pointer
1033  int getFP() const { return Attributes >> 14; }
1034 };
1035 
1036 } // end namespace object
1037 } // end namespace llvm
1038 
1039 #endif
std::error_code getRVA(uint32_t &Result) const
uint32_t getNumberOfSections() const
Definition: Object/COFF.h:687
bool operator==(const ImportDirectoryEntryRef &Other) const
bool isOrdinal() const
Definition: Object/COFF.h:180
support::ulittle64_t SizeOfStackReserve
Definition: Object/COFF.h:152
std::error_code getError() const
Definition: ErrorOr.h:169
support::ulittle16_t DLLCharacteristics
Definition: Object/COFF.h:117
std::error_code getImportTableEntry(const coff_import_directory_table_entry *&Result) const
Represents either an error or a value T.
Definition: ErrorOr.h:68
coff_tls_directory< support::little32_t > coff_tls_directory32
Definition: Object/COFF.h:544
The 64-bit PE header that follows the COFF header.
Definition: Object/COFF.h:128
support::ulittle16_t Sig1
Definition: Object/COFF.h:503
uint32_t getSymbolAlignment(DataRefImpl Symb) const override
support::ulittle32_t SizeOfImage
Definition: Object/COFF.h:147
support::ulittle32_t MaximumAllocationSize
Definition: Object/COFF.h:581
support::ulittle32_t PointerToNextFunction
Definition: Object/COFF.h:456
section_iterator section_begin() const override
support::ulittle16_t Machine
Definition: Object/COFF.h:64
support::ulittle16_t InitialIP
Definition: Object/COFF.h:52
support::ulittle32_t SizeOfStackCommit
Definition: Object/COFF.h:119
support::ulittle16_t MaximumExtraParagraphs
Definition: Object/COFF.h:48
iterator_range< imported_symbol_iterator > imported_symbols() const
support::ulittle32_t TimeDateStamp
Definition: Object/COFF.h:517
support::ulittle16_t MinorOperatingSystemVersion
Definition: Object/COFF.h:141
support::ulittle32_t PointerToLinenumbers
Definition: Object/COFF.h:410
bool isNull() const
Definition: Object/COFF.h:521
uint16_t getCharacteristics() const
Definition: Object/COFF.h:671
support::ulittle32_t Name
Definition: Object/COFF.h:201
support::ulittle32_t OrdinalBase
Definition: Object/COFF.h:216
const void * getRawPtr() const
Definition: Object/COFF.h:271
std::error_code getDelayImportTable(const delay_import_directory_table_entry *&Result) const
support::ulittle32_t CheckSum
Definition: Object/COFF.h:114
support::ulittle32_t SizeOfUninitializedData
Definition: Object/COFF.h:98
COFFObjectFile(MemoryBufferRef Object, std::error_code &EC)
uint8_t getStorageClass() const
Definition: Object/COFF.h:320
uint64_t getRelocationOffset(DataRefImpl Rel) const override
bool hasExtendedRelocations() const
Definition: Object/COFF.h:417
std::error_code getImportAddress(int AddrIndex, uint64_t &Result) const
imported_symbol_iterator imported_symbol_begin() const
support::ulittle32_t UnloadDelayImportTable
Definition: Object/COFF.h:206
const uint8_t * base() const
Definition: ObjectFile.h:186
support::ulittle32_t SizeOfHeaders
Definition: Object/COFF.h:148
support::ulittle32_t VirtualAddress
Definition: Object/COFF.h:406
import_directory_iterator import_directory_end() const
support::ulittle16_t Reserved[4]
Definition: Object/COFF.h:56
support::ulittle32_t Attributes
Definition: Object/COFF.h:200
Definition: Object/COFF.h:210
void moveSectionNext(DataRefImpl &Sec) const override
support::ulittle16_t MajorVersion
Definition: Object/COFF.h:168
support::ulittle32_t TimeDateStamp
Definition: Object/COFF.h:507
std::error_code getDebugPDBInfo(const debug_directory *DebugDir, const codeview::DebugInfo *&Info, StringRef &PDBFileName) const
Get PDB information out of a codeview debug directory entry.
void moveRelocationNext(DataRefImpl &Rel) const override
This class is the base class for all object file types.
Definition: ObjectFile.h:178
support::ulittle16_t NumberOfSections
Definition: Object/COFF.h:65
support::ulittle32_t SizeOfImage
Definition: Object/COFF.h:112
support::ulittle32_t PointerToRelocations
Definition: Object/COFF.h:409
uint32_t getAlignment() const
Definition: Object/COFF.h:535
support::ulittle16_t OrdinalHint
Definition: Object/COFF.h:509
bool isSectionCompressed(DataRefImpl Sec) const override
ImportedSymbolRef(const import_lookup_table_entry64 *Entry, uint32_t I, const COFFObjectFile *Owner)
Definition: Object/COFF.h:974
Definition: Object/COFF.h:224
uint32_t getValue() const
Definition: Object/COFF.h:302
std::error_code getImportAddressTableRVA(uint32_t &Result) const
support::ulittle16_t Sig2
Definition: Object/COFF.h:504
uint32_t getAlignment() const
Definition: Object/COFF.h:421
support::ulittle16_t UsedBytesInTheLastPage
Definition: Object/COFF.h:43
std::error_code getSectionContents(DataRefImpl Sec, StringRef &Res) const override
uint64_t getSymbolValueImpl(DataRefImpl Symb) const override
const coff_section * getCOFFSection(const SectionRef &Section) const
std::error_code getSectionName(DataRefImpl Sec, StringRef &Res) const override
support::ulittle32_t SizeOfData
Definition: Object/COFF.h:508
support::ulittle16_t Data
Definition: Object/COFF.h:605
std::error_code getRvaPtr(uint32_t Rva, uintptr_t &Res) const
support::ulittle64_t SizeOfHeapCommit
Definition: Object/COFF.h:155
support::ulittle32_t DelayImportAddressTable
Definition: Object/COFF.h:203
int getPrologSize() const
Definition: Object/COFF.h:1021
uint8_t getBytesInAddress() const override
The number of bytes used to represent an address in this object file format.
basic_symbol_iterator symbol_end() const override
support::ulittle16_t MajorOperatingSystemVersion
Definition: Object/COFF.h:105
char ShortName[COFF::NameSize]
Definition: Object/COFF.h:259
ImportedSymbolRef(const import_lookup_table_entry32 *Entry, uint32_t I, const COFFObjectFile *Owner)
Definition: Object/COFF.h:971
bool isFunctionLineInfo() const
Definition: Object/COFF.h:364
std::error_code isOrdinal(bool &Result) const
support::ulittle16_t HeaderSizeInParagraphs
Definition: Object/COFF.h:46
support::ulittle64_t ImageBase
Definition: Object/COFF.h:137
std::error_code getAuxSymbol(uint32_t index, const T *&Res) const
Definition: Object/COFF.h:825
support::ulittle32_t NameRVA
Definition: Object/COFF.h:215
uint16_t getOrdinal() const
Definition: Object/COFF.h:182
Definition: Object/COFF.h:177
".bf" or ".ef" - beginning or end of function
Definition: Support/COFF.h:197
uint64_t getSectionAlignment(DataRefImpl Sec) const override
support::ulittle32_t LoaderFlags
Definition: Object/COFF.h:156
char Name[COFF::NameSize]
Definition: Object/COFF.h:404
support::ulittle16_t MajorVersion
Definition: Object/COFF.h:213
support::ulittle16_t Machine
Definition: Object/COFF.h:506
support::ulittle32_t SizeOfInitializedData
Definition: Object/COFF.h:133
support::ulittle32_t AddressOfEntryPoint
Definition: Object/COFF.h:99
support::ulittle32_t Type
Definition: Object/COFF.h:170
support::ulittle32_t TimeDateStamp
Definition: Object/COFF.h:66
support::ulittle32_t PointerToSymbolTable
Definition: Object/COFF.h:87
support::ulittle32_t DeCommitFreeBlockThreshold
Definition: Object/COFF.h:578
support::ulittle32_t LoaderFlags
Definition: Object/COFF.h:122
support::ulittle32_t PointerToRawData
Definition: Object/COFF.h:173
This is a value type class that represents a single relocation in the list of relocations in the obje...
Definition: ObjectFile.h:41
support::ulittle16_t SizeOfOptionalHeader
Definition: Object/COFF.h:69
Expected< uint64_t > getSymbolAddress(DataRefImpl Symb) const override
bool operator==(const ExportDirectoryEntryRef &Other) const
support::ulittle32_t SizeOfUninitializedData
Definition: Object/COFF.h:134
uint8_t getBaseType() const
Definition: Object/COFF.h:330
iterator_range< base_reloc_iterator > base_relocs() const
support::ulittle32_t NumLocals
Definition: Object/COFF.h:1016
std::error_code getOrdinal(uint32_t &Result) const
Tagged union holding either a T or a Error.
uint32_t getTimeDateStamp() const
Definition: Object/COFF.h:680
content_iterator< ImportedSymbolRef > imported_symbol_iterator
Definition: Object/COFF.h:37
const int32_t MaxNumberOfSections16
Definition: Support/COFF.h:34
support::ulittle16_t MajorOperatingSystemVersion
Definition: Object/COFF.h:140
iterator_range< import_directory_iterator > import_directories() const
External symbol in dmert public lib.
Definition: Support/COFF.h:204
bool isReservedSectionNumber(int32_t SectionNumber)
Definition: Support/COFF.h:673
union llvm::object::coff_symbol_generic::@114 Name
support::ulittle16_t MinorSubsystemVersion
Definition: Object/COFF.h:110
support::ulittle32_t VirtualSize
Definition: Object/COFF.h:405
support::ulittle16_t InitialRelativeSS
Definition: Object/COFF.h:49
support::ulittle32_t NumberOfSymbols
Definition: Object/COFF.h:88
support::ulittle16_t InitialSP
Definition: Object/COFF.h:50
support::ulittle32_t SizeOfInitializedData
Definition: Object/COFF.h:97
std::error_code getVaPtr(uint64_t VA, uintptr_t &Res) const
int getNumSavedRegs() const
Definition: Object/COFF.h:1024
Expected< SymbolRef::Type > getSymbolType(DataRefImpl Symb) const override
uint32_t getSymbolFlags(DataRefImpl Symb) const override
support::ulittle32_t Win32VersionValue
Definition: Object/COFF.h:146
support::ulittle16_t MajorImageVersion
Definition: Object/COFF.h:142
std::error_code getName(StringRef &Result) const
support::ulittle32_t ExportFlags
Definition: Object/COFF.h:211
uint64_t getSectionAddress(DataRefImpl Sec) const override
iterator_range< const coff_relocation * > getRelocations(const coff_section *Sec) const
support::ulittle16_t OEMinfo
Definition: Object/COFF.h:58
static GCRegistry::Add< OcamlGC > B("ocaml","ocaml 3.10-compatible GC")
std::error_code getSymbolName(StringRef &Result) const
void moveSymbolNext(DataRefImpl &Symb) const override
bool isFunctionDefinition() const
Definition: Object/COFF.h:358
support::ulittle16_t MinorVersion
Definition: Object/COFF.h:169
support::ulittle16_t NumParams
Definition: Object/COFF.h:1017
support::ulittle32_t NamePointerRVA
Definition: Object/COFF.h:220
support::ulittle32_t ExportRVA
Definition: Object/COFF.h:225
support::ulittle32_t NameRVA
Definition: Object/COFF.h:519
bool isRelocatableObject() const override
True if this is a relocatable object (.o/.obj).
unsigned getArch() const override
imported_symbol_iterator imported_symbol_end() const
unsigned getSectionID(SectionRef Sec) const
support::ulittle32_t TimeDateStamp
Definition: Object/COFF.h:80
relocation_iterator section_rel_end(DataRefImpl Sec) const override
bool isCOFF() const
Definition: Binary.h:116
support::ulittle16_t Magic
Definition: Object/COFF.h:93
No type information or unknown base type.
Definition: Support/COFF.h:208
support::ulittle32_t ProcessAffinityMask
Definition: Object/COFF.h:583
support::ulittle16_t Version
Definition: Object/COFF.h:505
std::error_code getForwardTo(StringRef &Result) const
support::ulittle32_t Characteristics
Definition: Object/COFF.h:413
support::ulittle32_t NumberOfRvaAndSize
Definition: Object/COFF.h:157
support::ulittle32_t FileAlignment
Definition: Object/COFF.h:104
support::ulittle32_t Characteristics
Definition: Object/COFF.h:465
support::ulittle32_t DeCommitTotalFreeThreshold
Definition: Object/COFF.h:556
Expected< section_iterator > getSymbolSection(DataRefImpl Symb) const override
support::ulittle16_t MinorSubsystemVersion
Definition: Object/COFF.h:145
support::ulittle16_t InitialRelativeCS
Definition: Object/COFF.h:53
support::ulittle64_t SizeOfHeapReserve
Definition: Object/COFF.h:154
int getOffset() const
Definition: Object/COFF.h:607
The instances of the Type class are immutable: once they are created, they are never changed...
Definition: Type.h:45
uint16_t getMachine() const
Definition: Object/COFF.h:655
const char * getShortName() const
Definition: Object/COFF.h:293
Line number, reformatted as symbol.
Definition: Support/COFF.h:201
support::ulittle32_t SizeOfZeroFill
Definition: Object/COFF.h:533
support::ulittle32_t CheckSum
Definition: Object/COFF.h:149
support::ulittle32_t VirtualMemoryThreshold
Definition: Object/COFF.h:559
int getType() const
Definition: Object/COFF.h:606
support::ulittle32_t MaximumAllocationSize
Definition: Object/COFF.h:558
support::ulittle32_t Win32VersionValue
Definition: Object/COFF.h:111
support::ulittle16_t MinorImageVersion
Definition: Object/COFF.h:108
std::error_code getDataDirectory(uint32_t index, const data_directory *&Res) const
int32_t getSectionNumber() const
Definition: Object/COFF.h:304
support::ulittle64_t SizeOfStackCommit
Definition: Object/COFF.h:153
char ShortName[COFF::NameSize]
Definition: Object/COFF.h:240
support::ulittle16_t Characteristics
Definition: Object/COFF.h:70
Type is formed as (base + (derived << SCT_COMPLEX_TYPE_SHIFT))
Definition: Support/COFF.h:233
The 32-bit PE header that follows the COFF header.
Definition: Object/COFF.h:92
support::ulittle32_t SymbolTableIndex
Definition: Object/COFF.h:495
std::error_code getImportLookupTableRVA(uint32_t &Result) const
uint32_t getRawNumberOfSymbols() const
Definition: Object/COFF.h:702
export_directory_iterator export_directory_end() const
support::ulittle32_t CriticalSectionDefaultTimeout
Definition: Object/COFF.h:554
IntTy Data
Definition: Object/COFF.h:178
COFFSymbolRef(const coff_symbol16 *CS)
Definition: Object/COFF.h:267
COFFSymbolRef(const coff_symbol32 *CS)
Definition: Object/COFF.h:268
support::ulittle32_t Size
Definition: Object/COFF.h:1015
base_reloc_iterator base_reloc_begin() const
support::ulittle32_t RelativeVirtualAddress
Definition: Object/COFF.h:161
Expected< StringRef > getSymbolName(DataRefImpl Symb) const override
support::ulittle16_t FileSizeInPages
Definition: Object/COFF.h:44
support::ulittle32_t Value
Definition: Object/COFF.h:262
support::ulittle16_t Magic
Definition: Object/COFF.h:129
std::error_code getOrdinal(uint16_t &Result) const
uint16_t getSizeOfOptionalHeader() const
Definition: Object/COFF.h:662
support::ulittle16_t MajorSubsystemVersion
Definition: Object/COFF.h:144
uint8_t getComplexType() const
Definition: Object/COFF.h:332
std::error_code getPE32PlusHeader(const pe32plus_header *&Res) const
uint16_t getType() const
Definition: Object/COFF.h:315
support::ulittle32_t TimeStamp
Definition: Object/COFF.h:207
A function that returns a base type.
Definition: Support/COFF.h:229
support::ulittle32_t ImportAddressTableRVA
Definition: Object/COFF.h:520
support::ulittle16_t TypeInfo
Definition: Object/COFF.h:510
relocation_iterator section_rel_begin(DataRefImpl Sec) const override
iterator_range< const debug_directory * > debug_directories() const
Definition: Object/COFF.h:786
support::ulittle16_t Subsystem
Definition: Object/COFF.h:115
support::ulittle32_t Characteristics
Definition: Object/COFF.h:166
support::ulittle16_t Type
Definition: Object/COFF.h:438
support::ulittle16_t MajorSubsystemVersion
Definition: Object/COFF.h:109
support::ulittle32_t OrdinalTableRVA
Definition: Object/COFF.h:221
COFFSymbolRef getCOFFSymbol(const DataRefImpl &Ref) const
coff_symbol< support::ulittle16_t > coff_symbol16
Definition: Object/COFF.h:253
export_directory_iterator export_directory_begin() const
support::ulittle16_t Reserved2[10]
Definition: Object/COFF.h:59
support::ulittle32_t SizeOfRawData
Definition: Object/COFF.h:407
SubtargetFeatures getFeatures() const override
Definition: Object/COFF.h:764
support::ulittle32_t SizeOfHeapCommit
Definition: Object/COFF.h:121
coff_symbol< support::ulittle32_t > coff_symbol32
Definition: Object/COFF.h:254
uint64_t getRelocationType(DataRefImpl Rel) const override
support::ulittle32_t VirtualMemoryThreshold
Definition: Object/COFF.h:582
imported_symbol_iterator lookup_table_end() const
StringRef getFileFormatName() const override
content_iterator< ImportDirectoryEntryRef > import_directory_iterator
Definition: Object/COFF.h:32
DelayImportDirectoryEntryRef(const delay_import_directory_table_entry *T, uint32_t I, const COFFObjectFile *Owner)
Definition: Object/COFF.h:920
support::ulittle32_t ForwarderChain
Definition: Object/COFF.h:518
support::ulittle32_t VirtualAddress
Definition: Object/COFF.h:436
support::ulittle32_t SymbolTableIndex
Definition: Object/COFF.h:437
support::ulittle16_t MajorImageVersion
Definition: Object/COFF.h:107
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
const debug_directory * debug_directory_begin() const
Definition: Object/COFF.h:774
support::ulittle32_t export_name_pointer_table_entry
Definition: Object/COFF.h:229
Definition: Object/COFF.h:515
support::ulittle16_t MinorOperatingSystemVersion
Definition: Object/COFF.h:106
iterator_range< T > make_range(T x, T y)
Convenience function for iterating over sub-ranges.
import_directory_iterator import_directory_begin() const
support::ulittle16_t AddressOfRelocationTable
Definition: Object/COFF.h:54
support::ulittle32_t PointerToRawData
Definition: Object/COFF.h:408
support::ulittle32_t SizeOfStackReserve
Definition: Object/COFF.h:118
support::ulittle32_t DeCommitTotalFreeThreshold
Definition: Object/COFF.h:579
support::ulittle32_t SizeOfCode
Definition: Object/COFF.h:96
support::ulittle16_t Subsystem
Definition: Object/COFF.h:150
support::ulittle32_t BaseOfData
Definition: Object/COFF.h:101
SectionNumberType SectionNumber
Definition: Object/COFF.h:245
support::ulittle16_t MinorVersion
Definition: Object/COFF.h:214
support::ulittle32_t SectionAlignment
Definition: Object/COFF.h:103
bool isWeakExternal() const
Definition: Object/COFF.h:354
support::ulittle16_t DLLCharacteristics
Definition: Object/COFF.h:151
BaseRelocRef(const coff_base_reloc_block_header *Header, const COFFObjectFile *Owner)
Definition: Object/COFF.h:996
uint64_t getCommonSymbolSizeImpl(DataRefImpl Symb) const override
support::ulittle32_t SizeOfHeaders
Definition: Object/COFF.h:113
bool useBP() const
Definition: Object/COFF.h:1030
basic_symbol_iterator symbol_begin() const override
std::error_code getRvaAndSizeAsBytes(uint32_t RVA, uint32_t Size, ArrayRef< uint8_t > &Contents) const
Given an RVA base and size, returns a valid array of bytes or an error code if the RVA and size is no...
iterator_range< imported_symbol_iterator > lookup_table_symbols() const
Definition: Object/COFF.h:604
imported_symbol_iterator imported_symbol_end() const
content_iterator< ExportDirectoryEntryRef > export_directory_iterator
Definition: Object/COFF.h:36
bool isSectionData(DataRefImpl Sec) const override
bool hasSEH() const
Definition: Object/COFF.h:1027
const StringTableOffset & getStringTableOffset() const
Definition: Object/COFF.h:297
ExportDirectoryEntryRef(const export_directory_table_entry *Table, uint32_t I, const COFFObjectFile *Owner)
Definition: Object/COFF.h:946
const dos_header * getDOSHeader() const
Definition: Object/COFF.h:790
friend bool operator<(COFFSymbolRef A, COFFSymbolRef B)
Definition: Object/COFF.h:281
imported_symbol_iterator lookup_table_begin() const
support::ulittle32_t Offset
Definition: Object/COFF.h:1014
The DOS compatible header at the front of all PE/COFF executables.
Definition: Object/COFF.h:41
support::ulittle32_t ModuleHandle
Definition: Object/COFF.h:202
support::ulittle32_t ForwarderRVA
Definition: Object/COFF.h:226
A range adaptor for a pair of iterators.
support::ulittle32_t SizeOfCode
Definition: Object/COFF.h:132
support::ulittle32_t AddressOfEntryPoint
Definition: Object/COFF.h:135
section_iterator section_end() const override
support::ulittle32_t AddressOfRawData
Definition: Object/COFF.h:172
delay_import_directory_iterator delay_import_directory_begin() const
SubtargetFeatures - Manages the enabling and disabling of subtarget specific features.
support::ulittle32_t Size
Definition: Object/COFF.h:162
uint8_t getNumberOfAuxSymbols() const
Definition: Object/COFF.h:325
unsigned getSymbolSectionID(SymbolRef Sym) const
std::error_code getHintName(uint32_t Rva, uint16_t &Hint, StringRef &Name) const
This is a value type class that represents a single symbol in the list of symbols in the object file...
Definition: ObjectFile.h:116
support::ulittle32_t ImageBase
Definition: Object/COFF.h:102
support::ulittle16_t Attributes
Definition: Object/COFF.h:1018
support::ulittle32_t Zeroes
Definition: Object/COFF.h:233
std::error_code getHintNameRVA(uint32_t &Result) const
ImportDirectoryEntryRef(const coff_import_directory_table_entry *Table, uint32_t I, const COFFObjectFile *Owner)
Definition: Object/COFF.h:889
const coff_relocation * getCOFFRelocation(const RelocationRef &Reloc) const
imported_symbol_iterator imported_symbol_begin() const
symbol_iterator getRelocationSymbol(DataRefImpl Rel) const override
delay_import_directory_iterator delay_import_directory_end() const
support::ulittle32_t NumberOfNamePointers
Definition: Object/COFF.h:218
std::error_code getPE32Header(const pe32_header *&Res) const
bool isSectionDefinition() const
Definition: Object/COFF.h:380
import_lookup_table_entry< support::little64_t > import_lookup_table_entry64
Definition: Object/COFF.h:196
support::ulittle32_t BaseOfCode
Definition: Object/COFF.h:100
iterator_range< imported_symbol_iterator > imported_symbols() const
bool isSectionText(DataRefImpl Sec) const override
support::ulittle16_t Checksum
Definition: Object/COFF.h:51
bool operator==(const DelayImportDirectoryEntryRef &Other) const
uintptr_t getSymbolTable() const
Definition: Object/COFF.h:648
support::ulittle16_t MinimumExtraParagraphs
Definition: Object/COFF.h:47
const coff_symbol_generic * getGeneric() const
Definition: Object/COFF.h:275
std::error_code getDllName(StringRef &Result) const
support::ulittle32_t Characteristics
Definition: Object/COFF.h:534
bool operator==(const BaseRelocRef &Other) const
void getRelocationTypeName(DataRefImpl Rel, SmallVectorImpl< char > &Result) const override
support::ulittle32_t SectionAlignment
Definition: Object/COFF.h:138
support::ulittle16_t MinorImageVersion
Definition: Object/COFF.h:143
support::ulittle32_t ImportLookupTableRVA
Definition: Object/COFF.h:516
content_iterator< DelayImportDirectoryEntryRef > delay_import_directory_iterator
Definition: Object/COFF.h:35
#define I(x, y, z)
Definition: MD5.cpp:54
support::ulittle32_t AddressTableEntries
Definition: Object/COFF.h:217
union llvm::object::coff_symbol::@113 Name
size_t getSymbolTableEntrySize() const
Definition: Object/COFF.h:838
import_lookup_table_entry< support::little32_t > import_lookup_table_entry32
Definition: Object/COFF.h:194
Definition: Object/COFF.h:198
support::ulittle16_t export_ordinal_table_entry
Definition: Object/COFF.h:230
iterator_range< export_directory_iterator > export_directories() const
support::ulittle16_t NumberOfLinenumbers
Definition: Object/COFF.h:412
bool isSectionVirtual(DataRefImpl Sec) const override
std::error_code getSymbol(uint32_t Index, const coff_symbol_type *&Res) const
Definition: Object/COFF.h:801
Provides ErrorOr<T> smart pointer.
bool operator==(const ImportedSymbolRef &Other) const
uint64_t getSectionSize(DataRefImpl Sec) const override
support::ulittle32_t CriticalSectionDefaultTimeout
Definition: Object/COFF.h:577
coff_tls_directory< support::little64_t > coff_tls_directory64
Definition: Object/COFF.h:545
support::ulittle16_t NumberOfRelocations
Definition: Object/COFF.h:411
uint32_t getNumberOfSymbols() const
Definition: Object/COFF.h:709
bool isAnyUndefined() const
Definition: Object/COFF.h:368
ErrorOr< COFFSymbolRef > getSymbol(uint32_t index) const
Definition: Object/COFF.h:809
support::ulittle32_t SizeOfData
Definition: Object/COFF.h:171
bool isSectionBSS(DataRefImpl Sec) const override
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
support::ulittle32_t AddressOfNewExeHeader
Definition: Object/COFF.h:60
base_reloc_iterator base_reloc_end() const
int32_t getNumber(bool IsBigObj) const
Definition: Object/COFF.h:481
std::error_code getSymbolName(StringRef &Result) const
std::error_code getOrdinalBase(uint32_t &Result) const
support::ulittle32_t NumberOfSections
Definition: Object/COFF.h:86
support::ulittle32_t BaseOfCode
Definition: Object/COFF.h:136
support::ulittle32_t DeCommitFreeBlockThreshold
Definition: Object/COFF.h:555
support::ulittle32_t Value
Definition: Object/COFF.h:244
static bool classof(const Binary *v)
Definition: Object/COFF.h:882
support::ulittle16_t NumberOfRelocationItems
Definition: Object/COFF.h:45
support::ulittle32_t ExportAddressTableRVA
Definition: Object/COFF.h:219
support::ulittle32_t TimeDateStamp
Definition: Object/COFF.h:212
support::ulittle32_t FileAlignment
Definition: Object/COFF.h:139
support::ulittle32_t NumberOfRvaAndSize
Definition: Object/COFF.h:124
support::ulittle32_t NumberOfSymbols
Definition: Object/COFF.h:68
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:47
std::error_code getType(uint8_t &Type) const
support::ulittle32_t PointerToSymbolTable
Definition: Object/COFF.h:67
content_iterator< BaseRelocRef > base_reloc_iterator
Definition: Object/COFF.h:38
support::ulittle32_t DelayImportNameTable
Definition: Object/COFF.h:204
support::ulittle32_t TimeDateStamp
Definition: Object/COFF.h:167
uint32_t getPointerToSymbolTable() const
Definition: Object/COFF.h:694
std::error_code getName(StringRef &Result) const
uint32_t getHintNameRVA() const
Definition: Object/COFF.h:187
ArrayRef< uint8_t > getSymbolAuxData(COFFSymbolRef Symbol) const
static GCRegistry::Add< ErlangGC > A("erlang","erlang-compatible garbage collector")
StringTableOffset Offset
Definition: Object/COFF.h:241
support::ulittle32_t SizeOfHeapReserve
Definition: Object/COFF.h:120
support::ulittle16_t OverlayNumber
Definition: Object/COFF.h:55
std::error_code getSection(int32_t index, const coff_section *&Res) const
std::error_code isForwarder(bool &Result) const
support::ulittle32_t ProcessAffinityMask
Definition: Object/COFF.h:560
support::ulittle16_t Type
Definition: Object/COFF.h:247
const debug_directory * debug_directory_end() const
Definition: Object/COFF.h:777
support::ulittle16_t OEMid
Definition: Object/COFF.h:57
support::ulittle32_t UnwindInformation
Definition: Object/COFF.h:596
std::error_code getExportRVA(uint32_t &Result) const
support::ulittle32_t BoundDelayImportTable
Definition: Object/COFF.h:205
This is a value type class that represents a single section in the list of sections in the object fil...
Definition: ObjectFile.h:70
iterator_range< delay_import_directory_iterator > delay_import_directories() const
support::ulittle32_t Offset
Definition: Object/COFF.h:234