mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-13 14:47:00 +00:00
COFF Import: expose both symbols
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
This commit is contained in:
parent
a7fa95c0e5
commit
df4f50c81f
@ -53,7 +53,7 @@ public:
|
||||
|
||||
basic_symbol_iterator symbol_end() const override {
|
||||
DataRefImpl Symb;
|
||||
Symb.p = isCode() ? 2 : 1;
|
||||
Symb.p = isData() ? 1 : 2;
|
||||
return BasicSymbolRef(Symb, this);
|
||||
}
|
||||
|
||||
@ -63,8 +63,8 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
bool isCode() const {
|
||||
return getCOFFImportHeader()->getType() == COFF::IMPORT_CODE;
|
||||
bool isData() const {
|
||||
return getCOFFImportHeader()->getType() == COFF::IMPORT_DATA;
|
||||
}
|
||||
};
|
||||
|
||||
|
BIN
test/tools/llvm-readobj/Inputs/const-import.lib
Normal file
BIN
test/tools/llvm-readobj/Inputs/const-import.lib
Normal file
Binary file not shown.
7
test/tools/llvm-readobj/coff-const-import.test
Normal file
7
test/tools/llvm-readobj/coff-const-import.test
Normal file
@ -0,0 +1,7 @@
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user