std::error_code printSymbolName(raw_ostream &OS,
DataRefImpl Symb) const override {
- if (Symb.p == 1)
+ if (Symb.p == 0)
OS << "__imp_";
OS << StringRef(Data.getBufferStart() + sizeof(coff_import_header));
return std::error_code();
return BasicSymbolRef(Symb, this);
}
+ const coff_import_header *getCOFFImportHeader() const {
+ return reinterpret_cast<const object::coff_import_header *>(
+ Data.getBufferStart());
+ }
+
private:
bool isCode() const {
- auto *Import = reinterpret_cast<const object::coff_import_header *>(
- Data.getBufferStart());
- return Import->getType() == COFF::IMPORT_CODE;
+ return getCOFFImportHeader()->getType() == COFF::IMPORT_CODE;
}
};