[llvm] r258665 - [Object][COFF] Set the generic SF_Exported flag on COFF exported symbols.
Lang Hames via llvm-commits
llvm-commits at lists.llvm.org
Sun Jan 24 13:56:41 PST 2016
Author: lhames
Date: Sun Jan 24 15:56:40 2016
New Revision: 258665
URL: http://llvm.org/viewvc/llvm-project?rev=258665&view=rev
Log:
[Object][COFF] Set the generic SF_Exported flag on COFF exported symbols.
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.
Modified:
llvm/trunk/lib/Object/COFFObjectFile.cpp
Modified: llvm/trunk/lib/Object/COFFObjectFile.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Object/COFFObjectFile.cpp?rev=258665&r1=258664&r2=258665&view=diff
==============================================================================
--- llvm/trunk/lib/Object/COFFObjectFile.cpp (original)
+++ llvm/trunk/lib/Object/COFFObjectFile.cpp Sun Jan 24 15:56:40 2016
@@ -207,7 +207,7 @@ uint32_t COFFObjectFile::getSymbolFlags(
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;
More information about the llvm-commits
mailing list