llvm.org GIT mirror llvm / 7a38c43
[llvm-dlltool] Respect NONAME keyword This adds proper handling of the NONAME-keyword, which makes llvm-dlltool generate an import using the ordinal instead of the name. Patch by by Jannik Vogel, test added by Stefan Schmidt. Differential Revision: https://reviews.llvm.org/D62175 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@361367 91177308-0d34-0410-b5e6-96231b3b80d8 Martin Storsjo 3 months ago
2 changed file(s) with 18 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
594594 ImportType = IMPORT_CONST;
595595
596596 StringRef SymbolName = E.SymbolName.empty() ? E.Name : E.SymbolName;
597 ImportNameType NameType = getNameType(SymbolName, E.Name, Machine, MinGW);
597 ImportNameType NameType = E.Noname
598 ? IMPORT_ORDINAL
599 : getNameType(SymbolName, E.Name,
600 Machine, MinGW);
598601 Expected Name = E.ExtName.empty()
599602 ? SymbolName
600603 : replace(SymbolName, E.Name, E.ExtName);
0 ; RUN: llvm-dlltool -k -m i386 --input-def %s --output-lib %t.a
1 ; RUN: llvm-readobj %t.a | FileCheck %s
2
3 LIBRARY test.dll
4 EXPORTS
5 ByOrdinalFunction @ 1 NONAME
6 ByNameFunction
7
8 ; CHECK: Name type: ordinal
9 ; CHECK: Symbol: __imp__ByOrdinalFunction
10 ; CHECK: Symbol: _ByOrdinalFunction
11 ; CHECK: Name type: noprefix
12 ; CHECK: Symbol: __imp__ByNameFunction
13 ; CHECK: Symbol: _ByNameFunction