[PATCH] D16411: [ELF] Implemented -Bsymbolic-functions command line option
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 21 10:50:56 PST 2016
ruiu added inline comments.
================
Comment at: ELF/OutputSections.cpp:1027-1030
@@ -1026,4 +1026,6 @@
}
- if (!Config->Shared)
+ if (!Config->Shared || Body->getVisibility() != STV_DEFAULT)
return false;
- return Body->getVisibility() == STV_DEFAULT;
+ if (Config->Bsymbolic || (Config->BsymbolicFunctions && Body->isFunction()))
+ return false;
+ return true;
----------------
The conditions inside these `if`s seem to be arbitrarily grouped into two. Probably it is a bit verbose but slightly better.
if (!Config->Shared)
return false;
if (Body->getVisibility() != STV_DEFAULT)
return false;
if (Config->Bsymbolic)
return false;
if (Config->BsymbolicFunction && Body->isFunction())
return false;
return true;
================
Comment at: ELF/Symbols.cpp:84
@@ +83,3 @@
+ uint8_t Visibility, bool IsTls, bool IsFunction)
+ : SymbolBody(K, N, IsWeak, Visibility, IsTls, IsFunction),
+ CanKeepUndefined(false) {}
----------------
I don't think IsFunction is relevant to undefined symbols. You can remove this parameter and always pass false to the base class.
http://reviews.llvm.org/D16411
More information about the llvm-commits
mailing list