diff options
author | 2017-03-19 11:13:23 +0000 | |
---|---|---|
committer | 2017-03-19 11:13:23 +0000 | |
commit | 3769369ed638e5c233fb591bf6e36ea419f01fbe (patch) | |
tree | 4acf6f6b397fdcde033a827290329f58c053a04e | |
parent | Match the Kaby Lake and Lewisburg (Skylake-EP PCH) MACs with I219 PHYs. (diff) | |
download | wireguard-openbsd-3769369ed638e5c233fb591bf6e36ea419f01fbe.tar.xz wireguard-openbsd-3769369ed638e5c233fb591bf6e36ea419f01fbe.zip |
Work around a problem where linker-generated symbols are not properly
versioned and end up as local symbols despite being explicitly listed as
global in the version script. This breaks out brk()/sbrk() implementation.
The diff is only a partial solution and unlikely to be accepted as-is
upstream. We'll keep it as a local diff until a better solution is found.
ok guenther@
-rw-r--r-- | gnu/llvm/tools/lld/ELF/SymbolTable.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gnu/llvm/tools/lld/ELF/SymbolTable.cpp b/gnu/llvm/tools/lld/ELF/SymbolTable.cpp index ce257933c26..deecd8d74f4 100644 --- a/gnu/llvm/tools/lld/ELF/SymbolTable.cpp +++ b/gnu/llvm/tools/lld/ELF/SymbolTable.cpp @@ -142,6 +142,12 @@ DefinedRegular<ELFT> *SymbolTable<ELFT>::addIgnored(StringRef Name, SymbolBody *S = find(Name); if (!S || S->isInCurrentDSO()) return nullptr; + if (Visibility == STV_DEFAULT) { + for (SymbolVersion &Ver : Config->VersionScriptGlobals) { + if (!Ver.HasWildcard && Ver.Name == S->getName()) + S->symbol()->VersionId = VER_NDX_GLOBAL; + } + } return addAbsolute(Name, Visibility); } |