aboutsummaryrefslogtreecommitdiff
path: root/lld/ELF/SyntheticSections.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lld/ELF/SyntheticSections.cpp')
-rw-r--r--lld/ELF/SyntheticSections.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/lld/ELF/SyntheticSections.cpp b/lld/ELF/SyntheticSections.cpp
index baa7a08..10cbfe1 100644
--- a/lld/ELF/SyntheticSections.cpp
+++ b/lld/ELF/SyntheticSections.cpp
@@ -3798,9 +3798,8 @@ VersionTableSection::VersionTableSection(Ctx &ctx)
}
void VersionTableSection::finalizeContents() {
- // At the moment of june 2016 GNU docs does not mention that sh_link field
- // should be set, but Sun docs do. Also readelf relies on this field.
- getParent()->link = getPartition(ctx).dynSymTab->getParent()->sectionIndex;
+ if (OutputSection *osec = getPartition(ctx).dynSymTab->getParent())
+ getParent()->link = osec->sectionIndex;
}
size_t VersionTableSection::getSize() const {