diff options
author | Martin Storsjo <martin@martin.st> | 2018-07-20 20:48:29 +0000 |
---|---|---|
committer | Martin Storsjo <martin@martin.st> | 2018-07-20 20:48:29 +0000 |
commit | a6ffc9c8df8f8bb7ec36d011e0aed6e1e808916c (patch) | |
tree | f0bca8be95e50142dcfd4206ba89986282a8f5ec /llvm/lib/Object/COFFObjectFile.cpp | |
parent | d432d825ef413545c96386dabcce4290be52f80c (diff) | |
download | bcm5719-llvm-a6ffc9c8df8f8bb7ec36d011e0aed6e1e808916c.tar.gz bcm5719-llvm-a6ffc9c8df8f8bb7ec36d011e0aed6e1e808916c.zip |
[COFF] Adjust how we flag weak externals
This fixes PR36096.
Originally based on a patch by Martell Malone.
Differential Revision: https://reviews.llvm.org/D44357
llvm-svn: 337613
Diffstat (limited to 'llvm/lib/Object/COFFObjectFile.cpp')
-rw-r--r-- | llvm/lib/Object/COFFObjectFile.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Object/COFFObjectFile.cpp b/llvm/lib/Object/COFFObjectFile.cpp index 26194888ac0..d72da3187e0 100644 --- a/llvm/lib/Object/COFFObjectFile.cpp +++ b/llvm/lib/Object/COFFObjectFile.cpp @@ -217,10 +217,10 @@ uint32_t COFFObjectFile::getSymbolFlags(DataRefImpl Ref) const { if (Symb.isExternal() || Symb.isWeakExternal()) Result |= SymbolRef::SF_Global; - if (Symb.isWeakExternal()) { + if (const coff_aux_weak_external *AWE = Symb.getWeakExternal()) { Result |= SymbolRef::SF_Weak; - // We use indirect to allow the archiver to write weak externs - Result |= SymbolRef::SF_Indirect; + if (AWE->Characteristics != COFF::IMAGE_WEAK_EXTERN_SEARCH_ALIAS) + Result |= SymbolRef::SF_Undefined; } if (Symb.getSectionNumber() == COFF::IMAGE_SYM_ABSOLUTE) @@ -235,7 +235,7 @@ uint32_t COFFObjectFile::getSymbolFlags(DataRefImpl Ref) const { if (Symb.isCommon()) Result |= SymbolRef::SF_Common; - if (Symb.isAnyUndefined()) + if (Symb.isUndefined()) Result |= SymbolRef::SF_Undefined; return Result; |