summaryrefslogtreecommitdiff
path: root/lld/ELF/SymbolTable.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2017-01-18 14:43:01 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2017-01-18 14:43:01 +0000
commit1fc8b507770663043a85de766d29afa0f5aa653b (patch)
treecd9612cd3e263eef0367f3d6efba870cd7656d6b /lld/ELF/SymbolTable.cpp
parent72cd787e22843b80addacd48617572e2a6a8d24b (diff)
downloadllvmorg-4.0.0-rc1.tar.gz
Port r292146.llvmorg-4.0.0-rc1
Give priority to linker scripts over preemption. LLD exports symbols that are also present in used shared libraries to make sure they are preempted at runtime. That is a reasonable default, but we must allow for it to be overwritten with linker script. If we don't, libraries that expect to be able to hide a c++ delete operator will fail. This should fix the firebird build. llvm-svn: 292370
Diffstat (limited to 'lld/ELF/SymbolTable.cpp')
-rw-r--r--lld/ELF/SymbolTable.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/lld/ELF/SymbolTable.cpp b/lld/ELF/SymbolTable.cpp
index 6afe3dde9bab..b3e91c9f32e1 100644
--- a/lld/ELF/SymbolTable.cpp
+++ b/lld/ELF/SymbolTable.cpp
@@ -426,12 +426,8 @@ void SymbolTable<ELFT>::addShared(SharedFile<ELFT> *F, StringRef Name,
std::tie(S, WasInserted) =
insert(Name, Sym.getType(), STV_DEFAULT, /*CanOmitFromDynSym*/ true, F);
// Make sure we preempt DSO symbols with default visibility.
- if (Sym.getVisibility() == STV_DEFAULT) {
+ if (Sym.getVisibility() == STV_DEFAULT)
S->ExportDynamic = true;
- // Exporting preempting symbols takes precedence over linker scripts.
- if (S->VersionId == VER_NDX_LOCAL)
- S->VersionId = VER_NDX_GLOBAL;
- }
if (WasInserted || isa<Undefined<ELFT>>(S->body())) {
replaceBody<SharedSymbol<ELFT>>(S, F, Name, Sym, Verdef);
if (!S->isWeak())