aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Object/COFFObjectFile.cpp
diff options
context:
space:
mode:
authorMartell Malone <martellmalone@gmail.com>2017-07-18 21:26:38 +0000
committerMartell Malone <martellmalone@gmail.com>2017-07-18 21:26:38 +0000
commit1079ef8dfe867945bbced7cdc3e724d406cd2c41 (patch)
treeb3158e44cbb012317a88e547e354ec35391316b8 /llvm/lib/Object/COFFObjectFile.cpp
parentf6b8ac28ab582bd0850482e9bee450c7d78450d7 (diff)
downloadllvm-1079ef8dfe867945bbced7cdc3e724d406cd2c41.zip
llvm-1079ef8dfe867945bbced7cdc3e724d406cd2c41.tar.gz
llvm-1079ef8dfe867945bbced7cdc3e724d406cd2c41.tar.bz2
llvm: add llvm-dlltool support to the archiver
A PE COFF spec compliant import library generator. Intended to be used with mingw-w64. Supports: PE COFF spec (section 8, Import Library Format) PE COFF spec (Aux Format 3: Weak Externals) Reviewed By: ruiu Differential Revision: https://reviews.llvm.org/D29892 This reapplies rL308329, which was reverted in rL308374 llvm-svn: 308379
Diffstat (limited to 'llvm/lib/Object/COFFObjectFile.cpp')
-rw-r--r--llvm/lib/Object/COFFObjectFile.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/Object/COFFObjectFile.cpp b/llvm/lib/Object/COFFObjectFile.cpp
index 1e9b0c5..0a20534 100644
--- a/llvm/lib/Object/COFFObjectFile.cpp
+++ b/llvm/lib/Object/COFFObjectFile.cpp
@@ -227,8 +227,11 @@ uint32_t COFFObjectFile::getSymbolFlags(DataRefImpl Ref) const {
if (Symb.isExternal() || Symb.isWeakExternal())
Result |= SymbolRef::SF_Global;
- if (Symb.isWeakExternal())
+ if (Symb.isWeakExternal()) {
Result |= SymbolRef::SF_Weak;
+ // We use indirect to allow the archiver to write weak externs
+ Result |= SymbolRef::SF_Indirect;
+ }
if (Symb.getSectionNumber() == COFF::IMAGE_SYM_ABSOLUTE)
Result |= SymbolRef::SF_Absolute;