[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
diff --git a/lld/ELF/Symbols.cpp b/lld/ELF/Symbols.cpp
index c8b8891..30b086f 100644
--- a/lld/ELF/Symbols.cpp
+++ b/lld/ELF/Symbols.cpp
@@ -146,12 +146,13 @@
 }
 
 Defined::Defined(Kind K, StringRef Name, bool IsWeak, uint8_t Visibility,
-                 bool IsTls)
-    : SymbolBody(K, Name, IsWeak, Visibility, IsTls) {}
+                 bool IsTls, bool IsFunction)
+    : SymbolBody(K, Name, IsWeak, Visibility, IsTls, IsFunction) {}
 
 Undefined::Undefined(SymbolBody::Kind K, StringRef N, bool IsWeak,
                      uint8_t Visibility, bool IsTls)
-    : SymbolBody(K, N, IsWeak, Visibility, IsTls), CanKeepUndefined(false) {}
+    : SymbolBody(K, N, IsWeak, Visibility, IsTls, /*IsFunction*/ false),
+      CanKeepUndefined(false) {}
 
 Undefined::Undefined(StringRef N, bool IsWeak, uint8_t Visibility,
                      bool CanKeepUndefined)
@@ -170,12 +171,14 @@
 template <typename ELFT>
 DefinedSynthetic<ELFT>::DefinedSynthetic(StringRef N, uintX_t Value,
                                          OutputSectionBase<ELFT> &Section)
-    : Defined(SymbolBody::DefinedSyntheticKind, N, false, STV_DEFAULT, false),
+    : Defined(SymbolBody::DefinedSyntheticKind, N, false, STV_DEFAULT,
+              /*IsTls*/ false, /*IsFunction*/ false),
       Value(Value), Section(Section) {}
 
 DefinedCommon::DefinedCommon(StringRef N, uint64_t Size, uint64_t Alignment,
                              bool IsWeak, uint8_t Visibility)
-    : Defined(SymbolBody::DefinedCommonKind, N, IsWeak, Visibility, false) {
+    : Defined(SymbolBody::DefinedCommonKind, N, IsWeak, Visibility,
+              /*IsTls*/ false, /*IsFunction*/ false) {
   MaxAlignment = Alignment;
   this->Size = Size;
 }