diff options
author | George Rimar <grimar@accesssoftek.com> | 2016-02-02 09:28:53 +0000 |
---|---|---|
committer | George Rimar <grimar@accesssoftek.com> | 2016-02-02 09:28:53 +0000 |
commit | 5c36e5938dbb2d4c135819189fd68fdb5982850c (patch) | |
tree | 8654b9b81ffc4ff91f2dc73f1331349777ac7812 /lld/ELF/OutputSections.cpp | |
parent | ffe19f524548fd8b4e16db4c6bd3528850890e00 (diff) | |
download | bcm5719-llvm-5c36e5938dbb2d4c135819189fd68fdb5982850c.tar.gz bcm5719-llvm-5c36e5938dbb2d4c135819189fd68fdb5982850c.zip |
[ELF] Implemented -Bsymbolic-functions command line option
-Bsymbolic-functions:
When creating a shared library, bind references to global
function symbols to the definition within the shared library, if any.
This patch also fixed behavior of already existent -Bsymbolic:
previously PLT entries were created even if -Bsymbolic was specified.
Differential revision: http://reviews.llvm.org/D16411
llvm-svn: 259481
Diffstat (limited to 'lld/ELF/OutputSections.cpp')
-rw-r--r-- | lld/ELF/OutputSections.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lld/ELF/OutputSections.cpp b/lld/ELF/OutputSections.cpp index 68992bd32c3..d8ec21c722a 100644 --- a/lld/ELF/OutputSections.cpp +++ b/lld/ELF/OutputSections.cpp @@ -895,7 +895,11 @@ bool elf2::canBePreempted(const SymbolBody *Body, bool NeedsGot) { } if (!Config->Shared) return false; - return Body->getVisibility() == STV_DEFAULT; + if (Body->getVisibility() != STV_DEFAULT) + return false; + if (Config->Bsymbolic || (Config->BsymbolicFunctions && Body->isFunc())) + return false; + return true; } template <class ELFT> void OutputSection<ELFT>::writeTo(uint8_t *Buf) { |