Add a isInCurrentDSO helper. NFC.
llvm-svn: 292228
diff --git a/lld/ELF/Symbols.cpp b/lld/ELF/Symbols.cpp
index 7c2b5fb..0fe42be 100644
--- a/lld/ELF/Symbols.cpp
+++ b/lld/ELF/Symbols.cpp
@@ -203,8 +203,8 @@
// Truncate the symbol name so that it doesn't include the version string.
Name = {S.data(), Pos};
- // If this is an undefined or shared symbol it is not a definition.
- if (isUndefined() || isShared())
+ // If this is not in this DSO, it is not a definition.
+ if (!isInCurrentDSO())
return;
// '@@' in a symbol name means the default version.
@@ -300,7 +300,7 @@
if (Visibility != STV_DEFAULT && Visibility != STV_PROTECTED)
return STB_LOCAL;
const SymbolBody *Body = body();
- if (VersionId == VER_NDX_LOCAL && !Body->isUndefined() && !Body->isShared())
+ if (VersionId == VER_NDX_LOCAL && Body->isInCurrentDSO())
return STB_LOCAL;
if (Config->NoGnuUnique && Binding == STB_GNU_UNIQUE)
return STB_GLOBAL;