diff options
Diffstat (limited to 'lld/ELF/Writer.cpp')
| -rw-r--r-- | lld/ELF/Writer.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp index 6f42386dde2..0f82ef62487 100644 --- a/lld/ELF/Writer.cpp +++ b/lld/ELF/Writer.cpp @@ -730,8 +730,13 @@ void Writer<ELFT>::scanRelocs(InputSectionBase<ELFT> &S, template <class ELFT> static void reportUndefined(SymbolTable<ELFT> &Symtab, SymbolBody *Sym) { - if ((Config->Relocatable || Config->Shared) && !Config->NoUndefined) - return; + if (!Config->NoUndefined) { + if (Config->Relocatable) + return; + if (Config->Shared) + if (Sym->Backref->Visibility == STV_DEFAULT) + return; + } std::string Msg = "undefined symbol: " + Sym->getName().str(); if (InputFile *File = Symtab.findFile(Sym)) |

