Rename IsUsedInDynamicReloc to MustBeInDynSym.

The variable was marking various cases where a symbol must be included
in the dynamic symbol table. Being used by a dynamic relocation was only
one of them.

llvm-svn: 259889
diff --git a/lld/ELF/OutputSections.cpp b/lld/ELF/OutputSections.cpp
index 0565f36..cb98326 100644
--- a/lld/ELF/OutputSections.cpp
+++ b/lld/ELF/OutputSections.cpp
@@ -219,7 +219,7 @@
 void RelocationSection<ELFT>::addReloc(const DynamicReloc<ELFT> &Reloc) {
   SymbolBody *Sym = Reloc.Sym;
   if (!Reloc.UseSymVA && Sym)
-    Sym->setUsedInDynamicReloc();
+    Sym->MustBeInDynSym = true;
   Relocs.push_back(Reloc);
 }
 
diff --git a/lld/ELF/SymbolTable.cpp b/lld/ELF/SymbolTable.cpp
index b5b902d..7da4e2c 100644
--- a/lld/ELF/SymbolTable.cpp
+++ b/lld/ELF/SymbolTable.cpp
@@ -268,7 +268,7 @@
     for (StringRef U : File->getUndefinedSymbols())
       if (SymbolBody *Sym = find(U))
         if (Sym->isDefined())
-          Sym->setUsedInDynamicReloc();
+          Sym->MustBeInDynSym = true;
 }
 
 template class elf2::SymbolTable<ELF32LE>;
diff --git a/lld/ELF/Symbols.cpp b/lld/ELF/Symbols.cpp
index dec8442..4b238f8 100644
--- a/lld/ELF/Symbols.cpp
+++ b/lld/ELF/Symbols.cpp
@@ -128,7 +128,7 @@
   // symbols in the DSO at runtime.
   if (isShared() != Other->isShared())
     if (isa<DefinedRegular<ELFT>>(isShared() ? Other : this))
-      IsUsedInDynamicReloc = Other->IsUsedInDynamicReloc = true;
+      MustBeInDynSym = Other->MustBeInDynSym = true;
 
   if (L != R)
     return -1;
diff --git a/lld/ELF/Symbols.h b/lld/ELF/Symbols.h
index 1d67d3b..84b880f 100644
--- a/lld/ELF/Symbols.h
+++ b/lld/ELF/Symbols.h
@@ -83,8 +83,6 @@
   bool isLazy() const { return SymbolKind == LazyKind; }
   bool isShared() const { return SymbolKind == SharedKind; }
   bool isUsedInRegularObj() const { return IsUsedInRegularObj; }
-  bool isUsedInDynamicReloc() const { return IsUsedInDynamicReloc; }
-  void setUsedInDynamicReloc() { IsUsedInDynamicReloc = true; }
   bool isTls() const { return IsTls; }
   bool isFunc() const { return IsFunc; }
 
@@ -131,10 +129,9 @@
 protected:
   SymbolBody(Kind K, StringRef Name, bool IsWeak, uint8_t Visibility,
              bool IsTls, bool IsFunc)
-      : SymbolKind(K), IsWeak(IsWeak), Visibility(Visibility), IsTls(IsTls),
-        IsFunc(IsFunc), Name(Name) {
+      : SymbolKind(K), IsWeak(IsWeak), Visibility(Visibility),
+        MustBeInDynSym(false), IsTls(IsTls), IsFunc(IsFunc), Name(Name) {
     IsUsedInRegularObj = K != SharedKind && K != LazyKind;
-    IsUsedInDynamicReloc = 0;
   }
 
   const unsigned SymbolKind : 8;
@@ -147,9 +144,11 @@
   // it can be false.
   unsigned IsUsedInRegularObj : 1;
 
+public:
   // If true, the symbol is added to .dynsym symbol table.
-  unsigned IsUsedInDynamicReloc : 1;
+  unsigned MustBeInDynSym : 1;
 
+protected:
   unsigned IsTls : 1;
   unsigned IsFunc : 1;
   StringRef Name;
diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp
index fa80226..bf61340 100644
--- a/lld/ELF/Writer.cpp
+++ b/lld/ELF/Writer.cpp
@@ -366,8 +366,7 @@
         // See "Global Offset Table" in Chapter 5 in the following document
         // for detailed description:
         // ftp://www.linux-mips.org/pub/linux/mips/doc/ABI/mipsabi.pdf
-        // FIXME: Why do we need to set this here?
-        Body->setUsedInDynamicReloc();
+        Body->MustBeInDynSym = true;
         continue;
       }
 
@@ -778,7 +777,7 @@
     return false;
   if (Config->ExportDynamic || Config->Shared)
     return true;
-  return B.isUsedInDynamicReloc();
+  return B.MustBeInDynSym;
 }
 
 // This class knows how to create an output section for a given