OSDN Git Service

[Object][COFF] Set the generic SF_Exported flag on COFF exported symbols.
authorLang Hames <lhames@gmail.com>
Sun, 24 Jan 2016 21:56:40 +0000 (21:56 +0000)
committerLang Hames <lhames@gmail.com>
Sun, 24 Jan 2016 21:56:40 +0000 (21:56 +0000)
The ORC ObjectLinkingLayer uses this flag during symbol lookup. Failure to set
it causes all symbols to behave as if they were non-exported, which has caused
failures in the kaleidoscope tutorials on Windows. Raising the flag should
un-break the tutorials.

No test case yet - none of the existing command line tools for printing symbol
tables (llvm-nm, llvm-objdump) show the status of this flag, and I don't want to
change the format from these tools without consulting their owners. I'll send an
email to the dev-list to figure out the right way forward.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258665 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Object/COFFObjectFile.cpp

index 4cd6aff..35e9392 100644 (file)
@@ -207,7 +207,7 @@ uint32_t COFFObjectFile::getSymbolFlags(DataRefImpl Ref) const {
   uint32_t Result = SymbolRef::SF_None;
 
   if (Symb.isExternal() || Symb.isWeakExternal())
-    Result |= SymbolRef::SF_Global;
+    Result |= (SymbolRef::SF_Global | SymbolRef::SF_Exported);
 
   if (Symb.isWeakExternal())
     Result |= SymbolRef::SF_Weak;