Rename isInCurrentDSO -> isInCurrentOutput.

DSO is short for dynamic shared object, so the function name was a
little confusing because it sounded like it didn't work when we were
a creating statically-linked executable or something.

What we mean by "DSO" here is the current output file that we are
creating. Thus the new name. Alternatively, we could call it the current
ELF module, but "module" is a overloaded word, so I avoided that.

llvm-svn: 316809
This commit is contained in:
Rui Ueyama 2017-10-27 22:54:16 +00:00
parent 0a6dba792f
commit bda337a8d8
6 changed files with 16 additions and 16 deletions

View File

@ -74,7 +74,7 @@ static void resolveReloc(InputSectionBase &Sec, RelT &Rel,
return;
}
if (!B.isInCurrentDSO())
if (!B.isInCurrentOutput())
for (InputSectionBase *Sec : CNamedSections.lookup(B.getName()))
Fn(Sec, 0);
}

View File

@ -210,7 +210,7 @@ void SymbolTable::applySymbolRenames() {
Symbol *Real = &Origs[I];
// If __real_foo was undefined, we don't want it in the symbol table.
if (!Real->body()->isInCurrentDSO())
if (!Real->body()->isInCurrentOutput())
continue;
auto *NewSym = make<Symbol>();
@ -324,7 +324,7 @@ Symbol *SymbolTable::addUndefined(StringRef Name, bool IsLocal, uint8_t Binding,
}
if (Binding != STB_WEAK) {
SymbolBody *B = S->body();
if (!B->isInCurrentDSO())
if (!B->isInCurrentOutput())
S->Binding = Binding;
if (auto *SS = dyn_cast<SharedSymbol>(B))
SS->getFile<ELFT>()->IsUsed = true;
@ -364,7 +364,7 @@ static int compareDefined(Symbol *S, bool WasInserted, uint8_t Binding,
if (WasInserted)
return 1;
SymbolBody *Body = S->body();
if (!Body->isInCurrentDSO())
if (!Body->isInCurrentOutput())
return 1;
if (int R = compareVersion(S, Name))
@ -659,7 +659,7 @@ StringMap<std::vector<SymbolBody *>> &SymbolTable::getDemangledSyms() {
DemangledSyms.emplace();
for (Symbol *Sym : SymVector) {
SymbolBody *B = Sym->body();
if (!B->isInCurrentDSO())
if (!B->isInCurrentOutput())
continue;
if (Optional<std::string> S = demangle(B->getName()))
(*DemangledSyms)[*S].push_back(B);
@ -674,7 +674,7 @@ std::vector<SymbolBody *> SymbolTable::findByVersion(SymbolVersion Ver) {
if (Ver.IsExternCpp)
return getDemangledSyms().lookup(Ver.Name);
if (SymbolBody *B = find(Ver.Name))
if (B->isInCurrentDSO())
if (B->isInCurrentOutput())
return {B};
return {};
}
@ -692,7 +692,7 @@ std::vector<SymbolBody *> SymbolTable::findAllByVersion(SymbolVersion Ver) {
for (Symbol *Sym : SymVector) {
SymbolBody *B = Sym->body();
if (B->isInCurrentDSO() && M.match(B->getName()))
if (B->isInCurrentOutput() && M.match(B->getName()))
Res.push_back(B);
}
return Res;

View File

@ -228,7 +228,7 @@ void SymbolBody::parseSymbolVersion() {
Name = {S.data(), Pos};
// If this is not in this DSO, it is not a definition.
if (!isInCurrentDSO())
if (!isInCurrentOutput())
return;
// '@@' in a symbol name means the default version.
@ -330,7 +330,7 @@ uint8_t Symbol::computeBinding() const {
return Binding;
if (Visibility != STV_DEFAULT && Visibility != STV_PROTECTED)
return STB_LOCAL;
if (VersionId == VER_NDX_LOCAL && body()->isInCurrentDSO())
if (VersionId == VER_NDX_LOCAL && body()->isInCurrentOutput())
return STB_LOCAL;
if (Config->NoGnuUnique && Binding == STB_GNU_UNIQUE)
return STB_GLOBAL;
@ -342,7 +342,7 @@ bool Symbol::includeInDynsym() const {
return false;
if (computeBinding() == STB_LOCAL)
return false;
if (!body()->isInCurrentDSO())
if (!body()->isInCurrentOutput())
return true;
return ExportDynamic;
}

View File

@ -69,7 +69,7 @@ public:
return SymbolKind == LazyArchiveKind || SymbolKind == LazyObjectKind;
}
bool isInCurrentDSO() const {
bool isInCurrentOutput() const {
return SymbolKind == DefinedRegularKind || SymbolKind == DefinedCommonKind;
}

View File

@ -1124,10 +1124,10 @@ template <class ELFT> void DynamicSection<ELFT>::finalizeContents() {
}
if (SymbolBody *B = Symtab->find(Config->Init))
if (B->isInCurrentDSO())
if (B->isInCurrentOutput())
add({DT_INIT, B});
if (SymbolBody *B = Symtab->find(Config->Fini))
if (B->isInCurrentDSO())
if (B->isInCurrentOutput())
add({DT_FINI, B});
bool HasVerNeed = In<ELFT>::VerNeed->getNeedNum() != 0;
@ -1794,7 +1794,7 @@ void GnuHashTableSection::addSymbols(std::vector<SymbolTableEntry> &V) {
// linker has to look them up, so they have to be in the hash table.
if (auto *SS = dyn_cast<SharedSymbol>(S.Symbol))
return SS->CopyRelSec == nullptr && !SS->NeedsPltAddr;
return !S.Symbol->isInCurrentDSO();
return !S.Symbol->isInCurrentOutput();
});
if (Mid == V.end())
return;

View File

@ -749,7 +749,7 @@ static DefinedRegular *
addOptionalRegular(StringRef Name, SectionBase *Sec, uint64_t Val,
uint8_t StOther = STV_HIDDEN, uint8_t Binding = STB_GLOBAL) {
SymbolBody *S = Symtab->find(Name);
if (!S || S->isInCurrentDSO())
if (!S || S->isInCurrentOutput())
return nullptr;
Symbol *Sym = Symtab->addRegular<ELFT>(Name, StOther, STT_NOTYPE, Val,
/*Size=*/0, Binding, Sec,
@ -1223,7 +1223,7 @@ static bool computeIsPreemptible(const SymbolBody &B) {
// At this point copy relocations have not been created yet, so any
// symbol that is not defined locally is preemptible.
if (!B.isInCurrentDSO())
if (!B.isInCurrentOutput())
return true;
// If we have a dynamic list it specifies which local symbols are preemptible.