File tree 3 files changed +43
-1
lines changed 3 files changed +43
-1
lines changed Original file line number Diff line number Diff line change
1
+ ; REQUIRES: x86
2
+
3
+ ; RUN: echo > %t.s
4
+ ; RUN: llvm-mc -filetype=obj -triple=i686-windows %t.s -o %t.obj
5
+ ; RUN: lld-link -machine:x86 -dll -noentry -safeseh:no -out:%t.dll -def:%s %t.obj
6
+ ; RUN: llvm-readobj --coff-exports %t.dll | FileCheck %s
7
+
8
+ ; CHECK: Export {
9
+ ; CHECK-NEXT: Ordinal: 1
10
+ ; CHECK-NEXT: Name: func
11
+ ; CHECK-NEXT: ForwardedTo: other.dll.func
12
+ ; CHECK-NEXT: }
13
+
14
+ LIBRARY test.dll
15
+ EXPORTS
16
+ func = other.dll.func
Original file line number Diff line number Diff line change @@ -238,7 +238,10 @@ class Parser {
238
238
}
239
239
240
240
if (AddUnderscores) {
241
- if (!isDecorated (E.Name , MingwDef))
241
+ // Don't add underscore if the name is already mangled or if it's a
242
+ // forward target.
243
+ if (!isDecorated (E.Name , MingwDef) &&
244
+ (E.ExtName .empty () || !StringRef (E.Name ).contains (" ." )))
242
245
E.Name = (std::string (" _" ).append (E.Name ));
243
246
if (!E.ExtName .empty () && !isDecorated (E.ExtName , MingwDef))
244
247
E.ExtName = (std::string (" _" ).append (E.ExtName ));
Original file line number Diff line number Diff line change
1
+ ; RUN: llvm-lib -machine:x86 -out:%t.lib -def:%s
2
+ ; RUN: llvm-readobj %t.lib | FileCheck %s
3
+
4
+ ; CHECK: File: test.dll
5
+ ; CHECK-NEXT: Format: COFF-import-file-i386
6
+ ; CHECK-NEXT: Type: code
7
+ ; CHECK-NEXT: Name type: noprefix
8
+ ; CHECK-NEXT: Export name: func
9
+ ; CHECK-NEXT: Symbol: __imp__func
10
+ ; CHECK-NEXT: Symbol: _func
11
+ ; CHECK-EMPTY:
12
+ ; CHECK-NEXT: File: test.dll
13
+ ; CHECK-NEXT: Format: COFF-import-file-i386
14
+ ; CHECK-NEXT: Type: code
15
+ ; CHECK-NEXT: Name type: noprefix
16
+ ; CHECK-NEXT: Export name: test.func
17
+ ; CHECK-NEXT: Symbol: __imp__test.func
18
+ ; CHECK-NEXT: Symbol: _test.func
19
+
20
+ LIBRARY test.dll
21
+ EXPORTS
22
+ func
23
+ test.func
You can’t perform that action at this time.
0 commit comments