COFF Import libraries which use the obsolete CONSTANT export are
supposed to get two symbols, one with the `_imp_` prefix and one
without. Ensure that we expose both for iteration. This is necessary
to fix the librarian with COFF CONSTANT exports.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301614
91177308-0d34-0410-b5e6-
96231b3b80d8
basic_symbol_iterator symbol_end() const override {
DataRefImpl Symb;
- Symb.p = isCode() ? 2 : 1;
+ Symb.p = isData() ? 1 : 2;
return BasicSymbolRef(Symb, this);
}
}
private:
- bool isCode() const {
- return getCOFFImportHeader()->getType() == COFF::IMPORT_CODE;
+ bool isData() const {
+ return getCOFFImportHeader()->getType() == COFF::IMPORT_DATA;
}
};
--- /dev/null
+RUN: llvm-readobj -coff-exports %S/Inputs/const-import.lib | FileCheck %s
+
+CHECK: Type: const
+CHECK: Name type: noprefix
+CHECK: Symbol: __imp____CFConstantStringClassReference
+CHECK: Symbol: ___CFConstantStringClassReference
+