[PATCH] D51457: [LLD] [COFF] Skip exporting artificial symbols when exporting all symbols

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 29 22:45:40 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL341017: [COFF] Skip exporting artificial symbols when exporting all symbols (authored by mstorsjo, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D51457?vs=163172&id=163255#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D51457

Files:
  lld/trunk/COFF/MinGW.cpp
  lld/trunk/test/COFF/export-all.s


Index: lld/trunk/test/COFF/export-all.s
===================================================================
--- lld/trunk/test/COFF/export-all.s
+++ lld/trunk/test/COFF/export-all.s
@@ -21,6 +21,7 @@
 .global _dataSym
 .global _unexported
 .global __imp__unexported
+.global .refptr._foobar
 .text
 _DllMainCRTStartup at 12:
   ret
@@ -33,6 +34,8 @@
   .int 4
 __imp__unexported:
   .int _unexported
+.refptr._foobar:
+  .int _foobar
 
 # Test specifying -export-all-symbols, on an object file that contains
 # dllexport directive for some of the symbols.
Index: lld/trunk/COFF/MinGW.cpp
===================================================================
--- lld/trunk/COFF/MinGW.cpp
+++ lld/trunk/COFF/MinGW.cpp
@@ -102,8 +102,9 @@
     return false;
 
   // Don't export anything that looks like an import symbol (which also can be
-  // a manually defined data symbol with such a name).
-  if (Sym->getName().startswith("__imp_"))
+  // a manually defined data symbol with such a name); don't export artificial
+  // symbols like .refptr pointer stubs.
+  if (Sym->getName().startswith("__imp_") || Sym->getName().startswith("."))
     return false;
 
   // If a corresponding __imp_ symbol exists and is defined, don't export it.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D51457.163255.patch
Type: text/x-patch
Size: 1232 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180830/932bb99b/attachment.bin>


More information about the llvm-commits mailing list