diff --git a/contrib/llvm/tools/lld/ELF/SyntheticSections.cpp b/contrib/llvm/tools/lld/ELF/SyntheticSections.cpp index bc787bc5907..14f459816de 100644 --- a/contrib/llvm/tools/lld/ELF/SyntheticSections.cpp +++ b/contrib/llvm/tools/lld/ELF/SyntheticSections.cpp @@ -1213,11 +1213,13 @@ void RelocationBaseSection::addReloc(const DynamicReloc &Reloc) { void RelocationBaseSection::finalizeContents() { // If all relocations are R_*_RELATIVE they don't refer to any // dynamic symbol and we don't need a dynamic symbol table. If that - // is the case, just use 0 as the link. - Link = InX::DynSymTab ? InX::DynSymTab->getParent()->SectionIndex : 0; + // is the case, just use the index of the regular symbol table section. + getParent()->Link = InX::DynSymTab ? + InX::DynSymTab->getParent()->SectionIndex : + InX::SymTab->getParent()->SectionIndex; - // Set required output section properties. - getParent()->Link = Link; + if (InX::RelaIplt == this || InX::RelaPlt == this) + getParent()->Info = InX::GotPlt->getParent()->SectionIndex; } template diff --git a/lib/clang/include/lld/Common/Version.inc b/lib/clang/include/lld/Common/Version.inc index 5e7f5111371..35d34551cc8 100644 --- a/lib/clang/include/lld/Common/Version.inc +++ b/lib/clang/include/lld/Common/Version.inc @@ -7,4 +7,4 @@ #define LLD_REPOSITORY_STRING "FreeBSD" // - -#define LLD_REVISION_STRING "335540-1200004" +#define LLD_REVISION_STRING "335540-1200005"