summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2016-02-05 15:27:15 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2016-02-05 15:27:15 +0000
commitabebed982a73d30185a8258fa98fb40b6abf65e6 (patch)
tree146dedfcfe7bde69be210eedf539ccb3c1e60b91
parentd05e072b74182c40729b144895567de82cb96a3b (diff)
downloadbcm5719-llvm-abebed982a73d30185a8258fa98fb40b6abf65e6.tar.gz
bcm5719-llvm-abebed982a73d30185a8258fa98fb40b6abf65e6.zip
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
-rw-r--r--lld/ELF/OutputSections.cpp2
-rw-r--r--lld/ELF/SymbolTable.cpp2
-rw-r--r--lld/ELF/Symbols.cpp2
-rw-r--r--lld/ELF/Symbols.h11
-rw-r--r--lld/ELF/Writer.cpp5
5 files changed, 10 insertions, 12 deletions
diff --git a/lld/ELF/OutputSections.cpp b/lld/ELF/OutputSections.cpp
index 0565f36a561..cb98326d440 100644
--- a/lld/ELF/OutputSections.cpp
+++ b/lld/ELF/OutputSections.cpp
@@ -219,7 +219,7 @@ template <class ELFT>
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 b5b902d3c5f..7da4e2cd968 100644
--- a/lld/ELF/SymbolTable.cpp
+++ b/lld/ELF/SymbolTable.cpp
@@ -268,7 +268,7 @@ template <class ELFT> void SymbolTable<ELFT>::scanShlibUndefined() {
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 dec844277c1..4b238f8f31a 100644
--- a/lld/ELF/Symbols.cpp
+++ b/lld/ELF/Symbols.cpp
@@ -128,7 +128,7 @@ template <class ELFT> int SymbolBody::compare(SymbolBody *Other) {
// 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 1d67d3b31c5..84b880fde18 100644
--- a/lld/ELF/Symbols.h
+++ b/lld/ELF/Symbols.h
@@ -83,8 +83,6 @@ public:
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 @@ public:
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 @@ protected:
// 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 fa80226af14..bf613405c1f 100644
--- a/lld/ELF/Writer.cpp
+++ b/lld/ELF/Writer.cpp
@@ -366,8 +366,7 @@ void Writer<ELFT>::scanRelocs(
// 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 @@ static bool includeInDynsym(const SymbolBody &B) {
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
OpenPOWER on IntegriCloud