-Bsymbolic should not make symbols more preemptable.

But it was doing that for protected undefined symbols.

llvm-svn: 274803
This commit is contained in:
Rafael Espindola 2016-07-07 22:50:54 +00:00
parent 3e3652aef2
commit 580d7a1b1e
2 changed files with 10 additions and 3 deletions

View File

@ -129,11 +129,14 @@ bool SymbolBody::isPreemptible() const {
if (!symbol()->includeInDynsym())
return false;
// Normally only default visibility symbols can be preempted, but -Bsymbolic
// means that not even they can be preempted.
// Only default visibility symbols can be preempted.
if (symbol()->Visibility != STV_DEFAULT)
return false;
// -Bsymbolic means that definitions are not preempted.
if (Config->Bsymbolic || (Config->BsymbolicFunctions && isFunc()))
return !isDefined();
return symbol()->Visibility == STV_DEFAULT;
return true;
}
template <class ELFT> InputFile *SymbolBody::getSourceFile() {

View File

@ -28,3 +28,7 @@ nop
do:
callq foo@PLT
callq bar@PLT
.weak zed
.protected zed
.quad zed