[PATCH] D39302: Don't internalize dllexport functions.

Filipe Cabecinhas via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 25 12:00:17 PDT 2017


filcab created this revision.

The PS4 platform also has dllexport, but doesn't have the /EXPORT:sym
mechanism that COFF uses (it does have something like that (specific for
dllexport) in object files, though.
It seems to me that lld shouldn't ever be removing dllexported symbols. On
COFF, it eventually knows this and uses R.VisibleInRegularObj eventually gets
set to true from the /EXPORT:sym commands. Not on other platforms.


https://reviews.llvm.org/D39302

Files:
  lib/LTO/LTO.cpp


Index: lib/LTO/LTO.cpp
===================================================================
--- lib/LTO/LTO.cpp
+++ lib/LTO/LTO.cpp
@@ -809,7 +809,8 @@
         continue;
       GV->setUnnamedAddr(R.second.UnnamedAddr ? GlobalValue::UnnamedAddr::Global
                                               : GlobalValue::UnnamedAddr::None);
-      if (R.second.Partition == 0)
+      if (R.second.Partition == 0 &&
+          GV->getDLLStorageClass() != GlobalValue::DLLExportStorageClass)
         GV->setLinkage(GlobalValue::InternalLinkage);
     }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D39302.120293.patch
Type: text/x-patch
Size: 547 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171025/2281c237/attachment.bin>


More information about the llvm-commits mailing list