aboutsummaryrefslogtreecommitdiff
path: root/lld
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2021-06-18 19:08:25 +0000
committerDimitry Andric <dim@FreeBSD.org>2021-06-18 19:08:25 +0000
commite4bbddaec8689e1b24f25e88958bea700e989542 (patch)
tree054adb83b829924d4a01d719429d91d42d885e77 /lld
parentb4125f7d51da2bb55d3b850dba9a69c201c3422c (diff)
downloadsrc-e4bbddaec8689e1b24f25e88958bea700e989542.tar.gz
src-e4bbddaec8689e1b24f25e88958bea700e989542.zip
Vendor import of llvm-project branch release/12.x llvmorg-12.0.1-rc2-0-ge7dac564cd0e, a.k.a. 12.0.1 rc2.llvmorg-12.0.1-rc2-0-ge7dac564cd0e
Diffstat (limited to 'lld')
-rw-r--r--lld/ELF/SyntheticSections.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lld/ELF/SyntheticSections.cpp b/lld/ELF/SyntheticSections.cpp
index 9a875bd7ec3e..70c36c63d101 100644
--- a/lld/ELF/SyntheticSections.cpp
+++ b/lld/ELF/SyntheticSections.cpp
@@ -3110,7 +3110,9 @@ size_t VersionTableSection::getSize() const {
void VersionTableSection::writeTo(uint8_t *buf) {
buf += 2;
for (const SymbolTableEntry &s : getPartition().dynSymTab->getSymbols()) {
- write16(buf, s.sym->versionId);
+ // Use the original versionId for an unfetched lazy symbol (undefined weak),
+ // which must be VER_NDX_GLOBAL (an undefined versioned symbol is an error).
+ write16(buf, s.sym->isLazy() ? VER_NDX_GLOBAL : s.sym->versionId);
buf += 2;
}
}