diff options
Diffstat (limited to 'lld/ELF/Writer.cpp')
| -rw-r--r-- | lld/ELF/Writer.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp index cd9b760bb23..c7dbafe86ed 100644 --- a/lld/ELF/Writer.cpp +++ b/lld/ELF/Writer.cpp @@ -334,8 +334,10 @@ template <class ELFT> void Writer<ELFT>::createSections() { for (auto &P : Symtab.getSymbols()) { StringRef Name = P.first; SymbolBody *Body = P.second->Body; - if (Body->isStrongUndefined()) - reportUndefined<ELFT>(Symtab, *Body); + if (auto *U = dyn_cast<Undefined<ELFT>>(Body)) { + if (!U->isWeak() && !U->canKeepUndefined()) + reportUndefined<ELFT>(Symtab, *Body); + } if (auto *C = dyn_cast<DefinedCommon<ELFT>>(Body)) CommonSymbols.push_back(C); |

