diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2017-08-04 17:43:54 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2017-08-04 17:43:54 +0000 |
commit | 0afcef27a12db3730941b257d9535f7e32479fdb (patch) | |
tree | c5c2f0cddffe34d5744c109c37c75e022acee71a | |
parent | af3e93ac932b89f224db44ff64d64589f0508645 (diff) | |
download | bcm5719-llvm-0afcef27a12db3730941b257d9535f7e32479fdb.tar.gz bcm5719-llvm-0afcef27a12db3730941b257d9535f7e32479fdb.zip |
Remove redundant flag.
llvm-svn: 310079
-rw-r--r-- | lld/ELF/Relocations.cpp | 3 | ||||
-rw-r--r-- | lld/ELF/Symbols.cpp | 10 | ||||
-rw-r--r-- | lld/ELF/Symbols.h | 4 |
3 files changed, 6 insertions, 11 deletions
diff --git a/lld/ELF/Relocations.cpp b/lld/ELF/Relocations.cpp index aafb99a8d1d..65ca82cd013 100644 --- a/lld/ELF/Relocations.cpp +++ b/lld/ELF/Relocations.cpp @@ -526,7 +526,6 @@ template <class ELFT> static void addCopyRelSymbol(SharedSymbol *SS) { // dynamic symbol for each one. This causes the copy relocation to correctly // interpose any aliases. for (SharedSymbol *Sym : getSymbolsAt<ELFT>(SS)) { - Sym->NeedsCopy = true; Sym->CopyRelSec = Sec; Sym->CopyRelSecOff = Off; Sym->symbol()->IsUsedInRegularObj = true; @@ -579,7 +578,7 @@ static RelExpr adjustExpr(SymbolBody &Body, RelExpr Expr, uint32_t Type, if (Body.isObject()) { // Produce a copy relocation. auto *B = cast<SharedSymbol>(&Body); - if (!B->NeedsCopy) { + if (!B->CopyRelSec) { if (Config->ZNocopyreloc) error("unresolvable relocation " + toString(Type) + " against symbol '" + toString(*B) + diff --git a/lld/ELF/Symbols.cpp b/lld/ELF/Symbols.cpp index 61032a6368d..82d55085d0f 100644 --- a/lld/ELF/Symbols.cpp +++ b/lld/ELF/Symbols.cpp @@ -106,7 +106,7 @@ static uint64_t getSymVA(const SymbolBody &Body, int64_t &Addend) { cast<DefinedCommon>(Body).Offset; case SymbolBody::SharedKind: { auto &SS = cast<SharedSymbol>(Body); - if (SS.NeedsCopy) + if (SS.CopyRelSec) return SS.CopyRelSec->getParent()->Addr + SS.CopyRelSec->OutSecOff + SS.CopyRelSecOff; if (SS.NeedsPltAddr) @@ -125,7 +125,7 @@ static uint64_t getSymVA(const SymbolBody &Body, int64_t &Addend) { SymbolBody::SymbolBody(Kind K, StringRefZ Name, bool IsLocal, uint8_t StOther, uint8_t Type) - : SymbolKind(K), NeedsCopy(false), NeedsPltAddr(false), IsLocal(IsLocal), + : SymbolKind(K), NeedsPltAddr(false), IsLocal(IsLocal), IsInGlobalMipsGot(false), Is32BitMipsGot(false), IsInIplt(false), IsInIgot(false), Type(Type), StOther(StOther), Name(Name) {} @@ -138,8 +138,8 @@ bool SymbolBody::isPreemptible() const { // Shared symbols resolve to the definition in the DSO. The exceptions are // symbols with copy relocations (which resolve to .bss) or preempt plt // entries (which resolve to that plt entry). - if (isShared()) - return !NeedsCopy && !NeedsPltAddr; + if (auto *SS = dyn_cast<SharedSymbol>(this)) + return !SS->CopyRelSec && !NeedsPltAddr; // Only symbols that appear in dynsym can be preempted. if (!symbol()->includeInDynsym()) @@ -220,7 +220,7 @@ OutputSection *SymbolBody::getOutputSection() const { } if (auto *S = dyn_cast<SharedSymbol>(this)) { - if (S->NeedsCopy) + if (S->CopyRelSec) return S->CopyRelSec->getParent(); return nullptr; } diff --git a/lld/ELF/Symbols.h b/lld/ELF/Symbols.h index 5c1c8ee558b..ec6e83fcfe4 100644 --- a/lld/ELF/Symbols.h +++ b/lld/ELF/Symbols.h @@ -104,10 +104,6 @@ protected: const unsigned SymbolKind : 8; public: - // True if the linker has to generate a copy relocation. - // For SharedSymbol only. - unsigned NeedsCopy : 1; - // True the symbol should point to its PLT entry. // For SharedSymbol only. unsigned NeedsPltAddr : 1; |