summaryrefslogtreecommitdiffstats
path: root/gnu/llvm/tools/lld/ELF/SymbolTable.cpp
diff options
context:
space:
mode:
authorpatrick <patrick@openbsd.org>2017-03-14 08:07:52 +0000
committerpatrick <patrick@openbsd.org>2017-03-14 08:07:52 +0000
commit1cb66ada17adf0954eaadba4d02ec2470365a3ac (patch)
tree521159d8f39562a43fffd680147eb5a71709b9b1 /gnu/llvm/tools/lld/ELF/SymbolTable.cpp
parentMark the sshd_config UsePrivilegeSeparation option as deprecated, (diff)
downloadwireguard-openbsd-1cb66ada17adf0954eaadba4d02ec2470365a3ac.tar.xz
wireguard-openbsd-1cb66ada17adf0954eaadba4d02ec2470365a3ac.zip
Import LLVM 4.0.0 release including clang and lld.
Diffstat (limited to 'gnu/llvm/tools/lld/ELF/SymbolTable.cpp')
-rw-r--r--gnu/llvm/tools/lld/ELF/SymbolTable.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/gnu/llvm/tools/lld/ELF/SymbolTable.cpp b/gnu/llvm/tools/lld/ELF/SymbolTable.cpp
index b3e91c9f32e..ce257933c26 100644
--- a/gnu/llvm/tools/lld/ELF/SymbolTable.cpp
+++ b/gnu/llvm/tools/lld/ELF/SymbolTable.cpp
@@ -140,7 +140,7 @@ template <class ELFT>
DefinedRegular<ELFT> *SymbolTable<ELFT>::addIgnored(StringRef Name,
uint8_t Visibility) {
SymbolBody *S = find(Name);
- if (!S || !S->isUndefined())
+ if (!S || S->isInCurrentDSO())
return nullptr;
return addAbsolute(Name, Visibility);
}
@@ -283,7 +283,7 @@ static int compareDefined(Symbol *S, bool WasInserted, uint8_t Binding) {
if (WasInserted)
return 1;
SymbolBody *Body = S->body();
- if (Body->isLazy() || Body->isUndefined() || Body->isShared())
+ if (Body->isLazy() || !Body->isInCurrentDSO())
return 1;
if (Binding == STB_WEAK)
return -1;
@@ -464,6 +464,14 @@ template <class ELFT> SymbolBody *SymbolTable<ELFT>::find(StringRef Name) {
}
template <class ELFT>
+SymbolBody *SymbolTable<ELFT>::findInCurrentDSO(StringRef Name) {
+ if (SymbolBody *S = find(Name))
+ if (S->isInCurrentDSO())
+ return S;
+ return nullptr;
+}
+
+template <class ELFT>
void SymbolTable<ELFT>::addLazyArchive(ArchiveFile *F,
const object::Archive::Symbol Sym) {
Symbol *S;