summaryrefslogtreecommitdiff
path: root/include/llvm/Object/COFF.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/Object/COFF.h')
-rw-r--r--include/llvm/Object/COFF.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/include/llvm/Object/COFF.h b/include/llvm/Object/COFF.h
index 522bf68c6cbd4..ccac02036adc7 100644
--- a/include/llvm/Object/COFF.h
+++ b/include/llvm/Object/COFF.h
@@ -314,6 +314,10 @@ public:
return (getType() & 0xF0) >> COFF::SCT_COMPLEX_TYPE_SHIFT;
}
+ bool isAbsolute() const {
+ return getSectionNumber() == -1;
+ }
+
bool isExternal() const {
return getStorageClass() == COFF::IMAGE_SYM_CLASS_EXTERNAL;
}
@@ -350,6 +354,10 @@ public:
return getStorageClass() == COFF::IMAGE_SYM_CLASS_FILE;
}
+ bool isSection() const {
+ return getStorageClass() == COFF::IMAGE_SYM_CLASS_SECTION;
+ }
+
bool isSectionDefinition() const {
// C++/CLI creates external ABS symbols for non-const appdomain globals.
// These are also followed by an auxiliary section definition.
@@ -441,6 +449,27 @@ struct coff_aux_clr_token {
support::ulittle32_t SymbolTableIndex;
};
+struct coff_import_header {
+ support::ulittle16_t Sig1;
+ support::ulittle16_t Sig2;
+ support::ulittle16_t Version;
+ support::ulittle16_t Machine;
+ support::ulittle32_t TimeDateStamp;
+ support::ulittle32_t SizeOfData;
+ support::ulittle16_t OrdinalHint;
+ support::ulittle16_t TypeInfo;
+ int getType() const { return TypeInfo & 0x3; }
+ int getNameType() const { return (TypeInfo & 0x7) >> 2; }
+};
+
+struct coff_import_directory_table_entry {
+ support::ulittle32_t ImportLookupTableRVA;
+ support::ulittle32_t TimeDateStamp;
+ support::ulittle32_t ForwarderChain;
+ support::ulittle32_t NameRVA;
+ support::ulittle32_t ImportAddressTableRVA;
+};
+
struct coff_load_configuration32 {
support::ulittle32_t Characteristics;
support::ulittle32_t TimeDateStamp;
@@ -612,6 +641,7 @@ protected:
std::error_code getRelocationOffset(DataRefImpl Rel,
uint64_t &Res) const override;
symbol_iterator getRelocationSymbol(DataRefImpl Rel) const override;
+ section_iterator getRelocationSection(DataRefImpl Rel) const override;
std::error_code getRelocationType(DataRefImpl Rel,
uint64_t &Res) const override;
std::error_code