本文整理汇总了C++中SymbolBody::isDefined方法的典型用法代码示例。如果您正苦于以下问题:C++ SymbolBody::isDefined方法的具体用法?C++ SymbolBody::isDefined怎么用?C++ SymbolBody::isDefined使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SymbolBody
的用法示例。
在下文中一共展示了SymbolBody::isDefined方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getMaxVersionLen
// Versions are usually assigned to symbols using version scripts,
// but there's another way to assign versions to symbols.
// If a symbol name contains '@', the string after it is not
// actually a part of the symbol name but specifies a version.
// This function takes care of it.
template <class ELFT> void SymbolTable<ELFT>::scanSymbolVersions() {
if (Config->VersionDefinitions.empty())
return;
int MaxVersionLen = getMaxVersionLen();
// Unfortunately there's no way other than iterating over all
// symbols to look for '@' characters in symbol names.
// So this is inherently slow. A good news is that we do this
// only when versions have been defined.
for (Symbol *Sym : SymVector) {
// Symbol versions for exported symbols are by nature
// only for defined global symbols.
SymbolBody *B = Sym->body();
if (!B->isDefined())
continue;
uint8_t Visibility = B->getVisibility();
if (Visibility != STV_DEFAULT && Visibility != STV_PROTECTED)
continue;
// Look for '@' in the symbol name.
StringRef Name;
uint16_t Version;
std::tie(Name, Version) = getSymbolVersion(B, MaxVersionLen);
if (Name.empty())
continue;
B->setName(Name);
Sym->VersionId = Version;
}
}