1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-18 10:35:55 +00:00

Revert LLVM r306813: Resolve references properly when using .symver

This LLD commit was intended to fix one case of symbol versioning
(LLVM PR28414) but broke FreeBSD buildworld.  It has been reverted
upstream in LLVM r306996.

Discussed with:	dim
This commit is contained in:
Ed Maste 2017-07-03 13:41:05 +00:00
parent f6e653bb10
commit bb07ac4d64
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/projects/clang500-import/; revision=320597

View File

@ -712,31 +712,15 @@ void SymbolTable<ELFT>::assignWildcardVersion(SymbolVersion Ver,
B->symbol()->VersionId = VersionId;
}
static bool isDefaultVersion(SymbolBody *B) {
return B->isInCurrentDSO() && B->getName().find("@@") != StringRef::npos;
}
// This function processes version scripts by updating VersionId
// member of symbols.
template <class ELFT> void SymbolTable<ELFT>::scanVersionScript() {
// Symbol themselves might know their versions because symbols
// can contain versions in the form of <name>@<version>.
// Let them parse and update their names to exclude version suffix.
for (Symbol *Sym : SymVector) {
SymbolBody *Body = Sym->body();
bool IsDefault = isDefaultVersion(Body);
Body->parseSymbolVersion();
if (!IsDefault)
continue;
// <name>@@<version> means the symbol is the default version. If that's the
// case, the symbol is not used only to resolve <name> of version <version>
// but also undefined unversioned symbols with name <name>.
SymbolBody *S = find(Body->getName());
if (S && S->isUndefined())
S->copy(Body);
}
// Let them parse their names.
if (!Config->VersionDefinitions.empty())
for (Symbol *Sym : SymVector)
Sym->body()->parseSymbolVersion();
// Handle edge cases first.
handleAnonymousVersion();