26 using namespace object;
43 const uint64_t Size) {
44 if (Addr + Size < Addr || Addr + Size < Size ||
49 return std::error_code();
57 const uint64_t Size =
sizeof(
T)) {
58 uintptr_t Addr = uintptr_t(Ptr);
59 if (std::error_code EC =
checkOffset(M, Addr, Size))
61 Obj =
reinterpret_cast<const T *
>(Addr);
62 return std::error_code();
68 assert(Str.
size() <= 6 &&
"String too long, possible overflow.");
73 while (!Str.
empty()) {
75 if (Str[0] >=
'A' && Str[0] <=
'Z')
76 CharVal = Str[0] -
'A';
77 else if (Str[0] >=
'a' && Str[0] <=
'z')
78 CharVal = Str[0] -
'a' + 26;
79 else if (Str[0] >=
'0' && Str[0] <=
'9')
80 CharVal = Str[0] -
'0' + 52;
81 else if (Str[0] ==
'+')
83 else if (Str[0] ==
'/')
88 Value = (Value * 64) + CharVal;
92 if (Value > std::numeric_limits<uint32_t>::max())
95 Result =
static_cast<uint32_t>(Value);
99 template <
typename coff_symbol_type>
100 const coff_symbol_type *COFFObjectFile::toSymb(
DataRefImpl Ref)
const {
101 const coff_symbol_type *Addr =
102 reinterpret_cast<const coff_symbol_type *
>(Ref.
p);
107 uintptr_t
Offset = uintptr_t(Addr) - uintptr_t(
base());
110 "Symbol did not point to the beginning of a symbol");
124 uintptr_t
Offset = uintptr_t(Addr) - uintptr_t(SectionTable);
126 "Section did not point to the beginning of a section");
133 auto End =
reinterpret_cast<uintptr_t
>(StringTable);
137 Ref.
p =
std::min(reinterpret_cast<uintptr_t>(Symb),
End);
138 }
else if (SymbolTable32) {
141 Ref.
p =
std::min(reinterpret_cast<uintptr_t>(Symb),
End);
177 if (std::error_code EC =
getSection(SectionNumber, Section))
253 Ret.
p =
reinterpret_cast<uintptr_t
>(Sec);
265 Ref.
p =
reinterpret_cast<uintptr_t
>(Sec);
346 if (
getObject(FirstReloc, M, reinterpret_cast<const coff_relocation*>(
378 Ret.
p =
reinterpret_cast<uintptr_t
>(
begin);
388 Ret.
p =
reinterpret_cast<uintptr_t
>(
I);
393 std::error_code COFFObjectFile::initSymbolTablePtr() {
400 if (COFFBigObjHeader)
411 const uint8_t *StringTableAddr =
base() + StringTableOffset;
413 if (std::error_code EC =
getObject(StringTableSizePtr,
Data, StringTableAddr))
415 StringTableSize = *StringTableSizePtr;
416 if (std::error_code EC =
417 getObject(StringTable,
Data, StringTableAddr, StringTableSize))
422 if (StringTableSize < 4)
426 if (StringTableSize > 4 && StringTable[StringTableSize - 1] != 0)
428 return std::error_code();
434 else if (PE32PlusHeader)
443 uint64_t Rva = Addr - ImageBase;
444 assert(Rva <= UINT32_MAX);
454 if (SectionStart <= Addr && Addr < SectionEnd) {
455 uint32_t Offset = Addr - SectionStart;
457 return std::error_code();
471 uint32_t OffsetIntoSection = RVA - SectionStart;
472 if (SectionStart <= RVA && OffsetIntoSection < Section->VirtualSize &&
473 Size <= Section->VirtualSize - OffsetIntoSection) {
478 return std::error_code();
488 uintptr_t IntPtr = 0;
489 if (std::error_code EC =
getRvaPtr(Rva, IntPtr))
491 const uint8_t *Ptr =
reinterpret_cast<const uint8_t *
>(IntPtr);
493 Name =
StringRef(reinterpret_cast<const char *>(Ptr + 2));
494 return std::error_code();
505 if (InfoBytes.
size() <
sizeof(*PDBInfo) + 1)
508 InfoBytes = InfoBytes.
drop_front(
sizeof(*PDBInfo));
509 PDBFileName =
StringRef(reinterpret_cast<const char *>(InfoBytes.
data()),
512 PDBFileName = PDBFileName.
split(
'\0').first;
513 return std::error_code();
525 return std::error_code();
529 std::error_code COFFObjectFile::initImportTablePtr() {
534 return std::error_code();
538 return std::error_code();
544 uintptr_t IntPtr = 0;
545 if (std::error_code EC =
getRvaPtr(ImportTableRva, IntPtr))
549 ImportDirectory =
reinterpret_cast<
551 return std::error_code();
555 std::error_code COFFObjectFile::initDelayImportTablePtr() {
558 return std::error_code();
560 return std::error_code();
563 NumberOfDelayImportDirectory = DataEntry->
Size /
566 uintptr_t IntPtr = 0;
567 if (std::error_code EC =
getRvaPtr(RVA, IntPtr))
569 DelayImportDirectory =
reinterpret_cast<
571 return std::error_code();
575 std::error_code COFFObjectFile::initExportTablePtr() {
580 return std::error_code();
584 return std::error_code();
587 uintptr_t IntPtr = 0;
588 if (std::error_code EC =
getRvaPtr(ExportTableRva, IntPtr))
592 return std::error_code();
595 std::error_code COFFObjectFile::initBaseRelocPtr() {
598 return std::error_code();
600 return std::error_code();
602 uintptr_t IntPtr = 0;
608 IntPtr + DataEntry->
Size);
609 return std::error_code();
612 std::error_code COFFObjectFile::initDebugDirectoryPtr() {
616 return std::error_code();
620 return std::error_code();
626 uintptr_t IntPtr = 0;
629 DebugDirectoryBegin =
reinterpret_cast<const debug_directory *
>(IntPtr);
634 return std::error_code();
639 COFFBigObjHeader(nullptr), PE32Header(nullptr), PE32PlusHeader(nullptr),
640 DataDirectory(nullptr), SectionTable(nullptr), SymbolTable16(nullptr),
641 SymbolTable32(nullptr), StringTable(nullptr), StringTableSize(0),
642 ImportDirectory(nullptr),
643 DelayImportDirectory(nullptr), NumberOfDelayImportDirectory(0),
644 ExportDirectory(nullptr), BaseRelocHeader(nullptr), BaseRelocEnd(nullptr),
645 DebugDirectoryBegin(nullptr), DebugDirectoryEnd(nullptr) {
655 bool HasPEHeader =
false;
662 if (DH->Magic[0] ==
'M' && DH->Magic[1] ==
'Z') {
663 CurPtr = DH->AddressOfNewExeHeader;
689 COFFHeader =
nullptr;
693 COFFBigObjHeader =
nullptr;
699 EC = std::error_code();
711 const uint8_t *DataDirAddr;
712 uint64_t DataDirSize;
726 if ((EC =
getObject(DataDirectory,
Data, DataDirAddr, DataDirSize)))
739 if ((EC = initSymbolTablePtr())) {
740 SymbolTable16 =
nullptr;
741 SymbolTable32 =
nullptr;
742 StringTable =
nullptr;
754 if ((EC = initImportTablePtr()))
756 if ((EC = initDelayImportTablePtr()))
760 if ((EC = initExportTablePtr()))
764 if ((EC = initBaseRelocPtr()))
768 if ((EC = initDebugDirectoryPtr()))
771 EC = std::error_code();
783 Ret.
p =
reinterpret_cast<uintptr_t
>(StringTable);
788 if (!ImportDirectory)
790 if (ImportDirectory->
isNull())
811 DelayImportDirectory, NumberOfDelayImportDirectory,
this));
820 if (!ExportDirectory)
829 Ret.
p =
reinterpret_cast<uintptr_t
>(SectionTable);
837 Ret.
p =
reinterpret_cast<uintptr_t
>(SectionTable + NumSections);
858 return "COFF-x86-64";
864 return "COFF-<unknown arch>";
905 return std::error_code();
910 Res = PE32PlusHeader;
911 return std::error_code();
918 if (!DataDirectory) {
922 assert(PE32Header || PE32PlusHeader);
925 if (Index >= NumEnt) {
929 Res = &DataDirectory[Index];
930 return std::error_code();
937 return std::error_code();
940 Result = SectionTable + (Index - 1);
941 return std::error_code();
946 std::error_code COFFObjectFile::getString(
uint32_t Offset,
948 if (StringTableSize <= 4)
951 if (Offset >= StringTableSize)
953 Result =
StringRef(StringTable + Offset);
954 return std::error_code();
968 return std::error_code();
977 return std::error_code();
982 const uint8_t *Aux =
nullptr;
987 Aux =
reinterpret_cast<const uint8_t *
>(Symbol.
getRawPtr()) + SymbolSize;
990 uintptr_t Offset = uintptr_t(Aux) - uintptr_t(
base());
997 "Aux Symbol data did not point to the beginning of a symbol");
1023 if (std::error_code EC = getString(Offset, Name))
1028 return std::error_code();
1061 Res =
makeArrayRef(reinterpret_cast<const uint8_t *>(ConStart), SectionSize);
1062 return std::error_code();
1070 Rel.
p =
reinterpret_cast<uintptr_t
>(
1086 else if (SymbolTable32)
1105 return toSymb<coff_symbol16>(Ref);
1107 return toSymb<coff_symbol32>(Ref);
1129 #define LLVM_COFF_SWITCH_RELOC_TYPE_NAME(reloc_type) \
1130 case COFF::reloc_type: \
1131 Res = #reloc_type; \
1140 switch (Reloc->
Type) {
1163 switch (Reloc->
Type) {
1184 switch (Reloc->
Type) {
1206 #undef LLVM_COFF_SWITCH_RELOC_TYPE_NAME
1209 return !DataDirectory;
1214 return ImportTable == Other.ImportTable && Index == Other.Index;
1219 if (ImportTable[Index].
isNull()) {
1221 ImportTable =
nullptr;
1227 return getObject(Result, OwningObject->
Data, ImportTable + Index);
1232 uintptr_t Ptr,
int Index) {
1233 if (Object->getBytesInAddress() == 4) {
1243 uintptr_t IntPtr = 0;
1244 Object->getRvaPtr(RVA, IntPtr);
1250 uintptr_t IntPtr = 0;
1251 Object->getRvaPtr(RVA, IntPtr);
1254 if (Object->getBytesInAddress() == 4) {
1255 auto *Entry =
reinterpret_cast<ulittle32_t *
>(IntPtr);
1259 auto *Entry =
reinterpret_cast<ulittle64_t *
>(IntPtr);
1299 uintptr_t IntPtr = 0;
1300 if (std::error_code EC =
1303 Result =
StringRef(reinterpret_cast<const char *>(IntPtr));
1304 return std::error_code();
1310 return std::error_code();
1316 return std::error_code();
1321 return Table == Other.Table && Index == Other.Index;
1346 uintptr_t IntPtr = 0;
1347 if (std::error_code EC = OwningObject->
getRvaPtr(Table[Index].
Name, IntPtr))
1349 Result =
StringRef(reinterpret_cast<const char *>(IntPtr));
1350 return std::error_code();
1356 return std::error_code();
1362 AddrIndex * (OwningObject->
is64() ? 8 : 4);
1363 uintptr_t IntPtr = 0;
1364 if (std::error_code EC = OwningObject->
getRvaPtr(RVA, IntPtr))
1366 if (OwningObject->
is64())
1367 Result = *reinterpret_cast<const ulittle64_t *>(IntPtr);
1369 Result = *
reinterpret_cast<const ulittle32_t *
>(IntPtr);
1370 return std::error_code();
1375 return ExportTable == Other.ExportTable && Index == Other.Index;
1385 uintptr_t IntPtr = 0;
1386 if (std::error_code EC =
1389 Result =
StringRef(reinterpret_cast<const char *>(IntPtr));
1390 return std::error_code();
1397 return std::error_code();
1403 return std::error_code();
1408 uintptr_t IntPtr = 0;
1409 if (std::error_code EC =
1415 return std::error_code();
1422 uintptr_t IntPtr = 0;
1423 if (std::error_code EC =
1434 if (std::error_code EC =
1438 if (std::error_code EC = OwningObject->
getRvaPtr(NamePtr[Offset], IntPtr))
1440 Result =
StringRef(reinterpret_cast<const char *>(IntPtr));
1441 return std::error_code();
1444 return std::error_code();
1456 Result = (Begin <= RVA && RVA <
End);
1457 return std::error_code();
1464 uintptr_t IntPtr = 0;
1465 if (
auto EC = OwningObject->
getRvaPtr(RVA, IntPtr))
1467 Result =
StringRef(reinterpret_cast<const char *>(IntPtr));
1468 return std::error_code();
1473 return Entry32 == Other.Entry32 && Entry64 == Other.Entry64
1474 && Index == Other.Index;
1487 return std::error_code();
1491 return std::error_code();
1494 uintptr_t IntPtr = 0;
1495 if (std::error_code EC = OwningObject->
getRvaPtr(RVA, IntPtr))
1498 Result =
StringRef(reinterpret_cast<const char *>(IntPtr + 2));
1499 return std::error_code();
1507 return std::error_code();
1515 return std::error_code();
1523 return std::error_code();
1529 return std::error_code();
1533 uintptr_t IntPtr = 0;
1534 if (std::error_code EC = OwningObject->
getRvaPtr(RVA, IntPtr))
1536 Result = *
reinterpret_cast<const ulittle16_t *
>(IntPtr);
1537 return std::error_code();
1546 return std::move(Ret);
1550 return Header == Other.Header && Index == Other.Index;
1564 reinterpret_cast<const uint8_t *
>(Header) + Size);
1573 Type = Entry[Index].
getType();
1574 return std::error_code();
1579 Result = Header->
PageRVA + Entry[Index].getOffset();
1580 return std::error_code();
std::error_code getRVA(uint32_t &Result) const
uint32_t getNumberOfSections() const
std::enable_if< std::numeric_limits< T >::is_signed, bool >::type getAsInteger(unsigned Radix, T &Result) const
Parse the current string as an integer of the specified radix.
bool operator==(const ImportDirectoryEntryRef &Other) const
static uint32_t getNumberOfRelocations(const coff_section *Sec, MemoryBufferRef M, const uint8_t *base)
std::error_code getImportTableEntry(const coff_import_directory_table_entry *&Result) const
Represents either an error or a value T.
uint32_t getSymbolAlignment(DataRefImpl Symb) const override
section_iterator section_begin() const override
DataRefImpl getRawDataRefImpl() const
LLVM_ATTRIBUTE_NORETURN void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
iterator_range< imported_symbol_iterator > imported_symbols() const
support::ulittle32_t Name
support::ulittle32_t OrdinalBase
const void * getRawPtr() const
std::error_code getDelayImportTable(const delay_import_directory_table_entry *&Result) const
COFFObjectFile(MemoryBufferRef Object, std::error_code &EC)
uint64_t getRelocationOffset(DataRefImpl Rel) const override
bool hasExtendedRelocations() const
std::error_code getImportAddress(int AddrIndex, uint64_t &Result) const
imported_symbol_iterator imported_symbol_begin() const
const uint8_t * base() const
support::ulittle32_t VirtualAddress
import_directory_iterator import_directory_end() const
This provides a very simple, boring adaptor for a begin and end iterator into a range type...
void moveSectionNext(DataRefImpl &Sec) const override
static std::error_code getObject(const T *&Obj, MemoryBufferRef M, const void *Ptr, const uint64_t Size=sizeof(T))
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
static ErrorOr< std::unique_ptr< COFFObjectFile > > createCOFFObjectFile(MemoryBufferRef Object)
This class is the base class for all object file types.
static const coff_relocation * getFirstReloc(const coff_section *Sec, MemoryBufferRef M, const uint8_t *Base)
support::ulittle32_t PointerToRelocations
const_iterator begin(StringRef path)
Get begin iterator over path.
const char * getBufferStart() const
bool isSectionCompressed(DataRefImpl Sec) const override
uint32_t getValue() const
DataRefImpl getRawDataRefImpl() const
std::error_code getImportAddressTableRVA(uint32_t &Result) const
uint32_t getAlignment() const
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
std::error_code getRvaPtr(uint32_t Rva, uintptr_t &Res) const
static const char BigObjMagic[]
support::ulittle32_t DelayImportAddressTable
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
char ShortName[COFF::NameSize]
std::error_code isOrdinal(bool &Result) const
support::ulittle32_t NameRVA
uint16_t getOrdinal() const
friend class ExportDirectoryEntryRef
uint64_t getSectionAlignment(DataRefImpl Sec) const override
char Name[COFF::NameSize]
ArrayRef< T > makeArrayRef(const T &OneElt)
Construct an ArrayRef from a single element.
static GCRegistry::Add< StatepointGC > D("statepoint-example","an example strategy for statepoint")
This is a value type class that represents a single relocation in the list of relocations in the obje...
Expected< uint64_t > getSymbolAddress(DataRefImpl Symb) const override
bool operator==(const ExportDirectoryEntryRef &Other) const
iterator_range< base_reloc_iterator > base_relocs() const
std::error_code getOrdinal(uint32_t &Result) const
Tagged union holding either a T or a Error.
content_iterator< ImportedSymbolRef > imported_symbol_iterator
static imported_symbol_iterator importedSymbolBegin(uint32_t RVA, const COFFObjectFile *Object)
iterator_range< import_directory_iterator > import_directories() const
bool isReservedSectionNumber(int32_t SectionNumber)
union llvm::object::coff_symbol_generic::@114 Name
support::ulittle32_t VirtualSize
#define LLVM_COFF_SWITCH_RELOC_TYPE_NAME(reloc_type)
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE bool startswith(StringRef Prefix) const
Check if this string starts with the given Prefix.
std::error_code getVaPtr(uint64_t VA, uintptr_t &Res) const
Expected< SymbolRef::Type > getSymbolType(DataRefImpl Symb) const override
uint32_t getSymbolFlags(DataRefImpl Symb) const override
std::error_code getName(StringRef &Result) const
uint64_t getSectionAddress(DataRefImpl Sec) const override
iterator_range< const coff_relocation * > getRelocations(const coff_section *Sec) const
std::error_code getSymbolName(StringRef &Result) const
void moveSymbolNext(DataRefImpl &Symb) const override
support::ulittle32_t NamePointerRVA
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE size_t size() const
size - Get the string size.
support::ulittle32_t ExportRVA
support::ulittle32_t NameRVA
size_t size() const
size - Get the array size.
bool isRelocatableObject() const override
True if this is a relocatable object (.o/.obj).
Maximum length of the test input libFuzzer tries to guess a good value based on the corpus and reports it always prefer smaller inputs during the corpus shuffle When libFuzzer itself reports a bug this exit code will be used If indicates the maximal total time in seconds to run the fuzzer minimizes the provided crash input Use with etc Experimental Use value profile to guide fuzzing Number of simultaneous worker processes to run the jobs If min(jobs, NumberOfCpuCores()/2)\" is used.") FUZZER_FLAG_INT(reload
unsigned getArch() const override
static GCRegistry::Add< CoreCLRGC > E("coreclr","CoreCLR-compatible GC")
imported_symbol_iterator imported_symbol_end() const
unsigned getSectionID(SectionRef Sec) const
content_iterator< SectionRef > section_iterator
static bool checkSize(MemoryBufferRef M, std::error_code &EC, uint64_t Size)
relocation_iterator section_rel_end(DataRefImpl Sec) const override
std::error_code getForwardTo(StringRef &Result) const
support::ulittle32_t Characteristics
Expected< section_iterator > getSymbolSection(DataRefImpl Symb) const override
uint64_t getImageBase() const
bool isFileRecord() const
The instances of the Type class are immutable: once they are created, they are never changed...
uint16_t getMachine() const
Error errorCodeToError(std::error_code EC)
Helper for converting an std::error_code to a Error.
std::error_code getDataDirectory(uint32_t index, const data_directory *&Res) const
const char * getBufferEnd() const
int32_t getSectionNumber() const
std::error_code getImportLookupTableRVA(uint32_t &Result) const
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE StringRef substr(size_t Start, size_t N=npos) const
Return a reference to the substring from [Start, Start + N).
export_directory_iterator export_directory_end() const
base_reloc_iterator base_reloc_begin() const
support::ulittle32_t RelativeVirtualAddress
Expected< StringRef > getSymbolName(DataRefImpl Symb) const override
std::error_code getOrdinal(uint16_t &Result) const
uint8_t getComplexType() const
std::error_code getPE32PlusHeader(const pe32plus_header *&Res) const
static const unsigned End
A function that returns a base type.
support::ulittle32_t ImportAddressTableRVA
relocation_iterator section_rel_begin(DataRefImpl Sec) const override
iterator_range< const debug_directory * > debug_directories() const
support::ulittle16_t Type
support::ulittle32_t OrdinalTableRVA
COFFSymbolRef getCOFFSymbol(const DataRefImpl &Ref) const
section_iterator_range sections() const
export_directory_iterator export_directory_begin() const
static imported_symbol_iterator makeImportedSymbolIterator(const COFFObjectFile *Object, uintptr_t Ptr, int Index)
support::ulittle32_t SizeOfRawData
void append(in_iter in_start, in_iter in_end)
Add the specified range to the end of the SmallVector.
content_iterator< RelocationRef > relocation_iterator
uint64_t getRelocationType(DataRefImpl Rel) const override
imported_symbol_iterator lookup_table_end() const
StringRef getFileFormatName() const override
content_iterator< ImportDirectoryEntryRef > import_directory_iterator
support::ulittle32_t VirtualAddress
support::ulittle32_t SymbolTableIndex
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
size_t getBufferSize() const
friend class ImportDirectoryEntryRef
content_iterator< BasicSymbolRef > basic_symbol_iterator
iterator_range< T > make_range(T x, T y)
Convenience function for iterating over sub-ranges.
import_directory_iterator import_directory_begin() const
support::ulittle32_t PointerToRawData
friend class RelocationRef
bool isWeakExternal() const
uint64_t getCommonSymbolSizeImpl(DataRefImpl Symb) const override
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...
static bool decodeBase64StringEntry(StringRef Str, uint32_t &Result)
iterator_range< imported_symbol_iterator > lookup_table_symbols() const
imported_symbol_iterator imported_symbol_end() const
content_iterator< ExportDirectoryEntryRef > export_directory_iterator
bool isSectionData(DataRefImpl Sec) const override
detail::packed_endian_specific_integral< int16_t, little, unaligned > little16_t
const dos_header * getDOSHeader() const
imported_symbol_iterator lookup_table_begin() const
A range adaptor for a pair of iterators.
section_iterator section_end() const override
support::ulittle32_t AddressOfRawData
delay_import_directory_iterator delay_import_directory_begin() const
LLVM_NODISCARD std::pair< StringRef, StringRef > split(char Separator) const
Split into two substrings around the first occurrence of a separator character.
support::ulittle32_t Size
uint8_t getNumberOfAuxSymbols() const
unsigned getSymbolSectionID(SymbolRef Sym) const
detail::packed_endian_specific_integral< uint16_t, little, unaligned > ulittle16_t
std::error_code getHintName(uint32_t Rva, uint16_t &Hint, StringRef &Name) const
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE bool empty() const
empty - Check if the string is empty.
This is a value type class that represents a single symbol in the list of symbols in the object file...
support::ulittle32_t Zeroes
std::error_code getHintNameRVA(uint32_t &Result) const
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
std::error_code getPE32Header(const pe32_header *&Res) const
bool isSectionDefinition() const
iterator_range< imported_symbol_iterator > imported_symbols() const
bool isSectionText(DataRefImpl Sec) const override
bool operator==(const DelayImportDirectoryEntryRef &Other) const
uintptr_t getSymbolTable() const
const coff_symbol_generic * getGeneric() const
std::error_code getDllName(StringRef &Result) const
bool operator==(const BaseRelocRef &Other) const
void getRelocationTypeName(DataRefImpl Rel, SmallVectorImpl< char > &Result) const override
uint64_t getSymbolValue(DataRefImpl Symb) const
detail::packed_endian_specific_integral< uint64_t, little, unaligned > ulittle64_t
support::ulittle32_t ImportLookupTableRVA
content_iterator< DelayImportDirectoryEntryRef > delay_import_directory_iterator
support::ulittle32_t AddressTableEntries
static const char PEMagic[]
size_t getSymbolTableEntrySize() const
iterator_range< export_directory_iterator > export_directories() const
bool isSectionVirtual(DataRefImpl Sec) const override
static imported_symbol_iterator importedSymbolEnd(uint32_t RVA, const COFFObjectFile *Object)
bool operator==(const ImportedSymbolRef &Other) const
uint64_t getSectionSize(DataRefImpl Sec) const override
support::ulittle16_t NumberOfRelocations
uint32_t getNumberOfSymbols() const
uint8_t NumberOfAuxSymbols
bool isAnyUndefined() const
support::ulittle32_t SizeOfData
bool isSectionBSS(DataRefImpl Sec) const override
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
base_reloc_iterator base_reloc_end() const
detail::packed_endian_specific_integral< uint32_t, little, unaligned > ulittle32_t
ArrayRef< T > drop_front(size_t N=1) const
Drop the first N elements of the array.
std::error_code getSymbolName(StringRef &Result) const
std::error_code getOrdinalBase(uint32_t &Result) const
LLVM Value Representation.
support::ulittle32_t ExportAddressTableRVA
static std::error_code checkOffset(MemoryBufferRef M, uintptr_t Addr, const uint64_t Size)
StringRef - Represent a constant reference to a string, i.e.
std::error_code getType(uint8_t &Type) const
content_iterator< BaseRelocRef > base_reloc_iterator
uint32_t getPointerToSymbolTable() const
std::error_code getName(StringRef &Result) const
uint32_t getHintNameRVA() const
ArrayRef< uint8_t > getSymbolAuxData(COFFSymbolRef Symbol) const
std::error_code getSection(int32_t index, const coff_section *&Res) const
std::error_code isForwarder(bool &Result) const
std::error_code getExportRVA(uint32_t &Result) const
This is a value type class that represents a single section in the list of sections in the object fil...
uint64_t PowerOf2Ceil(uint64_t A)
Returns the power of two which is greater than or equal to the given value.
iterator_range< delay_import_directory_iterator > delay_import_directories() const
support::ulittle32_t Offset
DataRefImpl getRawDataRefImpl() const