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. 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@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.