[PATCH] Object: Prepend __imp_ when mangling a dllimport symbol in IRObjectFile.
Peter Collingbourne
peter at pcc.me.uk
Thu Jun 11 14:46:35 PDT 2015
REPOSITORY
rL LLVM
http://reviews.llvm.org/D10400
Files:
llvm/trunk/lib/Object/IRObjectFile.cpp
llvm/trunk/test/CodeGen/X86/dllimport.ll
llvm/trunk/test/Object/dllimport.ll
Index: llvm/trunk/test/CodeGen/X86/dllimport.ll
===================================================================
--- llvm/trunk/test/CodeGen/X86/dllimport.ll
+++ llvm/trunk/test/CodeGen/X86/dllimport.ll
@@ -57,3 +57,7 @@
ret void
}
+
+; CHECK: _fp:
+; CHECK-NEXT: .long _fun
+ at fp = constant void ()* @fun
Index: llvm/trunk/test/Object/dllimport.ll
===================================================================
--- llvm/trunk/test/Object/dllimport.ll
+++ llvm/trunk/test/Object/dllimport.ll
@@ -0,0 +1,17 @@
+; RUN: llvm-as %s -o - | llvm-nm - | FileCheck %s
+
+target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
+target triple = "x86_64-pc-windows-msvc"
+
+; CHECK: U __imp_f
+; CHECK: U __imp_v
+; CHECK: T g
+
+declare dllimport void @f()
+ at v = external dllimport global i32
+
+define void @g() {
+ call void @f()
+ store i32 42, i32* @v
+ ret void
+}
Index: llvm/trunk/lib/Object/IRObjectFile.cpp
===================================================================
--- llvm/trunk/lib/Object/IRObjectFile.cpp
+++ llvm/trunk/lib/Object/IRObjectFile.cpp
@@ -198,6 +198,9 @@
return std::error_code();
}
+ if (GV->hasDLLImportStorageClass())
+ OS << "__imp_";
+
if (Mang)
Mang->getNameWithPrefix(OS, GV, false);
else
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D10400.27549.patch
Type: text/x-patch
Size: 1267 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150611/8485b368/attachment.bin>
More information about the llvm-commits
mailing list